kdecore Library API Documentation

ksycocafactory.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 __ksycocafactory_h__
00020 #define __ksycocafactory_h__ "$Id: ksycocafactory.h,v 1.13 2002/09/21 15:07:27 tjansen Exp $"
00021 
00022 #include "ksycocatype.h"
00023 #include "ksycocaentry.h"
00024 
00025 #include <qdict.h>
00026 #include <qptrlist.h>
00027 class KSycoca;
00028 class QStringList;
00029 class QString;
00030 class KSycocaDict;
00031 class KSycocaResourceList;
00032 
00033 typedef QDict<KSycocaEntry::Ptr> KSycocaEntryDict;
00034 
00039 class KSycocaFactory
00040 {
00041 public:
00042    virtual KSycocaFactoryId factoryId() const = 0;
00043  
00044 protected: // virtual class
00049    KSycocaFactory( KSycocaFactoryId factory_id );
00050 
00051 public:
00052    virtual ~KSycocaFactory();
00053 
00057    int offset() { return mOffset; }
00058 
00062    KSycocaEntryDict * entryDict() { return m_entryDict; }
00063 
00068    virtual KSycocaEntry *createEntry(const QString &file, const char *resource) = 0;
00069 
00073    virtual void addEntry(KSycocaEntry *newEntry, const char *resource);
00074 
00078    virtual KSycocaEntry *createEntry(int offset)=0;
00079 
00083    KSycocaEntry::List allEntries();
00084 
00096    virtual void save(QDataStream &str);
00097 
00105    virtual void saveHeader(QDataStream &str);
00106 
00110    virtual const KSycocaResourceList * resourceList() const { return m_resourceList; }
00111 
00112 private:
00113    int mOffset;
00114 
00115 protected:
00116    int m_sycocaDictOffset;
00117    int m_beginEntryOffset;
00118    int m_endEntryOffset;
00119    QDataStream *m_str;
00120 
00121    KSycocaResourceList *m_resourceList;
00122    KSycocaEntryDict *m_entryDict;
00123    KSycocaDict *m_sycocaDict;
00124 protected:
00125    virtual void virtual_hook( int id, void* data );
00126 };
00127 
00131 class KSycocaFactoryList : public QPtrList<KSycocaFactory>
00132 {
00133 public:
00134    KSycocaFactoryList() { }
00135 };
00136 
00137 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:20:42 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001