kconfig.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _KCONFIG_H
00025 #define _KCONFIG_H
00026
00027 class QTimer;
00028
00029 #include <qvaluelist.h>
00030
00031 #include "kconfigbase.h"
00032 #include "klockfile.h"
00033
00034 class KConfigPrivate;
00035
00046 class KConfig : public KConfigBase
00047 {
00048 Q_OBJECT
00049
00050 public:
00051
00065 KConfig( const QString& fileName = QString::null,
00066 bool bReadOnly = false, bool bUseKDEGlobals = true, const char *resType="config");
00067
00068 KConfig(KConfigBackEnd *backEnd, bool bReadOnly = false);
00069
00076 virtual ~KConfig();
00077
00090 virtual void rollback(bool bDeep = true);
00091
00092
00097 virtual QStringList groupList() const;
00098
00110 virtual QMap<QString, QString> entryMap(const QString &pGroup) const;
00111
00116 virtual void reparseConfiguration();
00117
00124 void setFileWriteMode(int mode);
00125
00132 void setForceGlobal( bool force ) { bForceGlobal = force; }
00133
00139 bool forceGlobal() const { return bForceGlobal; }
00140
00155 void checkUpdate(const QString &id, const QString &updateFile);
00156
00168 KConfig* copyTo(const QString &file, KConfig *config=0) const;
00169
00182 KLockFile::Ptr lockFile( bool bGlobal=false );
00183
00184 protected:
00185
00192 virtual bool internalHasGroup(const QCString &group) const;
00193
00204 virtual KEntryMap internalEntryMap(const QString &pGroup) const;
00205
00215 virtual KEntryMap internalEntryMap() const { return aEntryMap; }
00216
00227 virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true);
00228
00237 virtual KEntry lookupData(const KEntryKey &_key) const;
00238
00246 KEntryMap aEntryMap;
00247
00248 private:
00253 KConfig( const KConfig& );
00258 KConfig& operator= ( const KConfig& rConfig );
00259
00260 private:
00261 bool bGroupImmutable : 1;
00262 bool bFileImmutable : 1;
00263 bool bForceGlobal : 1;
00264 protected:
00265 virtual void virtual_hook( int id, void* data );
00266 private:
00267 KConfigPrivate *d;
00268 };
00269
00270 class KSharedConfig : public KConfig, public KShared
00271 {
00272 friend class QValueList<KSharedConfig*>;
00273 public:
00274 typedef KSharedPtr<KSharedConfig> Ptr;
00275
00276 public:
00282 static KSharedConfig::Ptr openConfig(const QString& fileName, bool immutable = false,
00283 bool bUseKDEGlobals = true);
00284
00285 private:
00286 KSharedConfig( const QString& fileName, bool immutable, bool useKDEGlobals );
00287 ~KSharedConfig();
00288
00289 static QValueList<KSharedConfig*> *s_list;
00290 };
00291
00292 #endif
This file is part of the documentation for kdecore Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 23 17:11:36 2004 by
doxygen 1.3.8-20040913 written by
Dimitri van Heesch, © 1997-2003