kconfigbackend.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _KCONFIGBACKEND_H
00023 #define _KCONFIGBACKEND_H
00024
00025 #include "kconfigdata.h"
00026 #include <kconfigbase.h>
00027
00028 class QFile;
00029 class KConfigBackEndPrivate;
00030
00046 class KConfigBackEnd
00047 {
00048 public:
00064 KConfigBackEnd(KConfigBase *_config, const QString &_fileName,
00065 const char * _resType, bool _useKDEGlobals);
00066
00070 virtual ~KConfigBackEnd() {};
00071
00078 virtual bool parseConfigFiles() = 0;
00079
00089 virtual void sync(bool bMerge = true) = 0;
00090
00101 void changeFileName(const QString &_fileName, const char * _resType,
00102 bool _useKDEGlobals);
00103
00109 virtual KConfigBase::ConfigState getConfigState() const
00110 { return mConfigState; }
00111
00116 QString fileName() const { return mfileName; }
00117
00122 const char * resource() const { return resType; }
00123
00129 void setLocaleString(const QCString &_localeString) { localeString = _localeString; }
00130
00135 void setFileWriteMode(int mode);
00136
00137 #ifdef KDE_NO_COMPAT
00138 private:
00139 #endif
00140
00143 QString filename() const { return mfileName; }
00144
00145
00146 protected:
00147 KConfigBase *pConfig;
00148
00149 QString mfileName;
00150 QCString resType;
00151 bool useKDEGlobals : 1;
00152 bool bFileImmutable : 1;
00153 QCString localeString;
00154 QString mLocalFileName;
00155 QString mGlobalFileName;
00156 KConfigBase::ConfigState mConfigState;
00157 int mFileMode;
00158
00159 protected:
00160 virtual void virtual_hook( int id, void* data );
00161 private:
00162 KConfigBackEndPrivate *d;
00163 };
00164
00165 class KConfigINIBackEndPrivate;
00166
00174 class KConfigINIBackEnd : public KConfigBackEnd
00175 {
00176
00177 public:
00193 KConfigINIBackEnd(KConfigBase *_config, const QString &_fileName,
00194 const char * _resType, bool _useKDEGlobals = true)
00195 : KConfigBackEnd(_config, _fileName, _resType, _useKDEGlobals) {}
00196
00200 virtual ~KConfigINIBackEnd() {};
00201
00207 bool parseConfigFiles();
00208
00216 virtual void sync(bool bMerge = true);
00217
00218 protected:
00234 void parseSingleConfigFile(QFile& rFile, KEntryMap *pWriteBackMap = 0L,
00235 bool bGlobal = false, bool bDefault = false);
00236
00251 bool writeConfigFile(QString filename, bool bGlobal = false, bool bMerge = true);
00252
00253 protected:
00254 virtual void virtual_hook( int id, void* data );
00255 private:
00256 KConfigINIBackEndPrivate *d;
00257 };
00258
00259 #endif
This file is part of the documentation for kdelibs Version 3.1.4.