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

KDED

  • sources
  • kde-4.12
  • 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 
145  void updateDirWatch();
146 
150  void updateResourceList();
151 
155  void slotApplicationRemoved(const QString&);
156 
160  void slotKDEDModuleRemoved(KDEDModule *);
161 
162 protected Q_SLOTS:
163 
167  void dirDeleted(const QString& path);
168 
172  void update (const QString& dir );
173 
174  void runDelayedCheck();
175 
176 protected:
180  void readDirectory(const QString& dir );
181 
187  KDirWatch* m_pDirWatch;
188 
194  QTimer* m_pTimer;
195 
196  QList<QDBusMessage> m_recreateRequests;
197  int m_recreateCount;
198  bool m_recreateBusy;
199 
200  QHash<QString,KDEDModule *> m_modules;
201  //QHash<QString,KLibrary *> m_libs;
202  QHash<QString,QObject *> m_dontLoad;
203 
204  //window id tracking, with a QDBusServiceWatcher to remove them as needed
205  QDBusServiceWatcher *m_serviceWatcher;
206  QHash<QString,QList<qlonglong> > m_windowIdList;
207  QSet<long> m_globalWindowIdList;
208 
209  QStringList m_allResourceDirs;
210  bool m_needDelayedCheck;
211 
212  static Kded *_self;
213 };
214 
215 class KBuildsycocaAdaptor: public QDBusAbstractAdaptor
216 {
217  Q_OBJECT
218  Q_CLASSINFO("D-Bus Interface", "org.kde.kbuildsycoca")
219 public:
220  KBuildsycocaAdaptor(QObject *parent);
221 
222 public Q_SLOTS:
223  Q_NOREPLY void recreate(const QDBusMessage&);
224 };
225 
226 
227 class KUpdateD : public QObject
228 {
229  Q_OBJECT
230 public:
231  KUpdateD();
232  ~KUpdateD();
233 
234 public Q_SLOTS:
235  void runKonfUpdate();
236  void slotNewUpdateFile();
237 
238 private:
244  KDirWatch* m_pDirWatch;
245 
251  QTimer* m_pTimer;
252 };
253 
254 class KHostnameD : public QObject
255 {
256  Q_OBJECT
257 public:
258  KHostnameD(int pollInterval);
259  ~KHostnameD();
260 
261 public Q_SLOTS:
262  void checkHostname();
263 
264 private:
268  QTimer m_Timer;
269  QByteArray m_hostname;
270 };
271 
272 #endif
Kded::readDirectory
void readDirectory(const QString &dir)
Scans dir for new files and new subdirectories.
Definition: kded.cpp:612
KSharedPtr
KUpdateD::runKonfUpdate
void runKonfUpdate()
Definition: kded.cpp:743
KBuildsycocaAdaptor::recreate
Q_NOREPLY void recreate(const QDBusMessage &)
Definition: kded.cpp:793
KUpdateD
Definition: kded.h:227
Kded::registerWindowId
void registerWindowId(qlonglong windowId, const QString &sender)
Applications can register/unregister their windows with kded modules.
Definition: kded.cpp:667
Kded::setModuleAutoloading
void setModuleAutoloading(const QString &module, bool autoload)
Configure whether a module should be loaded on startup.
Definition: kded.cpp:306
QDBusAbstractAdaptor
KDEDModule
Kded::slotApplicationRemoved
void slotApplicationRemoved(const QString &)
An application unregistered itself from DBus.
Definition: kded.cpp:451
KHostnameD::KHostnameD
KHostnameD(int pollInterval)
Definition: kded.cpp:753
Kded::m_dontLoad
QHash< QString, QObject * > m_dontLoad
Definition: kded.h:202
Kded::recreateDone
void recreateDone()
Recreating finished.
Definition: kded.cpp:561
Kded::slotKDEDModuleRemoved
void slotKDEDModuleRemoved(KDEDModule *)
A KDEDModule is about to get destroyed.
Definition: kded.cpp:443
Kded::m_modules
QHash< QString, KDEDModule * > m_modules
Definition: kded.h:200
Kded::recreate
void recreate()
Recreate the database file.
Definition: kded.cpp:519
Kded::Kded
Kded()
Definition: kded.cpp:123
QString
QHash< QString, KDEDModule * >
QObject
Kded::loadedModules
QStringList loadedModules()
Definition: kded.cpp:438
Kded::noDemandLoad
void noDemandLoad(const QString &obj)
Definition: kded.cpp:301
Kded::m_recreateRequests
QList< QDBusMessage > m_recreateRequests
Definition: kded.h:196
ksycocatype.h
KUpdateD::slotNewUpdateFile
void slotNewUpdateFile()
Definition: kded.cpp:748
kdedmodule.h
Kded::m_allResourceDirs
QStringList m_allResourceDirs
Definition: kded.h:209
QStringList
Kded::loadModule
KDEDModule * loadModule(const QString &obj, bool onDemand)
Definition: kded.cpp:353
Kded::loadSecondPhase
void loadSecondPhase()
Definition: kded.cpp:286
Kded::m_pDirWatch
KDirWatch * m_pDirWatch
Pointer to the dirwatch class which tells us, when some directories changed.
Definition: kded.h:187
Kded::_self
static Kded * _self
Definition: kded.h:212
Kded::updateResourceList
void updateResourceList()
Update directories to watch.
Definition: kded.cpp:497
KBuildsycocaAdaptor
Definition: kded.h:215
Kded::isModuleAutoloaded
bool isModuleAutoloaded(const QString &module) const
Check if a module should be loaded on startup.
Definition: kded.cpp:318
Kded::isModuleLoadedOnDemand
bool isModuleLoadedOnDemand(const QString &module) const
Check if a module should be loaded on demand.
Definition: kded.cpp:335
kservice.h
Kded::update
void update(const QString &dir)
Definition: kded.cpp:587
Kded::unloadModule
bool unloadModule(const QString &obj)
Definition: kded.cpp:427
QSet< long >
KBuildsycocaAdaptor::KBuildsycocaAdaptor
KBuildsycocaAdaptor(QObject *parent)
Definition: kded.cpp:788
ksycoca.h
Kded::updateDirWatch
void updateDirWatch()
Collect all directories to watch.
Definition: kded.cpp:474
KUpdateD::KUpdateD
KUpdateD()
Definition: kded.cpp:714
Kded::m_serviceWatcher
QDBusServiceWatcher * m_serviceWatcher
Definition: kded.h:205
Kded::m_pTimer
QTimer * m_pTimer
When a desktop file is updated, a timer is started (5 sec) before rebuilding the binary - so that mul...
Definition: kded.h:194
KHostnameD
Definition: kded.h:254
KUpdateD::~KUpdateD
~KUpdateD()
Definition: kded.cpp:737
Kded::m_globalWindowIdList
QSet< long > m_globalWindowIdList
Definition: kded.h:207
Kded::m_recreateCount
int m_recreateCount
Definition: kded.h:197
KDirWatch
Kded::~Kded
virtual ~Kded()
Definition: kded.cpp:153
Kded::m_recreateBusy
bool m_recreateBusy
Definition: kded.h:198
Kded::m_windowIdList
QHash< QString, QList< qlonglong > > m_windowIdList
Definition: kded.h:206
Kded::m_needDelayedCheck
bool m_needDelayedCheck
Definition: kded.h:210
KHostnameD::checkHostname
void checkHostname()
Definition: kded.cpp:765
Kded::unregisterWindowId
void unregisterWindowId(qlonglong windowId, const QString &sender)
Unregister a window previously registered with KDED.
Definition: kded.cpp:685
Kded
Definition: kded.h:40
Kded::messageFilter
static void messageFilter(const QDBusMessage &)
Definition: kded.cpp:178
QList< QDBusMessage >
KHostnameD::~KHostnameD
~KHostnameD()
Definition: kded.cpp:760
Kded::runDelayedCheck
void runDelayedCheck()
Definition: kded.cpp:524
Kded::dirDeleted
void dirDeleted(const QString &path)
Definition: kded.cpp:582
Kded::initModules
void initModules()
Loads / unloads modules according to config.
Definition: kded.cpp:218
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:14 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • 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