KDECore
ksycoca.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 #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 94
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
00068 virtual ~KSycoca();
00069
00070 static int version();
00071
00076 QDataStream *findEntry(int offset, KSycocaType &type);
00080 QDataStream *findFactory( KSycocaFactoryId id);
00084 QString kfsstnd_prefixes();
00088 QString language();
00089
00096 Q_UINT32 timeStamp();
00097
00107 Q_UINT32 updateSignature();
00108
00113 QStringList allResourceDirs();
00114
00118 void addFactory( KSycocaFactory * );
00119
00124 virtual bool isBuilding() { return false; }
00125
00129 void disableAutoRebuild();
00130
00134 static QString determineRelativePath( const QString & _fullpath, const char *_resource );
00135
00141 static bool isChanged(const char *type);
00142
00146 static void flagError();
00147
00151 static bool readError();
00152
00153 k_dcop:
00157 void notifyDatabaseChanged(const QStringList &);
00158
00159 signals:
00164 void databaseChanged();
00165
00166 protected:
00167 bool checkVersion(bool abortOnError=true);
00168 bool openDatabase(bool openDummyIfNotFound=true);
00169 void closeDatabase();
00170 KSycocaFactoryList *m_lstFactories;
00171 QDataStream *m_str;
00172 bool bNoDatabase;
00173 size_t m_sycoca_size;
00174 const char *m_sycoca_mmap;
00175 Q_UINT32 m_timeStamp;
00176
00177 public:
00178 static KSycoca *_self;
00179
00180 protected:
00181 virtual void virtual_hook( int id, void* data );
00182 private:
00183 KSycocaPrivate *d;
00184 };
00185
00186 #endif