• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDED

  • kded
kded.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 * Copyright (C) 1999 David Faure <faure@kde.org>
3 * (C) 1999 Waldo Bastian <bastian@kde.org>
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#ifndef KDED_H
21#define KDED_H
22
23#include <QtCore/QObject>
24#include <QtCore/QString>
25#include <QtCore/QTimer>
26#include <QtCore/QHash>
27#include <QtCore/QSet>
28
29#include <QtDBus/QtDBus>
30
31#include <ksycoca.h>
32#include <ksycocatype.h>
33#include <kdedmodule.h>
34#include <kservice.h>
35
36class QDBusServiceWatcher;
37class KDirWatch;
38
39// No need for this in libkio - apps only get readonly access
40class Kded : public QObject
41{
42 Q_OBJECT
43public:
44 Kded();
45 virtual ~Kded();
46
47 static Kded *self() { return _self;}
48 static void messageFilter(const QDBusMessage &);
49
50 void noDemandLoad(const QString &obj); // Don't load obj on demand
51
52 KDEDModule *loadModule(const QString &obj, bool onDemand);
53 KDEDModule *loadModule(const KService::Ptr& service, bool onDemand);
54 QStringList loadedModules();
55 bool unloadModule(const QString &obj);
56 //bool isWindowRegistered(qlonglong windowId) const;
66 void registerWindowId(qlonglong windowId, const QString &sender);
70 void unregisterWindowId(qlonglong windowId, const QString &sender);
72 void recreate(const QDBusMessage&);
73 void recreate(bool initial);
74 void loadSecondPhase();
75
77
83 bool isModuleAutoloaded(const QString &module) const;
90 bool isModuleAutoloaded(const KService::Ptr &module) const;
92
94
101 bool isModuleLoadedOnDemand(const QString &module) const;
109 bool isModuleLoadedOnDemand(const KService::Ptr &module) const;
111
123 void setModuleAutoloading(const QString &module, bool autoload);
124
125
126public Q_SLOTS:
130 void initModules();
131
135 void recreate();
136
140 void recreateDone();
141 void recreateFailed(const QDBusError &error);
142
146 void updateDirWatch();
147
151 void updateResourceList();
152
156 void slotApplicationRemoved(const QString&);
157
161 void slotKDEDModuleRemoved(KDEDModule *);
162
163protected Q_SLOTS:
164
168 void dirDeleted(const QString& path);
169
173 void update (const QString& dir );
174
175 void runDelayedCheck();
176
177private:
178 void afterRecreateFinished();
179
183 void readDirectory(const QString& dir );
184
190 KDirWatch* m_pDirWatch;
191
197 QTimer* m_pTimer;
198
199 QList<QDBusMessage> m_recreateRequests;
200 int m_recreateCount;
201 bool m_recreateBusy;
202
203 QHash<QString,KDEDModule *> m_modules;
204 //QHash<QString,KLibrary *> m_libs;
205 QHash<QString,QObject *> m_dontLoad;
206
207 //window id tracking, with a QDBusServiceWatcher to remove them as needed
208 QDBusServiceWatcher *m_serviceWatcher;
209 QHash<QString,QList<qlonglong> > m_windowIdList;
210 QSet<long> m_globalWindowIdList;
211
212 QStringList m_allResourceDirs;
213 bool m_needDelayedCheck;
214
215 static Kded *_self;
216};
217
218class KBuildsycocaAdaptor: public QDBusAbstractAdaptor
219{
220 Q_OBJECT
221 Q_CLASSINFO("D-Bus Interface", "org.kde.kbuildsycoca")
222public:
223 KBuildsycocaAdaptor(QObject *parent);
224
225public Q_SLOTS:
226 Q_NOREPLY void recreate(const QDBusMessage&);
227};
228
229
230class KUpdateD : public QObject
231{
232 Q_OBJECT
233public:
234 KUpdateD();
235 ~KUpdateD();
236
237public Q_SLOTS:
238 void runKonfUpdate();
239 void slotNewUpdateFile();
240
241private:
247 KDirWatch* m_pDirWatch;
248
254 QTimer* m_pTimer;
255};
256
257class KHostnameD : public QObject
258{
259 Q_OBJECT
260public:
261 KHostnameD(int pollInterval);
262 ~KHostnameD();
263
264public Q_SLOTS:
265 void checkHostname();
266
267private:
271 QTimer m_Timer;
272 QByteArray m_hostname;
273};
274
275#endif
KBuildsycocaAdaptor
Definition: kded.h:219
KBuildsycocaAdaptor::recreate
Q_NOREPLY void recreate(const QDBusMessage &)
Definition: kded.cpp:808
KDEDModule
KDirWatch
KHostnameD
Definition: kded.h:258
KHostnameD::~KHostnameD
~KHostnameD()
Definition: kded.cpp:775
KHostnameD::checkHostname
void checkHostname()
Definition: kded.cpp:780
KSharedPtr< KService >
KUpdateD
Definition: kded.h:231
KUpdateD::runKonfUpdate
void runKonfUpdate()
Definition: kded.cpp:758
KUpdateD::~KUpdateD
~KUpdateD()
Definition: kded.cpp:752
KUpdateD::slotNewUpdateFile
void slotNewUpdateFile()
Definition: kded.cpp:763
KUpdateD::KUpdateD
KUpdateD()
Definition: kded.cpp:729
Kded
Definition: kded.h:41
Kded::initModules
void initModules()
Loads / unloads modules according to config.
Definition: kded.cpp:217
Kded::registerWindowId
void registerWindowId(qlonglong windowId, const QString &sender)
Applications can register/unregister their windows with kded modules.
Definition: kded.cpp:682
Kded::recreateDone
void recreateDone()
Recreating finished.
Definition: kded.cpp:571
Kded::~Kded
virtual ~Kded()
Definition: kded.cpp:152
Kded::self
static Kded * self()
Definition: kded.h:47
Kded::messageFilter
static void messageFilter(const QDBusMessage &)
Definition: kded.cpp:177
Kded::noDemandLoad
void noDemandLoad(const QString &obj)
Definition: kded.cpp:300
Kded::update
void update(const QString &dir)
Definition: kded.cpp:602
Kded::setModuleAutoloading
void setModuleAutoloading(const QString &module, bool autoload)
Configure whether a module should be loaded on startup.
Definition: kded.cpp:305
Kded::runDelayedCheck
void runDelayedCheck()
Definition: kded.cpp:523
Kded::isModuleAutoloaded
bool isModuleAutoloaded(const QString &module) const
Check if a module should be loaded on startup.
Definition: kded.cpp:317
Kded::recreate
void recreate()
Recreate the database file.
Definition: kded.cpp:518
Kded::slotApplicationRemoved
void slotApplicationRemoved(const QString &)
An application unregistered itself from DBus.
Definition: kded.cpp:450
Kded::unloadModule
bool unloadModule(const QString &obj)
Definition: kded.cpp:426
Kded::dirDeleted
void dirDeleted(const QString &path)
Definition: kded.cpp:597
Kded::loadSecondPhase
void loadSecondPhase()
Definition: kded.cpp:285
Kded::unregisterWindowId
void unregisterWindowId(qlonglong windowId, const QString &sender)
Unregister a window previously registered with KDED.
Definition: kded.cpp:700
Kded::loadModule
KDEDModule * loadModule(const QString &obj, bool onDemand)
Definition: kded.cpp:352
Kded::updateResourceList
void updateResourceList()
Update directories to watch.
Definition: kded.cpp:496
Kded::updateDirWatch
void updateDirWatch()
Collect all directories to watch.
Definition: kded.cpp:473
Kded::recreateFailed
void recreateFailed(const QDBusError &error)
Definition: kded.cpp:560
Kded::loadedModules
QStringList loadedModules()
Definition: kded.cpp:437
Kded::slotKDEDModuleRemoved
void slotKDEDModuleRemoved(KDEDModule *)
A KDEDModule is about to get destroyed.
Definition: kded.cpp:442
Kded::Kded
Kded()
Definition: kded.cpp:122
Kded::isModuleLoadedOnDemand
bool isModuleLoadedOnDemand(const QString &module) const
Check if a module should be loaded on demand.
Definition: kded.cpp:334
QDBusAbstractAdaptor
QHash
QList
QObject
QSet
kdedmodule.h
kservice.h
ksycoca.h
ksycocatype.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDED

Skip menu "KDED"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal