• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

tdeconfigbackend.h

00001 /*
00002    This file is part of the KDE libraries
00003    Copyright (c) 1999 Preston Brown <pbrown@kde.org>
00004    Portions copyright (c) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef _TDECONFIGBACKEND_H
00023 #define _TDECONFIGBACKEND_H
00024 
00025 #include "tdeconfigdata.h"
00026 #include <tdeconfigbase.h>
00027 #include <klockfile.h>
00028 #include <tdelocale.h>
00029 #include "tdelibs_export.h"
00030 
00031 class TQFile;
00032 class TDEConfigBackEndPrivate;
00033 
00048 class TDECORE_EXPORT TDEConfigBackEnd
00049 {
00050   friend class TDEConfig;
00051   friend class TDESharedConfig;
00052 public:
00068   TDEConfigBackEnd(TDEConfigBase *_config, const TQString &_fileName,
00069          const char * _resType, bool _useKDEGlobals);
00070 
00074   virtual ~TDEConfigBackEnd();
00075 
00082   virtual bool parseConfigFiles() = 0;
00083 
00093   virtual void sync(bool bMerge = true) = 0;
00094 
00105   void changeFileName(const TQString &_fileName, const char * _resType,
00106               bool _useKDEGlobals);
00107 
00113   virtual TDEConfigBase::ConfigState getConfigState() const
00114     { return mConfigState; }
00115 
00120   TQString fileName() const { return mfileName; }
00121 
00126   const char * resource() const { return resType; }
00127 
00133   void setLocaleString(const TQCString &_localeString) { localeString = _localeString; }
00134 
00139   void setFileWriteMode(int mode);
00140 
00147   bool checkConfigFilesWritable(bool warnUser);
00148 
00154   TDELockFile::Ptr lockFile( bool bGlobal = false );
00155 
00156 #ifdef KDE_NO_COMPAT
00157 private:
00158 #endif
00159 
00162   KDE_DEPRECATED TQString filename() const { return mfileName; }
00163 
00164 protected:
00165   TDEConfigBase *pConfig;
00166 
00167   TQString mfileName;
00168   TQCString resType;
00169   bool useKDEGlobals : 1;
00170   bool bFileImmutable : 1;
00171   TQCString localeString;
00172   TQString mLocalFileName;
00173   TQString mGlobalFileName;
00174   TDEConfigBase::ConfigState mConfigState;
00175   int mFileMode;
00176 
00177 protected:
00178   virtual void virtual_hook( int id, void* data );
00179 protected:
00180   class TDEConfigBackEndPrivate;
00181   TDEConfigBackEndPrivate *d;
00182 };
00183 
00184 
00191 class TDECORE_EXPORT TDEConfigINIBackEnd : public TDEConfigBackEnd
00192 {
00193 
00194 public:
00210   TDEConfigINIBackEnd(TDEConfigBase *_config, const TQString &_fileName,
00211             const char * _resType, bool _useKDEGlobals = true)
00212     : TDEConfigBackEnd(_config, _fileName, _resType, _useKDEGlobals) {}
00213 
00217   virtual ~TDEConfigINIBackEnd() {}
00218 
00224   bool parseConfigFiles();
00225 
00233   virtual void sync(bool bMerge = true);
00234 
00235 protected:
00251   void parseSingleConfigFile(TQFile& rFile, KEntryMap *pWriteBackMap = 0L,
00252                  bool bGlobal = false, bool bDefault = false);
00253 
00254   // Kubuntu patch, 2006-08-03
00255   // looks up a key in with TDELocale
00256   // see https://launchpad.net/distros/ubuntu/+spec/langpacks-desktopfiles-kde
00257   void translateKey(TDELocale& locale, TQCString currentGroup, TQCString key);
00258 
00273   bool writeConfigFile(TQString filename, bool bGlobal = false, bool bMerge = true);
00274 
00287   bool getEntryMap(KEntryMap &map, bool bGlobal, TQFile *mergeFile);
00288 
00290   void writeEntries(FILE *pStream, const KEntryMap &aTempMap);
00291 
00292 protected:
00293   virtual void virtual_hook( int id, void* data );
00294 private:
00295   class TDEConfigINIBackEndPrivate;
00296   TDEConfigINIBackEndPrivate *not_d;
00297 };
00298 
00299 #endif

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.6.3
This website is maintained by Timothy Pearson.