KCMUtils

kcmoduleproxy.h
1 /* This file is part of the KDE project
2  Copyright (C) 2003 Matthias Kretz <[email protected]>
3  Copyright (C) 2004 Frans Englich <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 
19 */
20 
21 #ifndef KCMUTILS_KCMODULEPROXY_H
22 #define KCMUTILS_KCMODULEPROXY_H
23 
24 #include <QStringList>
25 
26 #include <kcmodule.h>
27 #include <kservice.h>
28 #include <kcmutils_export.h>
29 
30 class KAboutData;
31 class KCModuleInfo;
32 class KCModuleProxyPrivate;
33 
65 class KCMUTILS_EXPORT KCModuleProxy : public QWidget
66 {
67  Q_DECLARE_PRIVATE(KCModuleProxy)
68  Q_OBJECT
69 public:
78  explicit KCModuleProxy(const KCModuleInfo &info, QWidget *parent = nullptr,
79  const QStringList &args = QStringList());
80 
91  explicit KCModuleProxy(const QString &serviceName, QWidget *parent = nullptr,
92  const QStringList &args = QStringList());
93 
102  explicit KCModuleProxy(const KService::Ptr &service, QWidget *parent = nullptr,
103  const QStringList &args = QStringList());
104 
108  ~KCModuleProxy() override;
109 
114  void load();
115 
123  void save();
124 
128  QString quickHelp() const;
129 
133  const KAboutData *aboutData() const;
134 
139  KCModule::Buttons buttons() const;
140 
145  bool changed() const;
146 
152  bool defaulted() const;
153 
160  KCModule *realModule() const;
161 
166  KCModuleInfo moduleInfo() const;
167 
171  QString dbusService() const;
175  QString dbusPath() const;
179  QSize minimumSizeHint() const override;
180 
181 public Q_SLOTS:
182 
187  void defaults();
188 
194  void deleteClient();
195 
196 Q_SIGNALS:
197 
198  /*
199  * This signal is emitted when the contained module is changed.
200  */
201  void changed(bool state);
202 
207  void changed(KCModuleProxy *mod);
208 
213  void childClosed();
214 
215  /*
216  * This signal is relayed from the encapsulated module, and
217  * is equivalent to the module's own quickHelpChanged() signal.
218  */
219  void quickHelpChanged();
220 
221 protected:
222 
227  void showEvent(QShowEvent *) override;
228 
229 protected:
230  KCModuleProxyPrivate *const d_ptr;
231 
232 private:
233  Q_PRIVATE_SLOT(d_func(), void _k_moduleChanged(bool))
234  Q_PRIVATE_SLOT(d_func(), void _k_moduleDefaulted(bool))
235  Q_PRIVATE_SLOT(d_func(), void _k_moduleDestroyed())
236  Q_PRIVATE_SLOT(d_func(), void _k_ownerChanged(const QString &service, const QString &oldOwner, const QString &newOwner))
237 };
238 
239 #endif // KUTILS_KCMODULEPROXY_H
virtual QSize minimumSizeHint() const const
virtual void showEvent(QShowEvent *event)
A class that provides information about a KCModule.
Definition: kcmoduleinfo.h:48
Encapsulates a KCModule for embedding.
Definition: kcmoduleproxy.h:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 31 2020 23:02:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.