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

KDECore

  • kdecore
  • config
kconfig.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 KCONFIG_H
25#define KCONFIG_H
26
27#include "kconfigbase.h"
28
29#include <kdecore_export.h>
30
31#include <QtCore/QString>
32#include <QtCore/QVariant>
33#include <QtCore/QByteArray>
34#include <QtCore/QList>
35
36class KConfigGroup;
37class KComponentData;
38class KEntryMap;
39class KConfigPrivate;
40
70class KDECORE_EXPORT KConfig : public KConfigBase
71{
72public:
92 enum OpenFlag {
93 IncludeGlobals = 0x01,
94 CascadeConfig = 0x02,
95
96 SimpleConfig = 0x00,
97 NoCascade = IncludeGlobals,
98 NoGlobals = CascadeConfig,
99 FullConfig = IncludeGlobals|CascadeConfig
100 };
101 Q_DECLARE_FLAGS(OpenFlags, OpenFlag)
102
103
131 explicit KConfig(const QString& file = QString(), OpenFlags mode = FullConfig,
132 const char* resourceType = "config");
133
164 explicit KConfig(const KComponentData& componentData, const QString& file = QString(),
165 OpenFlags mode = FullConfig, const char* resourceType = "config");
166
179 KConfig(const QString& file, const QString& backend, const char* resourceType = "config");
180
181 virtual ~KConfig();
182
186 const KComponentData &componentData() const; // krazy:exclude=constref
187
191 QString name() const;
192
194 void sync();
195
198 bool isDirty() const;
199
201 void markAsClean();
202
205 AccessMode accessMode() const;
206
225 bool isConfigWritable(bool warnUser);
227
245 KConfig* copyTo(const QString &file, KConfig *config = 0) const;
246
263 void checkUpdate(const QString &id, const QString &updateFile);
264
268 void reparseConfiguration();
269
271
299 void addConfigSources(const QStringList &sources);
300
303
306 QString locale() const;
319 bool setLocale(const QString& aLocale);
321
323
332 void setReadDefaults(bool b);
337 bool readDefaults() const;
339
342 bool isImmutable() const;
344
346
355#ifndef KDE_NO_DEPRECATED
356 KDE_DEPRECATED void setForceGlobal(bool force);
357#endif
367#ifndef KDE_NO_DEPRECATED
368 KDE_DEPRECATED bool forceGlobal() const;
369#endif
371
373 QStringList groupList() const;
374
386 QMap<QString, QString> entryMap(const QString &aGroup=QString()) const;
387
388protected:
389 virtual bool hasGroupImpl(const QByteArray &group) const;
390 virtual KConfigGroup groupImpl( const QByteArray &b);
391 virtual const KConfigGroup groupImpl(const QByteArray &b) const;
392 virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags = Normal);
393 virtual bool isGroupImmutableImpl(const QByteArray& aGroup) const;
394
395 friend class KConfigGroup;
396 friend class KConfigGroupPrivate;
397
401 virtual void virtual_hook( int id, void* data );
402
403 KConfigPrivate *const d_ptr;
404
405 KConfig(KConfigPrivate &d);
406
407private:
408 friend class KConfigTest;
409
410 QStringList keyList(const QString& aGroup=QString()) const;
411
412 Q_DISABLE_COPY(KConfig)
413
414 Q_DECLARE_PRIVATE(KConfig)
415};
416Q_DECLARE_OPERATORS_FOR_FLAGS( KConfig::OpenFlags )
417
418#endif // KCONFIG_H
KComponentData
Per component data.
Definition: kcomponentdata.h:47
KConfigBase
Definition: kconfigbase.h:39
KConfigGroup
A class for one specific group in a KConfig object.
Definition: kconfiggroup.h:54
KConfigPrivate
Definition: kconfig_p.h:43
KConfig
The central class of the KDE configuration data system.
Definition: kconfig.h:71
KConfig::OpenFlag
OpenFlag
Determines how the system-wide and user's global settings will affect the reading of the configuratio...
Definition: kconfig.h:92
KConfig::d_ptr
KConfigPrivate *const d_ptr
Definition: kconfig.h:403
KEntryMap
type specifying a map of entries (key,value pairs).
Definition: kconfigdata.h:153
QMap
QStringList
QString
kconfigbase.h
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