KDECore
ksycoca.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 * Copyright (C) 1999 Waldo Bastian <bastian@kde.org> 00003 * Copyright (C) 2005-2008 David Faure <faure@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 KSYCOCA_H 00021 #define KSYCOCA_H 00022 00023 #include <kdecore_export.h> 00024 #include <ksycocatype.h> 00025 00026 #include <QtCore/QObject> 00027 #include <QtCore/QStringList> 00028 00029 class QDataStream; 00030 class KSycocaFactory; 00031 class KSycocaFactoryList; 00032 class KSycocaPrivate; 00033 00037 #define KBUILDSYCOCA_EXENAME "kbuildsycoca4" 00038 00043 class KDECORE_EXPORT KSycoca : public QObject 00044 { 00045 Q_OBJECT 00046 //Q_CLASSINFO("D-Bus Interface", "org.kde.KSycoca") 00047 00048 protected: 00053 explicit KSycoca( bool /* buildDatabase */ ); 00054 00055 public: 00060 typedef enum { LocalDatabase, GlobalDatabase } DatabaseType; 00061 00065 KSycoca(); 00066 00070 static KSycoca *self(); 00071 00072 virtual ~KSycoca(); 00073 00077 static int version(); 00078 00084 static bool isAvailable(); 00085 00090 QDataStream *findEntry(int offset, KSycocaType &type); 00095 QDataStream *findFactory(KSycocaFactoryId id); 00099 QString kfsstnd_prefixes(); 00109 static QString absoluteFilePath(DatabaseType type=LocalDatabase); 00113 QString language(); 00114 00121 quint32 timeStamp(); 00122 00132 quint32 updateSignature(); 00133 00138 QStringList allResourceDirs(); 00139 00143 void addFactory( KSycocaFactory * ); 00144 00149 virtual bool isBuilding(); 00150 00154 static void disableAutoRebuild(); 00155 00164 #ifndef KDE_NO_DEPRECATED 00165 static KDE_DEPRECATED bool isChanged(const char *type); 00166 #endif 00167 00172 static void flagError(); 00173 00175 #ifndef KDE_NO_DEPRECATED 00176 static KDE_DEPRECATED bool readError(); 00177 #endif 00178 00179 Q_SIGNALS: 00184 #ifndef KDE_NO_DEPRECATED 00185 QT_MOC_COMPAT void databaseChanged(); // KDE5 TODO: remove 00186 #endif 00187 00199 void databaseChanged(const QStringList& changedResources); 00200 00201 protected: 00202 // @internal used by kbuildsycoca 00203 KSycocaFactoryList* factories(); 00204 00205 // @internal was for kbuildsycoca 00206 #ifndef KDE_NO_DEPRECATED 00207 QDataStream *m_str_deprecated; // KDE5: REMOVE 00208 #endif 00209 // @internal used by factories and kbuildsycoca 00210 QDataStream*& stream(); 00211 friend class KSycocaFactory; 00212 friend class KSycocaDict; 00213 00214 private Q_SLOTS: 00218 void notifyDatabaseChanged(const QStringList &); 00219 00220 private: 00225 static void clearCaches(); 00226 friend class KBuildSycoca; 00227 friend class Kded; 00228 00229 Q_DISABLE_COPY(KSycoca) 00230 friend class KSycocaPrivate; 00231 KSycocaPrivate * const d; 00232 }; 00233 00234 #endif 00235
KDE 4.6 API Reference