KDED
kded.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KDED_H
00021 #define KDED_H
00022
00023 #include <QtCore/QObject>
00024 #include <QtCore/QString>
00025 #include <QtCore/QTimer>
00026 #include <QtCore/QHash>
00027 #include <QtCore/QSet>
00028
00029 #include <QtDBus/QtDBus>
00030
00031 #include <ksycoca.h>
00032 #include <ksycocatype.h>
00033 #include <kdedmodule.h>
00034 #include <klibloader.h>
00035 #include <kservice.h>
00036
00037 class KDirWatch;
00038
00039
00040 class Kded : public QObject
00041 {
00042 Q_OBJECT
00043 public:
00044 Kded(bool checkUpdates);
00045 virtual ~Kded();
00046
00047 static Kded *self() { return _self;}
00048 static void messageFilter(const QDBusMessage &);
00049
00050 void noDemandLoad(const QString &obj);
00051
00052 KDEDModule *loadModule(const QString &obj, bool onDemand);
00053 KDEDModule *loadModule(const KService::Ptr& service, bool onDemand);
00054 QStringList loadedModules();
00055 bool unloadModule(const QString &obj);
00056
00057 void registerWindowId(qlonglong windowId, const QString &sender);
00058 void unregisterWindowId(qlonglong windowId, const QString &sender);
00059 void recreate(const QDBusMessage&);
00060 void recreate(bool initial);
00061 void loadSecondPhase();
00062
00063 public Q_SLOTS:
00067 void initModules();
00068
00072 void recreate();
00073
00077 void recreateDone();
00078
00082 void updateDirWatch();
00083
00087 void updateResourceList();
00088
00092 void slotApplicationRemoved(const QString&, const QString&, const QString&);
00093
00097 void slotKDEDModuleRemoved(KDEDModule *);
00098
00099 protected Q_SLOTS:
00100
00104 void dirDeleted(const QString& path);
00105
00109 void update (const QString& dir );
00110
00111 void runDelayedCheck();
00112
00113 protected:
00117 void readDirectory(const QString& dir );
00118
00124 KDirWatch* m_pDirWatch;
00125
00126 bool b_checkUpdates;
00127
00133 QTimer* m_pTimer;
00134
00135 QList<QDBusMessage> m_recreateRequests;
00136 int m_recreateCount;
00137 bool m_recreateBusy;
00138
00139 QHash<QString,KDEDModule *> m_modules;
00140
00141 QHash<QString,QObject *> m_dontLoad;
00142 QHash<QString,QList<qlonglong> > m_windowIdList;
00143
00144 QSet<long> m_globalWindowIdList;
00145 QStringList m_allResourceDirs;
00146 bool m_needDelayedCheck;
00147
00148 static Kded *_self;
00149 };
00150
00151 class KBuildsycocaAdaptor: public QDBusAbstractAdaptor
00152 {
00153 Q_OBJECT
00154 Q_CLASSINFO("D-Bus Interface", "org.kde.kbuildsycoca")
00155 public:
00156 KBuildsycocaAdaptor(QObject *parent);
00157
00158 public Q_SLOTS:
00159 Q_NOREPLY void recreate(const QDBusMessage&);
00160 };
00161
00162
00163 class KUpdateD : public QObject
00164 {
00165 Q_OBJECT
00166 public:
00167 KUpdateD();
00168 ~KUpdateD();
00169
00170 public Q_SLOTS:
00171 void runKonfUpdate();
00172 void slotNewUpdateFile();
00173
00174 private:
00180 KDirWatch* m_pDirWatch;
00181
00187 QTimer* m_pTimer;
00188 };
00189
00190 class KHostnameD : public QObject
00191 {
00192 Q_OBJECT
00193 public:
00194 KHostnameD(int pollInterval);
00195 ~KHostnameD();
00196
00197 public Q_SLOTS:
00198 void checkHostname();
00199
00200 private:
00204 QTimer m_Timer;
00205 QByteArray m_hostname;
00206 };
00207
00208 #endif