2 * Copyright 2007 Aaron Seigo <aseigo@kde.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #include <KDE/KConfigGroup>
24 #include <KDE/KConfigSkeleton>
25 #include <KDE/KSharedConfig>
27 #include <plasma/plasma_export.h>
30 * @brief A KConfigSkeleton that populates itself based on KConfigXT XML
32 * This class allows one to ship an XML file and reconstitute it into a
33 * KConfigSkeleton object at runtime. Common usage might look like this:
36 * QFile file(xmlFilePath);
37 * Plasma::ConfigXml appletConfig(configFilePath, &file);
40 * Alternatively, any QIODevice may be used in place of QFile in the
43 * Currently the following data types are supported:
71 class PLASMA_EXPORT ConfigXml
: public KConfigSkeleton
75 * Creates a KConfigSkeleton populated using the definition found in
76 * the XML data passed in.
78 * @param configFile path to the configuration file to use
79 * @param xml the xml data; must be valid KConfigXT data
80 * @param parent optional QObject parent
82 ConfigXml(const QString
&configFile
, QIODevice
*xml
, QObject
*parent
= 0);
85 * Creates a KConfigSkeleton populated using the definition found in
86 * the XML data passed in.
88 * @param config the configuration object to use
89 * @param xml the xml data; must be valid KConfigXT data
90 * @param parent optional QObject parent
92 ConfigXml(KSharedConfigPtr config
, QIODevice
*xml
, QObject
*parent
= 0);
95 * Creates a KConfigSkeleton populated using the definition found in
96 * the XML data passed in.
98 * @param config the group to use as the root for configuration items
99 * @param xml the xml data; must be valid KConfigXT data
100 * @param parent optional QObject parent
102 ConfigXml(const KConfigGroup
*config
, QIODevice
*xml
, QObject
*parent
= 0);
110 } // Plasma namespace
112 #endif //multiple inclusion guard