• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • kdecore
  • config
kconfigbase.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE libraries
3  Copyright (c) 2006, 2007 Thomas Braxton <kde.braxton@gmail.com>
4  Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
5  Copyright (c) 1999 Preston Brown <pbrown@kde.org>
6  Copyright (c) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  along with this library; see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
23 
24 #ifndef KCONFIGBASE_H
25 #define KCONFIGBASE_H
26 
27 #include <kdecore_export.h>
28 
29 #include <QtCore/QtGlobal>
30 
31 class QStringList;
32 class KConfigGroup;
33 class KConfigBasePrivate;
34 
38 class KDECORE_EXPORT KConfigBase
39 {
40 public:
44  enum WriteConfigFlag
45  {
46  Persistent = 0x01,
50  Global = 0x02,
55  Localized = 0x04,
59  Normal=Persistent
65  };
66  Q_DECLARE_FLAGS(WriteConfigFlags, WriteConfigFlag)
67 
68 
71  virtual ~KConfigBase();
72 
78  virtual QStringList groupList() const = 0;
79 
86  bool hasGroup(const QString &group) const;
87  bool hasGroup(const char *group) const;
88  bool hasGroup(const QByteArray &group) const;
89 
97  KConfigGroup group(const QByteArray &group);
98  KConfigGroup group(const QString &group);
99  KConfigGroup group(const char *group);
100 
104  const KConfigGroup group(const QByteArray &group) const;
105  const KConfigGroup group(const QString &group) const;
106  const KConfigGroup group(const char *group) const;
107 
112  void deleteGroup(const QByteArray &group, WriteConfigFlags flags = Normal);
113  void deleteGroup(const QString &group, WriteConfigFlags flags = Normal);
114  void deleteGroup(const char *group, WriteConfigFlags flags = Normal);
115 
122  virtual void sync() = 0;
123 
128  virtual void markAsClean() = 0;
129 
133  enum AccessMode { NoAccess, ReadOnly, ReadWrite };
134 
147  virtual AccessMode accessMode() const = 0;
148 
153  virtual bool isImmutable() const = 0;
154 
161  bool isGroupImmutable(const QByteArray& aGroup) const;
162  bool isGroupImmutable(const QString& aGroup) const;
163  bool isGroupImmutable(const char *aGroup) const;
164 
165 protected:
166  KConfigBase();
167 
168  virtual bool hasGroupImpl(const QByteArray &group) const = 0;
169  virtual KConfigGroup groupImpl( const QByteArray &b) = 0;
170  virtual const KConfigGroup groupImpl(const QByteArray &b) const = 0;
171  virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags = Normal) = 0;
172  virtual bool isGroupImmutableImpl(const QByteArray& aGroup) const = 0;
173 
177  virtual void virtual_hook( int id, void* data );
178 };
179 
180 Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigBase::WriteConfigFlags)
181 
182 
183 
184 #endif // KCONFIG_H
KConfigBasePrivate
Definition: kconfigbase_p.h:27
kdecore_export.h
QByteArray
KMacroExpander::group
Definition: kmacroexpander_unix.cpp:34
KConfigBase::WriteConfigFlag
WriteConfigFlag
Flags to control write entry.
Definition: kconfigbase.h:44
QString
KConfigBase
Definition: kconfigbase.h:38
QStringList
KConfigGroup
A class for one specific group in a KConfig object.
Definition: kconfiggroup.h:53
KConfigBase::AccessMode
AccessMode
Possible return values for accessMode().
Definition: kconfigbase.h:133
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal