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

KDED

  • sources
  • kde-4.14
  • kdelibs
  • 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 
36 class QDBusServiceWatcher;
37 class KDirWatch;
38 
39 // No need for this in libkio - apps only get readonly access
40 class Kded : public QObject
41 {
42  Q_OBJECT
43 public:
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 
126 public 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 
163 protected Q_SLOTS:
164 
168  void dirDeleted(const QString& path);
169 
173  void update (const QString& dir );
174 
175  void runDelayedCheck();
176 
177 private:
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 
218 class KBuildsycocaAdaptor: public QDBusAbstractAdaptor
219 {
220  Q_OBJECT
221  Q_CLASSINFO("D-Bus Interface", "org.kde.kbuildsycoca")
222 public:
223  KBuildsycocaAdaptor(QObject *parent);
224 
225 public Q_SLOTS:
226  Q_NOREPLY void recreate(const QDBusMessage&);
227 };
228 
229 
230 class KUpdateD : public QObject
231 {
232  Q_OBJECT
233 public:
234  KUpdateD();
235  ~KUpdateD();
236 
237 public Q_SLOTS:
238  void runKonfUpdate();
239  void slotNewUpdateFile();
240 
241 private:
247  KDirWatch* m_pDirWatch;
248 
254  QTimer* m_pTimer;
255 };
256 
257 class KHostnameD : public QObject
258 {
259  Q_OBJECT
260 public:
261  KHostnameD(int pollInterval);
262  ~KHostnameD();
263 
264 public Q_SLOTS:
265  void checkHostname();
266 
267 private:
271  QTimer m_Timer;
272  QByteArray m_hostname;
273 };
274 
275 #endif
KSharedPtr< KService >
KUpdateD::runKonfUpdate
void runKonfUpdate()
Definition: kded.cpp:758
KBuildsycocaAdaptor::recreate
Q_NOREPLY void recreate(const QDBusMessage &)
Definition: kded.cpp:808
KUpdateD
Definition: kded.h:230
Kded::registerWindowId
void registerWindowId(qlonglong windowId, const QString &sender)
Applications can register/unregister their windows with kded modules.
Definition: kded.cpp:682
Kded::setModuleAutoloading
void setModuleAutoloading(const QString &module, bool autoload)
Configure whether a module should be loaded on startup.
Definition: kded.cpp:305
QByteArray
KDEDModule
Kded::slotApplicationRemoved
void slotApplicationRemoved(const QString &)
An application unregistered itself from DBus.
Definition: kded.cpp:450
QObject::sender
QObject * sender() const
KHostnameD::KHostnameD
KHostnameD(int pollInterval)
Definition: kded.cpp:768
Kded::recreateDone
void recreateDone()
Recreating finished.
Definition: kded.cpp:571
Kded::slotKDEDModuleRemoved
void slotKDEDModuleRemoved(KDEDModule *)
A KDEDModule is about to get destroyed.
Definition: kded.cpp:442
Kded::recreate
void recreate()
Recreate the database file.
Definition: kded.cpp:518
Kded::Kded
Kded()
Definition: kded.cpp:122
Kded::loadedModules
QStringList loadedModules()
Definition: kded.cpp:437
Kded::noDemandLoad
void noDemandLoad(const QString &obj)
Definition: kded.cpp:300
QDBusAbstractAdaptor
ksycocatype.h
KUpdateD::slotNewUpdateFile
void slotNewUpdateFile()
Definition: kded.cpp:763
kdedmodule.h
QTimer
QHash< QString, KDEDModule * >
QObject
Kded::loadModule
KDEDModule * loadModule(const QString &obj, bool onDemand)
Definition: kded.cpp:352
Kded::loadSecondPhase
void loadSecondPhase()
Definition: kded.cpp:285
Kded::updateResourceList
void updateResourceList()
Update directories to watch.
Definition: kded.cpp:496
KBuildsycocaAdaptor
Definition: kded.h:218
QSet< long >
QString
QList< QDBusMessage >
Kded::isModuleAutoloaded
bool isModuleAutoloaded(const QString &module) const
Check if a module should be loaded on startup.
Definition: kded.cpp:317
Kded::isModuleLoadedOnDemand
bool isModuleLoadedOnDemand(const QString &module) const
Check if a module should be loaded on demand.
Definition: kded.cpp:334
QStringList
kservice.h
Kded::update
void update(const QString &dir)
Definition: kded.cpp:602
Kded::unloadModule
bool unloadModule(const QString &obj)
Definition: kded.cpp:426
KBuildsycocaAdaptor::KBuildsycocaAdaptor
KBuildsycocaAdaptor(QObject *parent)
Definition: kded.cpp:803
Kded::recreateFailed
void recreateFailed(const QDBusError &error)
Definition: kded.cpp:560
ksycoca.h
Kded::updateDirWatch
void updateDirWatch()
Collect all directories to watch.
Definition: kded.cpp:473
KUpdateD::KUpdateD
KUpdateD()
Definition: kded.cpp:729
QDBusMessage
KHostnameD
Definition: kded.h:257
KUpdateD::~KUpdateD
~KUpdateD()
Definition: kded.cpp:752
KDirWatch
Kded::~Kded
virtual ~Kded()
Definition: kded.cpp:152
QObject::parent
QObject * parent() const
KHostnameD::checkHostname
void checkHostname()
Definition: kded.cpp:780
Kded::unregisterWindowId
void unregisterWindowId(qlonglong windowId, const QString &sender)
Unregister a window previously registered with KDED.
Definition: kded.cpp:700
Kded
Definition: kded.h:40
Kded::messageFilter
static void messageFilter(const QDBusMessage &)
Definition: kded.cpp:177
QDBusServiceWatcher
KHostnameD::~KHostnameD
~KHostnameD()
Definition: kded.cpp:775
Kded::runDelayedCheck
void runDelayedCheck()
Definition: kded.cpp:523
QDBusError
Kded::dirDeleted
void dirDeleted(const QString &path)
Definition: kded.cpp:597
Kded::initModules
void initModules()
Loads / unloads modules according to config.
Definition: kded.cpp:217
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:11 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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