1 | /* |
2 | This file is part of the KDE libraries |
3 | |
4 | Copyright (c) 2001 Waldo Bastian <bastian@kde.org> |
5 | |
6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. |
10 | |
11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. |
15 | |
16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 | Boston, MA 02110-1301, USA. |
20 | |
21 | */ |
22 | #ifndef __KDEDMODULE_H__ |
23 | #define __KDEDMODULE_H__ |
24 | |
25 | #include <kdecore_export.h> |
26 | |
27 | #include <QtCore/QObject> |
28 | #include <QtCore/QByteArray> |
29 | |
30 | class KDEDModulePrivate; |
31 | class Kded; |
32 | |
33 | class QDBusObjectPath; |
34 | |
35 | /** |
36 | * \class KDEDModule kdedmodule.h <KDEDModule> |
37 | * |
38 | * The base class for KDED modules. |
39 | * |
40 | * KDED modules are realized as shared |
41 | * libraries that are loaded on-demand into kded at runtime. |
42 | * |
43 | * See kdelibs/kded/HOWTO for documentation about writing kded modules. |
44 | * |
45 | * @author Waldo Bastian <bastian@kde.org> |
46 | */ |
47 | class KDECORE_EXPORT KDEDModule: public QObject |
48 | { |
49 | Q_OBJECT |
50 | Q_CLASSINFO("D-Bus Interface" , "org.kde.KDEDModule" ) |
51 | |
52 | friend class Kded; |
53 | public: |
54 | |
55 | /** |
56 | * Constructor |
57 | */ |
58 | explicit KDEDModule(QObject* parent = 0); |
59 | |
60 | virtual ~KDEDModule(); |
61 | |
62 | /** |
63 | * @internal called by kded after loading a module |
64 | * The module name is set from the path of the desktop file, and is |
65 | * used to register the module to D-Bus. |
66 | */ |
67 | void setModuleName( const QString& name ); |
68 | |
69 | QString moduleName() const; |
70 | |
71 | Q_SIGNALS: |
72 | /** |
73 | * Emitted when the module is being deleted. |
74 | */ |
75 | void moduleDeleted(KDEDModule *); |
76 | |
77 | /** |
78 | * Emitted when a mainwindow registers itself. |
79 | */ |
80 | void windowRegistered(qlonglong windowId); |
81 | |
82 | /** |
83 | * Emitted when a mainwindow unregisters itself. |
84 | */ |
85 | void windowUnregistered(qlonglong windowId); |
86 | |
87 | /** |
88 | * Emitted after the module is registered successfully with D-Bus |
89 | * |
90 | * @since 4.2 |
91 | */ |
92 | void moduleRegistered(const QDBusObjectPath &path); |
93 | |
94 | private: |
95 | KDEDModulePrivate* const d; |
96 | }; |
97 | |
98 | #endif |
99 | |