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

tdecore

  • tdecore
tdeconfig.h
1/*
2 This file is part of the KDE libraries
3 Copyright (c) 1999 Preston Brown <pbrown@kde.org>
4 Copyright (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef _TDECONFIG_H
23#define _TDECONFIG_H
24
25class TQTimer;
26
27#include <tqvaluelist.h>
28
29#include "tdeconfigbase.h"
30#include "klockfile.h"
31
32class TDEConfigPrivate;
33
43class TDECORE_EXPORT TDEConfig : public TDEConfigBase
44{
45 TQ_OBJECT
46
47public:
48
62 TDEConfig( const TQString& fileName = TQString::null,
63 bool bReadOnly = false, bool bUseKDEGlobals = true, const char *resType="config");
64
65 TDEConfig(TDEConfigBackEnd *backEnd, bool bReadOnly = false);
66
73 virtual ~TDEConfig();
74
87 virtual void rollback(bool bDeep = true);
88
89
94 virtual TQStringList groupList() const;
95
107 virtual TQMap<TQString, TQString> entryMap(const TQString &pGroup) const;
108
113 virtual void reparseConfiguration();
114
121 void setFileWriteMode(int mode);
122
129 void setForceGlobal( bool force ) { bForceGlobal = force; }
130
136 bool forceGlobal() const { return bForceGlobal; }
137
152 void checkUpdate(const TQString &id, const TQString &updateFile);
153
165 TDEConfig* copyTo(const TQString &file, TDEConfig *config=0) const;
166
179 TDELockFile::Ptr lockFile( bool bGlobal=false );
180
181protected:
182
189 virtual bool internalHasGroup(const TQCString &group) const;
190
201 virtual KEntryMap internalEntryMap(const TQString &pGroup) const;
202
212 virtual KEntryMap internalEntryMap() const { return aEntryMap; }
213
224 virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true);
225
234 virtual KEntry lookupData(const KEntryKey &_key) const;
235
243 KEntryMap aEntryMap;
244
245private:
250 TDEConfig( const TDEConfig& );
255 TDEConfig& operator= ( const TDEConfig& rConfig );
256
257private:
258 bool bGroupImmutable : 1; // Current group is immutable.
259 bool bFileImmutable : 1; // Current file is immutable.
260 bool bForceGlobal : 1; // Apply everything to kdeglobals.
261protected:
262 virtual void virtual_hook( int id, void* data );
263private:
264 TDEConfigPrivate *d;
265};
266
273class TDECORE_EXPORT TDESharedConfig : public TDEConfig, public TDEShared
274{
275 friend class TQValueList<TDESharedConfig*>;
276public:
277 typedef TDESharedPtr<TDESharedConfig> Ptr;
278
279public:
286 static TDESharedConfig::Ptr openConfig(const TQString& fileName, bool readOnly = false,
287 bool bUseKDEGlobals = true);
288
289private:
290 TDESharedConfig( const TQString& fileName, bool readOnly, bool useKDEGlobals );
291 ~TDESharedConfig();
292
293 static TQValueList<TDESharedConfig*> *s_list;
294};
295
296#endif
TDEConfigBackEnd
Abstract base class for KDE configuration file loading/saving.
Definition: tdeconfigbackend.h:49
TDEConfigBase
KDE Configuration Management abstract base class.
Definition: tdeconfigbase.h:71
TDEConfigBase::lookupData
virtual KEntry lookupData(const KEntryKey &_key) const =0
Looks up an entry in the config object's internal structure.
TDEConfigBase::internalEntryMap
virtual KEntryMap internalEntryMap() const =0
Returns a map (tree) of the entries in the tree.
TDEConfigBase::groupList
virtual TQStringList groupList() const =0
Returns a list of groups that are known about.
TDEConfigBase::reparseConfiguration
virtual void reparseConfiguration()=0
Reparses all configuration files.
TDEConfigBase::putData
virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true)=0
Inserts a (key/value) pair into the internal storage mechanism of the configuration object.
TDEConfigBase::rollback
virtual void rollback(bool bDeep=true)
Mark the config object as "clean," i.e.
Definition: tdeconfigbase.cpp:1755
TDEConfigBase::entryMap
virtual TQMap< TQString, TQString > entryMap(const TQString &group) const =0
Returns a map (tree) of entries for all entries in a particular group.
TDEConfig
Access KDE Configuration entries.
Definition: tdeconfig.h:44
TDEConfig::internalEntryMap
virtual KEntryMap internalEntryMap() const
Returns a map (tree) of the entries in the tree.
Definition: tdeconfig.h:212
TDEConfig::aEntryMap
KEntryMap aEntryMap
Contains all key,value entries, as well as some "special" keys which indicate the start of a group of...
Definition: tdeconfig.h:243
TDEConfig::forceGlobal
bool forceGlobal() const
Returns true if all entries are being written into kdeglobals.
Definition: tdeconfig.h:136
TDEConfig::setForceGlobal
void setForceGlobal(bool force)
Forces all following write-operations being performed on kdeglobals, independent of the bGlobal flag ...
Definition: tdeconfig.h:129
TDESharedConfig
TDEConfig variant using shared memory.
Definition: tdeconfig.h:274
TDESharedPtr< TDELockFile >
TDEShared
Reference counting for shared objects.
Definition: ksharedptr.h:40
KEntryKey
key structure holding both the actual key and the the group to which it belongs.
Definition: tdeconfigdata.h:70
KEntry
map/dict/list config node entry.
Definition: tdeconfigdata.h:33

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.9.4
This website is maintained by Timothy Pearson.