• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.2 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 
36 class KConfigGroup;
37 class KComponentData;
38 class KEntryMap;
39 class KConfigPrivate;
40 
70 class KDECORE_EXPORT KConfig : public KConfigBase
71 {
72 public:
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 
197  void markAsClean();
198 
201  AccessMode accessMode() const;
202 
221  bool isConfigWritable(bool warnUser);
223 
241  KConfig* copyTo(const QString &file, KConfig *config = 0) const;
242 
259  void checkUpdate(const QString &id, const QString &updateFile);
260 
264  void reparseConfiguration();
265 
267 
295  void addConfigSources(const QStringList &sources);
296 
299 
302  QString locale() const;
315  bool setLocale(const QString& aLocale);
317 
319 
328  void setReadDefaults(bool b);
333  bool readDefaults() const;
335 
338  bool isImmutable() const;
340 
342 
351 #ifndef KDE_NO_DEPRECATED
352  KDE_DEPRECATED void setForceGlobal(bool force);
353 #endif
354 
363 #ifndef KDE_NO_DEPRECATED
364  KDE_DEPRECATED bool forceGlobal() const;
365 #endif
366 
367 
369  QStringList groupList() const;
370 
382  QMap<QString, QString> entryMap(const QString &aGroup=QString()) const;
383 
384 protected:
385  virtual bool hasGroupImpl(const QByteArray &group) const;
386  virtual KConfigGroup groupImpl( const QByteArray &b);
387  virtual const KConfigGroup groupImpl(const QByteArray &b) const;
388  virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags = Normal);
389  virtual bool isGroupImmutableImpl(const QByteArray& aGroup) const;
390 
391  friend class KConfigGroup;
392  friend class KConfigGroupPrivate;
393 
397  virtual void virtual_hook( int id, void* data );
398 
399  KConfigPrivate *const d_ptr;
400 
401  KConfig(KConfigPrivate &d);
402 
403 private:
404  QStringList keyList(const QString& aGroup=QString()) const;
405 
406  Q_DISABLE_COPY(KConfig)
407 
408  Q_DECLARE_PRIVATE(KConfig)
409 };
410 Q_DECLARE_OPERATORS_FOR_FLAGS( KConfig::OpenFlags )
411 
412 #endif // KCONFIG_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Apr 16 2013 19:11:41 by doxygen 1.8.3.1 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.10.2 API Reference

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