KConfig 5.109.0
kconfigloader.h
1/*
2 SPDX-FileCopyrightText: 2007 Aaron Seigo <aseigo@kde.org>
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
18class ConfigLoaderPrivate;
19
88class KCONFIGGUI_EXPORT KConfigLoader : public KConfigSkeleton
89{
90public:
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
155protected:
156#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)
160 bool usrWriteConfig() override;
161#else
162 bool usrSave() override;
163#endif
164
165private:
166 ConfigLoaderPrivate *const d;
167};
168
169#endif // multiple inclusion guard
A class for one specific group in a KConfig object.
Definition kconfiggroup.h:39
A KConfigSkeleton that populates itself based on KConfigXT XML.
Definition kconfigloader.h:89
KConfigSkeletonItem * findItemByName(const QString &name) const
Finds an item by its name.
KConfigLoader(KSharedConfigPtr config, QIODevice *xml, QObject *parent=nullptr)
Creates a KConfigSkeleton populated using the definition found in the XML data passed in.
KConfigLoader(const KConfigGroup &config, QIODevice *xml, QObject *parent=nullptr)
Creates a KConfigSkeleton populated using the definition found in the XML data passed in.
KConfigSkeletonItem * findItem(const QString &group, const QString &key) const
Finds the item for the given group and key.
bool usrSave() override
Perform the actual writing of the configuration file.
QStringList groupList() const
bool hasGroup(const QString &group) const
Check to see if a group exists.
QVariant property(const QString &name) const
Returns the property (variantized value) of the named item.
KConfigLoader(const QString &configFile, QIODevice *xml, QObject *parent=nullptr)
Creates a KConfigSkeleton populated using the definition found in the XML data passed in.
Class for storing a preferences setting.
Definition kcoreconfigskeleton.h:42
Class for handling preferences settings for an application.
Definition kconfigskeleton.h:28