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 <qobject.h>
00024 #include <qstring.h>
00025 #include <qtimer.h>
00026 #include <qasciidict.h>
00027 #include <qintdict.h>
00028
00029 #include <dcopclient.h>
00030 #include <dcopobject.h>
00031
00032 #include <ksycoca.h>
00033 #include <ksycocatype.h>
00034 #include <kdedmodule.h>
00035 #include <klibloader.h>
00036
00037 class KDirWatch;
00038 class KService;
00039
00040
00041 class Kded : public QObject, public DCOPObject, public DCOPObjectProxy
00042 {
00043 Q_OBJECT
00044 public:
00045 Kded(bool checkUpdates, bool new_startup);
00046 virtual ~Kded();
00047
00048 static Kded *self() { return _self;}
00052 bool process(const QCString &obj, const QCString &fun,
00053 const QByteArray &data,
00054 QCString &replyType, QByteArray &replyData);
00055
00060 bool process(const QCString &fun, const QByteArray &data,
00061 QCString &replyType, QByteArray &replyData);
00062
00063 virtual QCStringList functions();
00064
00065 void noDemandLoad(const QString &obj);
00066
00067 KDEDModule *loadModule(const QCString &obj, bool onDemand);
00068 KDEDModule *loadModule(const KService *service, bool onDemand);
00069 QCStringList loadedModules();
00070 bool unloadModule(const QCString &obj);
00071 bool isWindowRegistered(long windowId);
00072 void registerWindowId(long windowId);
00073 void unregisterWindowId(long windowId);
00074 void recreate(bool initial);
00075 void loadSecondPhase();
00076
00077 public slots:
00081 void initModules();
00082
00086 void recreate();
00087
00091 void recreateDone();
00092
00096 void updateDirWatch();
00097
00101 void updateResourceList();
00102
00106 void slotApplicationRemoved(const QCString &appId);
00107
00111 void slotKDEDModuleRemoved(KDEDModule *);
00112
00113 protected slots:
00114
00118 void dirDeleted(const QString& path);
00119
00123 void update (const QString& dir );
00124
00128 void installCrashHandler();
00129
00130 void runDelayedCheck();
00131
00132 protected:
00136 void readDirectory(const QString& dir );
00137
00138
00139 static void crashHandler(int);
00140
00146 KDirWatch* m_pDirWatch;
00147
00148 bool b_checkUpdates;
00149
00155 QTimer* m_pTimer;
00156
00157 QValueList<DCOPClientTransaction *> m_recreateRequests;
00158 int m_recreateCount;
00159 bool m_recreateBusy;
00160
00161 QAsciiDict<KDEDModule> m_modules;
00162 QAsciiDict<KLibrary> m_libs;
00163 QAsciiDict<QObject> m_dontLoad;
00164 QAsciiDict<QValueList<long> > m_windowIdList;
00165 QIntDict<long> m_globalWindowIdList;
00166 QStringList m_allResourceDirs;
00167 bool m_needDelayedCheck;
00168 bool m_newStartup;
00169 public:
00170 bool newStartup() const { return m_newStartup; }
00171 private:
00172
00173 static Kded *_self;
00174 };
00175
00176 class KUpdateD : public QObject
00177 {
00178 Q_OBJECT
00179 public:
00180 KUpdateD();
00181 ~KUpdateD();
00182
00183 public slots:
00184 void runKonfUpdate();
00185 void slotNewUpdateFile();
00186
00187 private:
00193 KDirWatch* m_pDirWatch;
00194
00200 QTimer* m_pTimer;
00201 };
00202
00203 class KHostnameD : public QObject
00204 {
00205 Q_OBJECT
00206 public:
00207 KHostnameD(int pollInterval);
00208 ~KHostnameD();
00209
00210 public slots:
00211 void checkHostname();
00212
00213 private:
00217 QTimer m_Timer;
00218 QCString m_hostname;
00219 };
00220
00221 #endif