KDBusAddons

kdedmodule.h
1/*
2 This file is part of the KDE libraries
3
4 SPDX-FileCopyrightText: 2001 Waldo Bastian <bastian@kde.org>
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
17class KDEDModulePrivate;
18class Kded;
19
20class QDBusObjectPath;
21class QDBusMessage;
22
23/**
24 * \class KDEDModule kdedmodule.h <KDEDModule>
25 *
26 * The base class for KDED modules.
27 *
28 * KDED modules are constructed as shared libraries that are loaded on-demand
29 * into the kded daemon at runtime.
30 *
31 * See https://invent.kde.org/frameworks/kded/-/blob/master/docs/HOWTO
32 * for documentation about writing kded modules.
33 *
34 * @author Waldo Bastian <bastian@kde.org>
35 */
36class KDBUSADDONS_EXPORT KDEDModule : public QObject
37{
38 Q_OBJECT
39 Q_CLASSINFO("D-Bus Interface", "org.kde.KDEDModule")
40
41 friend class Kded;
42
43public:
44 /**
45 * Constructor
46 */
47 explicit KDEDModule(QObject *parent = nullptr);
48
49 ~KDEDModule() override;
50
51 /**
52 * Sets the name of the module, and uses it to register the module to D-Bus.
53 *
54 * For modules loaded as plugins by a daemon, this is called automatically
55 * by the daemon after loading the module. Module authors should NOT call this.
56 */
57 void setModuleName(const QString &name);
58
59 QString moduleName() const;
60
61 /**
62 * Returns the module being called by this D-Bus message.
63 * Useful for autoloading modules in kded and similar daemons.
64 * @since 5.7
65 */
66 static QString moduleForMessage(const QDBusMessage &message);
67
69 /**
70 * Emitted when a mainwindow registers itself.
71 */
72 void windowRegistered(qlonglong windowId);
73
74 /**
75 * Emitted when a mainwindow unregisters itself.
76 */
77 void windowUnregistered(qlonglong windowId);
78
79 /**
80 * Emitted after the module is registered successfully with D-Bus
81 *
82 * @since 4.2
83 */
85
86private:
87 std::unique_ptr<KDEDModulePrivate> const d;
88};
89
90#endif
The base class for KDED modules.
Definition kdedmodule.h:37
void windowUnregistered(qlonglong windowId)
Emitted when a mainwindow unregisters itself.
void windowRegistered(qlonglong windowId)
Emitted when a mainwindow registers itself.
void moduleRegistered(const QDBusObjectPath &path)
Emitted after the module is registered successfully with D-Bus.
Q_CLASSINFO(Name, Value)
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:55:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.