kdecore Library API Documentation

ksycoca.h

00001 /*  This file is part of the KDE libraries
00002  *  Copyright (C) 1999 Waldo Bastian <bastian@kde.org>
00003  *
00004  *  This library is free software; you can redistribute it and/or
00005  *  modify it under the terms of the GNU Library General Public
00006  *  License version 2 as published by the Free Software Foundation;
00007  *
00008  *  This library is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  *  Library General Public License for more details.
00012  *
00013  *  You should have received a copy of the GNU Library General Public License
00014  *  along with this library; see the file COPYING.LIB.  If not, write to
00015  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00016  *  Boston, MA 02111-1307, USA.
00017  **/
00018 
00019 #ifndef __ksycoca_h__
00020 #define __ksycoca_h__ "$Id: ksycoca.h,v 1.76.2.1 2004/02/28 08:34:06 coolo Exp $"
00021 
00022 #include <dcopobject.h>
00023 #include <qobject.h>
00024 #include <qstringlist.h>
00025 #include "ksycocatype.h"
00026 
00027 class QDataStream;
00028 class KSycocaPrivate;
00029 class KSycocaFactory;
00030 class KSycocaFactoryList;
00031 
00032 /*
00033  * Sycoca file version number.
00034  * If the existing file is outdated, it will not get read
00035  * but instead we'll ask kded to regenerate a new one...
00036 */
00037 #define KSYCOCA_VERSION 72
00038 
00043 class KSycoca : public QObject, public DCOPObject
00044 {
00045   Q_OBJECT
00046   K_DCOP
00047 
00048 protected:
00053    KSycoca( bool /* buildDatabase */ );
00054 
00055 public:
00056 
00060    KSycoca();
00061 
00065    static KSycoca *self();
00066 
00067    virtual ~KSycoca();
00068 
00069    static int version();
00070 
00075    QDataStream *findEntry(int offset, KSycocaType &type);
00079    QDataStream *findFactory( KSycocaFactoryId id);
00083    QString kfsstnd_prefixes();
00087    QString language();
00088 
00095    Q_UINT32 timeStamp();
00096 
00106    Q_UINT32 updateSignature();
00107 
00112    QStringList allResourceDirs();
00113 
00117    void addFactory( KSycocaFactory * );
00118 
00123    virtual bool isBuilding() { return false; }
00124 
00128    void disableAutoRebuild();
00129 
00133    static QString determineRelativePath( const QString & _fullpath, const char *_resource );
00134 
00140    static bool isChanged(const char *type);
00141    
00145    static void flagError();
00146    
00150    static bool readError();
00151 
00152 k_dcop:
00156    void notifyDatabaseChanged(const QStringList &);
00157 
00158 signals:
00163    void databaseChanged();
00164 
00165 protected:
00166    bool checkVersion(bool abortOnError=true);
00167    bool openDatabase(bool openDummyIfNotFound=true);
00168    void closeDatabase();
00169    KSycocaFactoryList *m_lstFactories;
00170    QDataStream *m_str;
00171    bool bNoDatabase;
00172    size_t m_sycoca_size;
00173    const char *m_sycoca_mmap;
00174    Q_UINT32 m_timeStamp;
00175 
00176 public:
00177    static KSycoca *_self; // Internal use only.
00178 
00179 protected:
00180   virtual void virtual_hook( int id, void* data );
00181 private:
00182    KSycocaPrivate *d;
00183 };
00184 
00185 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Apr 21 18:42:58 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003