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 <kdecore_export.h>
00023 #include <ksycocatype.h>
00024
00025 #include <QtCore/QObject>
00026 #include <QtCore/QStringList>
00027
00028 class QDataStream;
00029 class KSycocaFactory;
00030 class KSycocaFactoryList;
00031 class KSycocaPrivate;
00032
00038 #define KSYCOCA_VERSION 116
00039
00043 #define KSYCOCA_FILENAME "ksycoca4"
00044
00047 #define KBUILDSYCOCA_EXENAME "kbuildsycoca4"
00048
00053 class KDECORE_EXPORT KSycoca : public QObject
00054 {
00055 Q_OBJECT
00056
00057
00058 protected:
00063 explicit KSycoca( bool );
00064
00065 public:
00070 typedef enum { LocalDatabase, GlobalDatabase } DatabaseType;
00071
00075 KSycoca();
00076
00080 static KSycoca *self();
00081
00082 virtual ~KSycoca();
00083
00087 static int version();
00088
00094 static bool isAvailable();
00095
00100 QDataStream *findEntry(int offset, KSycocaType &type);
00104 QDataStream *findFactory( KSycocaFactoryId id);
00108 QString kfsstnd_prefixes();
00118 static QString absoluteFilePath(DatabaseType type=LocalDatabase);
00122 QString language();
00123
00130 quint32 timeStamp();
00131
00141 quint32 updateSignature();
00142
00147 QStringList allResourceDirs();
00148
00152 void addFactory( KSycocaFactory * );
00153
00158 virtual bool isBuilding();
00159
00163 void disableAutoRebuild();
00164
00170 static bool isChanged(const char *type);
00171
00175 static void flagError();
00176
00180 static bool readError();
00181
00182 private Q_SLOTS:
00186 void notifyDatabaseChanged(const QStringList &);
00187
00188 Q_SIGNALS:
00193 void databaseChanged();
00194
00195 protected:
00196 KSycocaFactoryList* factories();
00197
00198
00199 QDataStream *m_str;
00200
00201 private:
00202 Q_DISABLE_COPY(KSycoca)
00203 friend class KSycocaPrivate;
00204 KSycocaPrivate * const d;
00205 };
00206
00207 #endif
00208