KDBusAddons

kdedmodule.h
1 /*
2  This file is part of the KDE libraries
3 
4  SPDX-FileCopyrightText: 2001 Waldo Bastian <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 
8 */
9 #ifndef __KDEDMODULE_H__
10 #define __KDEDMODULE_H__
11 
12 #include <kdbusaddons_export.h>
13 
14 #include <QObject>
15 #include <memory>
16 
17 class KDEDModulePrivate;
18 class Kded;
19 
20 class QDBusObjectPath;
21 class QDBusMessage;
22 
23 /**
24  * \class KDEDModule kdedmodule.h <KDEDModule>
25  *
26  * The base class for KDED modules.
27  *
28  * KDED modules are realized as shared
29  * libraries that are loaded on-demand into kded at runtime.
30  *
31  * See kdelibs/kded/HOWTO for documentation about writing kded modules.
32  *
33  * @author Waldo Bastian <[email protected]>
34  */
35 class KDBUSADDONS_EXPORT KDEDModule: public QObject
36 {
37  Q_OBJECT
38  Q_CLASSINFO("D-Bus Interface", "org.kde.KDEDModule")
39 
40  friend class Kded;
41 public:
42 
43  /**
44  * Constructor
45  */
46  explicit KDEDModule(QObject *parent = nullptr);
47 
48  virtual ~KDEDModule();
49 
50  /**
51  * Sets the name of the module, and uses it to register the module to D-Bus.
52  *
53  * For modules loaded as plugins by a daemon, this is called automatically
54  * by the daemon after loading the module. Module authors should NOT call this.
55  */
56  void setModuleName(const QString &name);
57 
58  QString moduleName() const;
59 
60  /**
61  * Returns the module being called by this D-Bus message.
62  * Useful for autoloading modules in kded and similar daemons.
63  * @since 5.7
64  */
65  static QString moduleForMessage(const QDBusMessage &message);
66 
67 Q_SIGNALS:
68  /**
69  * Emitted when the module is being deleted.
70  */
71  void moduleDeleted(KDEDModule *);
72 
73  /**
74  * Emitted when a mainwindow registers itself.
75  */
76  void windowRegistered(qlonglong windowId);
77 
78  /**
79  * Emitted when a mainwindow unregisters itself.
80  */
81  void windowUnregistered(qlonglong windowId);
82 
83  /**
84  * Emitted after the module is registered successfully with D-Bus
85  *
86  * @since 4.2
87  */
88  void moduleRegistered(const QDBusObjectPath &path);
89 
90 private:
91  std::unique_ptr<KDEDModulePrivate> const d;
92 };
93 
94 #endif
Q_CLASSINFO(Name, Value)
The base class for KDED modules.
Definition: kdedmodule.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 22:46:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.