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

KDECore

  • kdecore
  • config
kconfig_p.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_P_H
25 #define KCONFIG_P_H
26 
27 #include "kconfigdata.h"
28 #include <kglobal.h>
29 #include "kconfigbackend.h"
30 #include "kconfiggroup.h"
31 #include "kcomponentdata.h"
32 #include "kstandarddirs.h"
33 #include "klocale.h"
34 
35 #include <QtCore/QStringList>
36 #include <QtCore/QStack>
37 #include <QtCore/QFile>
38 #include <QtCore/QDir>
39 
40 #include <unistd.h>
41 
42 class KConfigPrivate
43 {
44  friend class KConfig;
45 public:
46  KConfig::OpenFlags openFlags;
47  const char* resourceType;
48 
49  void changeFileName(const QString& fileName, const char* resourceType);
50 
51  // functions for KConfigGroup
52  bool canWriteEntry(const QByteArray& group, const char* key, bool isDefault=false) const;
53  QString lookupData(const QByteArray& group, const char* key, KEntryMap::SearchFlags flags,
54  bool* expand) const;
55  QByteArray lookupData(const QByteArray& group, const char* key, KEntryMap::SearchFlags flags) const;
56 
57  void putData(const QByteArray& group, const char* key, const QByteArray& value,
58  KConfigBase::WriteConfigFlags flags, bool expand=false);
59  QStringList groupList(const QByteArray& group) const;
60  // copies the entries from @p source to @p otherGroup changing all occurrences
61  // of @p source with @p destination
62  void copyGroup(const QByteArray& source, const QByteArray& destination,
63  KConfigGroup *otherGroup, KConfigBase::WriteConfigFlags flags) const;
64  QStringList keyListImpl(const QByteArray& theGroup) const;
65  QSet<QByteArray> allSubGroups(const QByteArray& parentGroup) const;
66  bool hasNonDeletedEntries(const QByteArray& group) const;
67 
68  static QString expandString(const QString& value);
69 
70 protected:
71  KSharedPtr<KConfigBackend> mBackend;
72 
73  KConfigPrivate(const KComponentData &componentData_, KConfig::OpenFlags flags,
74  const char* resource);
75 
76  virtual ~KConfigPrivate()
77  {
78  }
79 
80  bool bDynamicBackend:1; // do we own the backend?
81 private:
82  bool bDirty:1;
83  bool bLocaleInitialized:1;
84  bool bReadDefaults:1;
85  bool bFileImmutable:1;
86  bool bForceGlobal:1;
87  bool bSuppressGlobal:1;
88 
89  QString sGlobalFileName;
90  static bool mappingsRegistered;
91 
92 
93  KEntryMap entryMap;
94  QString backendType;
95  QStack<QString> extraFiles;
96 
97  QString locale;
98  QString fileName;
99  QString etc_kderc;
100  KComponentData componentData;
101  KConfigBase::AccessMode configState;
102 
103  bool wantGlobals() const { return openFlags&KConfig::IncludeGlobals && !bSuppressGlobal; }
104  bool wantDefaults() const { return openFlags&KConfig::CascadeConfig; }
105  bool isSimple() const { return openFlags == KConfig::SimpleConfig; }
106  bool isReadOnly() const { return configState == KConfig::ReadOnly; }
107 
108  bool setLocale(const QString& aLocale);
109  QStringList getGlobalFiles() const;
110  void parseGlobalFiles();
111  void parseConfigFiles();
112  void initCustomized(KConfig*);
113  bool lockLocal();
114 };
115 
116 #endif // KCONFIG_P_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Apr 20 2013 05:59:09 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