ksycocafactory.h
/* This file is part of the KDE libraries
* Copyright (C) 1999 Waldo Bastian <bastian@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License version 2 as published by the Free Software Foundation;
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
**/
#ifndef __ksycocafactory_h__
#define __ksycocafactory_h__
#include "ksycocatype.h"
#include "ksycocaentry.h"
#include <qdict.h>
#include <qptrlist.h>
class KSycoca;
class QStringList;
class QString;
class KSycocaDict;
class KSycocaResourceList;
typedef QDict<KSycocaEntry::Ptr> KSycocaEntryDict;
class KDECORE_EXPORT KSycocaFactory
{
public:
virtual KSycocaFactoryId factoryId() const = 0;
protected: // virtual class
KSycocaFactory( KSycocaFactoryId factory_id );
public:
virtual ~KSycocaFactory();
int offset() { return mOffset; }
KSycocaEntryDict * entryDict() { return m_entryDict; }
virtual KSycocaEntry *createEntry(const QString &file, const char *resource) = 0;
virtual void addEntry(KSycocaEntry *newEntry, const char *resource);
void removeEntry(KSycocaEntry *newEntry);
virtual KSycocaEntry *createEntry(int offset)=0;
KSycocaEntry::List allEntries();
virtual void save(QDataStream &str);
virtual void saveHeader(QDataStream &str);
virtual const KSycocaResourceList * resourceList() const { return m_resourceList; }
private:
int mOffset;
protected:
int m_sycocaDictOffset;
int m_beginEntryOffset;
int m_endEntryOffset;
QDataStream *m_str;
KSycocaResourceList *m_resourceList;
KSycocaEntryDict *m_entryDict;
KSycocaDict *m_sycocaDict;
protected:
virtual void virtual_hook( int id, void* data );
};
class KDECORE_EXPORT KSycocaFactoryList : public QPtrList<KSycocaFactory>
{
public:
KSycocaFactoryList() { }
};
#endif
KSycocaFactoryList
This, instead of a typedef, allows to declare "class ..." in header files.
Definition: ksycocafactory.h:137
KSycocaEntry
Base class for all Sycoca entries.
Definition: ksycocaentry.h:37
KStdAction::save
KAction * save(const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)

KDE Home | KDE Accessibility Home | Description of Access Keys