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

KDECore

  • 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
31class QStringList;
32class KConfigGroup;
33class KConfigBasePrivate;
34
38class KDECORE_EXPORT KConfigBase
39{
40public:
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
165protected:
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
180Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigBase::WriteConfigFlags)
181
182
183
184#endif // KCONFIG_H
KConfigBasePrivate
Definition: kconfigbase_p.h:28
KConfigBase
Definition: kconfigbase.h:39
KConfigBase::isGroupImmutableImpl
virtual bool isGroupImmutableImpl(const QByteArray &aGroup) const =0
KConfigBase::sync
virtual void sync()=0
Syncs the configuration object that this group belongs to.
KConfigBase::groupList
virtual QStringList groupList() const =0
Returns a list of groups that are known about.
KConfigBase::deleteGroupImpl
virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags=Normal)=0
KConfigBase::markAsClean
virtual void markAsClean()=0
Reset the dirty flags of all entries in the entry map, so the values will not be written to disk on a...
KConfigBase::isImmutable
virtual bool isImmutable() const =0
Checks whether this configuration object can be modified.
KConfigBase::WriteConfigFlag
WriteConfigFlag
Flags to control write entry.
Definition: kconfigbase.h:45
KConfigBase::hasGroupImpl
virtual bool hasGroupImpl(const QByteArray &group) const =0
KConfigBase::AccessMode
AccessMode
Possible return values for accessMode().
Definition: kconfigbase.h:133
KConfigBase::groupImpl
virtual KConfigGroup groupImpl(const QByteArray &b)=0
KConfigBase::accessMode
virtual AccessMode accessMode() const =0
Returns the access mode of the app-config object.
KConfigBase::groupImpl
virtual const KConfigGroup groupImpl(const QByteArray &b) const =0
KConfigGroup
A class for one specific group in a KConfig object.
Definition: kconfiggroup.h:54
QStringList
QString
kdecore_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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