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

kdecore

kconfig.h
00001 /*
00002    This file is part of the KDE libraries
00003    Copyright (c) 1999 Preston Brown <pbrown@kde.org>
00004    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 _KCONFIG_H
00023 #define _KCONFIG_H
00024 
00025 class TQTimer;
00026 
00027 #include <tqvaluelist.h>
00028 
00029 #include "kconfigbase.h"
00030 #include "klockfile.h"
00031 
00032 class KConfigPrivate;
00033 
00043 class KDECORE_EXPORT KConfig : public KConfigBase
00044 {
00045   Q_OBJECT
00046 
00047 public:
00048 
00062   KConfig( const TQString& fileName = TQString::null,
00063           bool bReadOnly = false, bool bUseKDEGlobals = true, const char *resType="config");
00064 
00065   KConfig(KConfigBackEnd *backEnd, bool bReadOnly = false);
00066 
00073   virtual ~KConfig();
00074 
00087   virtual void rollback(bool bDeep = true);
00088 
00089 
00094   virtual TQStringList groupList() const;
00095 
00107   virtual TQMap<TQString, TQString> entryMap(const TQString &pGroup) const;
00108 
00113   virtual void reparseConfiguration();
00114 
00121   void setFileWriteMode(int mode);
00122 
00129   void setForceGlobal( bool force ) { bForceGlobal = force; }
00130 
00136   bool forceGlobal() const { return bForceGlobal; }
00137 
00152   void checkUpdate(const TQString &id, const TQString &updateFile);
00153 
00165   KConfig* copyTo(const TQString &file, KConfig *config=0) const;
00166 
00179   KLockFile::Ptr lockFile( bool bGlobal=false );
00180 
00181 protected:
00182 
00189   virtual bool internalHasGroup(const TQCString &group) const;
00190 
00201   virtual KEntryMap internalEntryMap(const TQString &pGroup) const;
00202 
00212    virtual KEntryMap internalEntryMap() const { return aEntryMap; }
00213 
00224   virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true);
00225 
00234   virtual KEntry lookupData(const KEntryKey &_key) const;
00235 
00243   KEntryMap aEntryMap;
00244 
00245 private:
00250   KConfig( const KConfig& );
00255   KConfig& operator= ( const KConfig& rConfig );
00256 
00257 private:
00258   bool bGroupImmutable : 1; // Current group is immutable.
00259   bool bFileImmutable  : 1; // Current file is immutable.
00260   bool bForceGlobal    : 1; // Apply everything to kdeglobals.
00261 protected:
00262   virtual void virtual_hook( int id, void* data );
00263 private:
00264   KConfigPrivate *d;
00265 };
00266 
00273 class KDECORE_EXPORT KSharedConfig : public KConfig, public KShared
00274 {
00275   friend class TQValueList<KSharedConfig*>;
00276 public:
00277   typedef KSharedPtr<KSharedConfig> Ptr;
00278 
00279 public:  
00286   static KSharedConfig::Ptr openConfig(const TQString& fileName, bool readOnly = false,
00287     bool bUseKDEGlobals = true);
00288 
00289 private:
00290   KSharedConfig( const TQString& fileName, bool readOnly, bool useKDEGlobals );
00291   ~KSharedConfig();
00292 
00293   static TQValueList<KSharedConfig*> *s_list;
00294 };
00295 
00296 #endif

kdecore

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

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |