KConfig

kconfigloader.h
1 /*
2  SPDX-FileCopyrightText: 2007 Aaron Seigo <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KCONFIGLOADER_H
8 #define KCONFIGLOADER_H
9 
10 #include <QIODevice>
11 
12 #include <kconfiggroup.h>
13 #include <kconfigskeleton.h>
14 #include <ksharedconfig.h>
15 
16 #include <kconfiggui_export.h>
17 
18 class ConfigLoaderPrivate;
19 
88 class KCONFIGGUI_EXPORT KConfigLoader : public KConfigSkeleton
89 {
90 public:
99  KConfigLoader(const QString &configFile, QIODevice *xml, QObject *parent = nullptr);
100 
109  KConfigLoader(KSharedConfigPtr config, QIODevice *xml, QObject *parent = nullptr);
110 
119  KConfigLoader(const KConfigGroup &config, QIODevice *xml, QObject *parent = nullptr);
120 
121  ~KConfigLoader() override;
122 
130  KConfigSkeletonItem *findItem(const QString &group, const QString &key) const;
131 
135  KConfigSkeletonItem *findItemByName(const QString &name) const;
136 
140  QVariant property(const QString &name) const;
141 
148  bool hasGroup(const QString &group) const;
149 
153  QStringList groupList() const;
154 
155 protected:
156 #if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)
157 
160  bool usrWriteConfig() override;
161 #else
162  bool usrSave() override;
163 #endif
164 
165 private:
166  ConfigLoaderPrivate *const d;
167 };
168 
169 #endif //multiple inclusion guard
virtual bool usrSave()
Perform the actual writing of the configuration file.
A KConfigSkeleton that populates itself based on KConfigXT XML.
Definition: kconfigloader.h:88
Class for handling preferences settings for an application.
KConfigSkeletonItem * findItem(const QString &name) const
Lookup item by name.
QVariant property(const char *name) const const
A class for one specific group in a KConfig object.
Definition: kconfiggroup.h:38
Class for storing a preferences setting.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 1 2020 22:46:30 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.