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
00062 void registerWindowId(qlonglong windowId, const QString &sender);
00063 void unregisterWindowId(qlonglong windowId, const QString &sender);
00064 void recreate(const QDBusMessage&);
00065 void recreate(bool initial);
00066 void loadSecondPhase();
00067
00074 bool isModuleAutoloaded(const QString &module) const;
00075 bool isModuleAutoloaded(const KService::Ptr &module) const;
00077
00084 bool isModuleLoadedOnDemand(const QString &module) const;
00085 bool isModuleLoadedOnDemand(const KService::Ptr &module) const;
00087
00094 void setModuleAutoloading(const QString &module, bool autoload);
00095
00096
00097
00098 public Q_SLOTS:
00102 void initModules();
00103
00107 void recreate();
00108
00112 void recreateDone();
00113
00117 void updateDirWatch();
00118
00122 void updateResourceList();
00123
00127 void slotApplicationRemoved(const QString&, const QString&, const QString&);
00128
00132 void slotKDEDModuleRemoved(KDEDModule *);
00133
00134 protected Q_SLOTS:
00135
00139 void dirDeleted(const QString& path);
00140
00144 void update (const QString& dir );
00145
00146 void runDelayedCheck();
00147
00148 protected:
00152 void readDirectory(const QString& dir );
00153
00159 KDirWatch* m_pDirWatch;
00160
00161 bool b_checkUpdates;
00162
00168 QTimer* m_pTimer;
00169
00170 QList<QDBusMessage> m_recreateRequests;
00171 int m_recreateCount;
00172 bool m_recreateBusy;
00173
00174 QHash<QString,KDEDModule *> m_modules;
00175
00176 QHash<QString,QObject *> m_dontLoad;
00177 QHash<QString,QList<qlonglong> > m_windowIdList;
00178
00179 QSet<long> m_globalWindowIdList;
00180 QStringList m_allResourceDirs;
00181 bool m_needDelayedCheck;
00182
00183 static Kded *_self;
00184 };
00185
00186 class KBuildsycocaAdaptor: public QDBusAbstractAdaptor
00187 {
00188 Q_OBJECT
00189 Q_CLASSINFO("D-Bus Interface", "org.kde.kbuildsycoca")
00190 public:
00191 KBuildsycocaAdaptor(QObject *parent);
00192
00193 public Q_SLOTS:
00194 Q_NOREPLY void recreate(const QDBusMessage&);
00195 };
00196
00197
00198 class KUpdateD : public QObject
00199 {
00200 Q_OBJECT
00201 public:
00202 KUpdateD();
00203 ~KUpdateD();
00204
00205 public Q_SLOTS:
00206 void runKonfUpdate();
00207 void slotNewUpdateFile();
00208
00209 private:
00215 KDirWatch* m_pDirWatch;
00216
00222 QTimer* m_pTimer;
00223 };
00224
00225 class KHostnameD : public QObject
00226 {
00227 Q_OBJECT
00228 public:
00229 KHostnameD(int pollInterval);
00230 ~KHostnameD();
00231
00232 public Q_SLOTS:
00233 void checkHostname();
00234
00235 private:
00239 QTimer m_Timer;
00240 QByteArray m_hostname;
00241 };
00242
00243 #endif