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

KDECore

kconfig.h

Go to the documentation of this file.
00001 /*
00002    This file is part of the KDE libraries
00003    Copyright (c) 2006, 2007 Thomas Braxton <kde.braxton@gmail.com>
00004    Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
00005    Copyright (c) 1999 Preston Brown <pbrown@kde.org>
00006    Copyright (c) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
00007 
00008    This library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public
00010    License as published by the Free Software Foundation; either
00011    version 2 of the License, or (at your option) any later version.
00012 
00013    This library is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Library General Public License for more details.
00017 
00018    You should have received a copy of the GNU Library General Public License
00019    along with this library; see the file COPYING.LIB.  If not, write to
00020    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021    Boston, MA 02110-1301, USA.
00022 */
00023 
00024 #ifndef KCONFIG_H
00025 #define KCONFIG_H
00026 
00027 #include "kconfigbase.h"
00028 
00029 #include <kdecore_export.h>
00030 
00031 #include <QtCore/QString>
00032 #include <QtCore/QVariant>
00033 #include <QtCore/QByteArray>
00034 #include <QtCore/QList>
00035 
00036 class KConfigGroup;
00037 class KComponentData;
00038 class KEntryMap;
00039 class KConfigPrivate;
00040 
00070 class KDECORE_EXPORT KConfig : public KConfigBase
00071 {
00072 public:
00073     enum OpenFlag {
00074         IncludeGlobals  = 0x01, 
00075         CascadeConfig   = 0x02, 
00076 
00079         SimpleConfig    = 0x00, 
00080         NoCascade       = IncludeGlobals, 
00081         NoGlobals       = CascadeConfig, 
00082         FullConfig      = IncludeGlobals|CascadeConfig 
00083     };
00084     Q_DECLARE_FLAGS(OpenFlags, OpenFlag)
00085 
00086     explicit KConfig(const QString& file = QString(), OpenFlags mode = FullConfig,
00087                      const char* resourceType = "config");
00088 
00089     explicit KConfig(const KComponentData& componentData, const QString& file = QString(),
00090                      OpenFlags mode = FullConfig, const char* resourceType = "config");
00091 
00104     KConfig(const QString& file, const QString& backend, const char* resourceType = "config");
00105 
00106     virtual ~KConfig();
00107 
00108     const KComponentData &componentData() const; // krazy:exclude=constref
00109 
00113     QString name() const;
00114 
00116     void sync();
00117 
00119     void markAsClean();
00120 
00123     AccessMode accessMode() const;
00124 
00131     bool isConfigWritable(bool warnUser);
00133 
00147     KConfig* copyTo(const QString &file, KConfig *config=0) const;
00148 
00162     void checkUpdate(const QString &id, const QString &updateFile);
00163 
00168     void reparseConfiguration();
00169 
00171 
00187     void addConfigSources(const QStringList &sources);
00188 
00191 
00194     QString locale() const;
00202     bool setLocale(const QString& aLocale);
00204 
00206 
00211     void setReadDefaults(bool b);
00212     bool readDefaults() const;
00214 
00217     bool isImmutable() const;
00219 
00221 
00227     KDE_DEPRECATED void setForceGlobal(bool force);
00234     KDE_DEPRECATED bool forceGlobal() const;
00236 
00238     QStringList groupList() const;
00239 
00250     QMap<QString, QString> entryMap(const QString &aGroup=QString()) const;
00251 
00252 protected:
00253     virtual bool hasGroupImpl(const QByteArray &group) const;
00254     virtual KConfigGroup groupImpl( const QByteArray &b);
00255     virtual const KConfigGroup groupImpl(const QByteArray &b) const;
00256     virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags = Normal);
00257     virtual bool isGroupImmutableImpl(const QByteArray& aGroup) const;
00258 
00259     friend class KConfigGroup;
00260     friend class KConfigGroupPrivate;
00261 
00265     virtual void virtual_hook( int id, void* data );
00266 
00267     KConfigPrivate *const d_ptr;
00268 
00269     KConfig(KConfigPrivate &d);
00270 
00271 private:
00272     QStringList keyList(const QString& aGroup=QString()) const;
00273 
00274     Q_DISABLE_COPY(KConfig)
00275 
00276     Q_DECLARE_PRIVATE(KConfig)
00277 };
00278 Q_DECLARE_OPERATORS_FOR_FLAGS( KConfig::OpenFlags )
00279 
00280 #endif // KCONFIG_H

KDECore

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal