ksycoca.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __ksycoca_h__
00020 #define __ksycoca_h__
00021
00022 #include <dcopobject.h>
00023 #include <qobject.h>
00024 #include <qstringlist.h>
00025 #include "ksycocatype.h"
00026 #include <kdelibs_export.h>
00027
00028 class QDataStream;
00029 class KSycocaPrivate;
00030 class KSycocaFactory;
00031 class KSycocaFactoryList;
00032
00033
00034
00035
00036
00037
00038 #define KSYCOCA_VERSION 93
00039
00044 class KDECORE_EXPORT KSycoca : public QObject, public DCOPObject
00045 {
00046 Q_OBJECT
00047 K_DCOP
00048
00049 protected:
00054 KSycoca( bool );
00055
00056 public:
00057
00061 KSycoca();
00062
00066 static KSycoca *self();
00067 static bool _checkSelf();
00068
00069 virtual ~KSycoca();
00070
00071 static int version();
00072
00077 QDataStream *findEntry(int offset, KSycocaType &type);
00081 QDataStream *findFactory( KSycocaFactoryId id);
00085 QString kfsstnd_prefixes();
00089 QString language();
00090
00097 Q_UINT32 timeStamp();
00098
00108 Q_UINT32 updateSignature();
00109
00114 QStringList allResourceDirs();
00115
00119 void addFactory( KSycocaFactory * );
00120
00125 virtual bool isBuilding() { return false; }
00126
00130 void disableAutoRebuild();
00131
00135 static QString determineRelativePath( const QString & _fullpath, const char *_resource );
00136
00142 static bool isChanged(const char *type);
00143
00147 static void flagError();
00148
00152 static bool readError();
00153
00154 k_dcop:
00158 void notifyDatabaseChanged(const QStringList &);
00159
00160 signals:
00165 void databaseChanged();
00166
00167 protected:
00168 bool checkVersion(bool abortOnError=true);
00169 bool openDatabase(bool openDummyIfNotFound=true);
00170 void closeDatabase();
00171 KSycocaFactoryList *m_lstFactories;
00172 QDataStream *m_str;
00173 bool bNoDatabase;
00174 size_t m_sycoca_size;
00175 const char *m_sycoca_mmap;
00176 Q_UINT32 m_timeStamp;
00177
00178 public:
00179 static KSycoca *_self;
00180
00181 protected:
00182 virtual void virtual_hook( int id, void* data );
00183 private:
00184 KSycocaPrivate *d;
00185 };
00186
00187 #endif
|