kded.h

00001 /*  This file is part of the KDE libraries
00002  *  Copyright (C) 1999 David Faure <faure@kde.org>
00003  *            (C) 1999 Waldo Bastian <bastian@kde.org>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License version 2 as published by the Free Software Foundation;
00008  *
00009  *  This library is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *  Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this library; see the file COPYING.LIB.  If not, write to
00016  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  *  Boston, MA 02110-1301, USA.
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 // No need for this in libkio - apps only get readonly access
00041 class Kded : public QObject, public DCOPObject, public DCOPObjectProxy
00042 {
00043   Q_OBJECT
00044 public:
00045    Kded(bool checkUpdates);
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); // Don't load obj on demand
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 
00076 public slots:
00080    void initModules();
00081 
00085    void recreate();
00086 
00090    void recreateDone();
00091 
00095    void updateDirWatch();
00096 
00100    void updateResourceList();
00101 
00105    void slotApplicationRemoved(const QCString &appId);
00106 
00110    void slotKDEDModuleRemoved(KDEDModule *);
00111 
00112 protected slots:
00113 
00117    void dirDeleted(const QString& path);
00118  
00122    void update (const QString& dir );
00123 
00127    void installCrashHandler();
00128    
00129    void runDelayedCheck();
00130 
00131 protected:
00135    void readDirectory(const QString& dir );
00136    
00137 
00138    static void crashHandler(int);
00139 
00145    KDirWatch* m_pDirWatch;
00146 
00147    bool b_checkUpdates;
00148 
00154    QTimer* m_pTimer;
00155    
00156    QValueList<DCOPClientTransaction *> m_recreateRequests;
00157    int m_recreateCount;
00158    bool m_recreateBusy;
00159    
00160    QAsciiDict<KDEDModule> m_modules;
00161    QAsciiDict<KLibrary> m_libs;
00162    QAsciiDict<QObject> m_dontLoad;
00163    QAsciiDict<QValueList<long> > m_windowIdList;
00164    QIntDict<long> m_globalWindowIdList;
00165    QStringList m_allResourceDirs;
00166    bool m_needDelayedCheck;
00167      
00168    static Kded *_self;
00169 };
00170 
00171 class KUpdateD : public QObject
00172 {
00173    Q_OBJECT
00174 public:
00175    KUpdateD();
00176    ~KUpdateD();
00177    
00178 public slots:
00179    void runKonfUpdate();
00180    void slotNewUpdateFile();
00181 
00182 private:
00188    KDirWatch* m_pDirWatch;
00189 
00195    QTimer* m_pTimer;
00196 };
00197 
00198 class KHostnameD : public QObject
00199 {
00200    Q_OBJECT
00201 public:
00202    KHostnameD(int pollInterval);
00203    ~KHostnameD();
00204    
00205 public slots:
00206    void checkHostname();
00207 
00208 private:
00212    QTimer m_Timer;
00213    QCString m_hostname;
00214 };
00215 
00216 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys