Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / plasma / configxml.h
blob7616e167d6091ac57981dd3f99e5e743c20f78ac
1 /*
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.
20 #ifndef CONFIGXML_H
21 #define CONFIGXML_H
23 #include <KDE/KConfigGroup>
24 #include <KDE/KConfigSkeleton>
25 #include <KDE/KSharedConfig>
27 #include <plasma/plasma_export.h>
29 /**
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:
35 * \code
36 * QFile file(xmlFilePath);
37 * Plasma::ConfigXml appletConfig(configFilePath, &file);
38 * \endcode
40 * Alternatively, any QIODevice may be used in place of QFile in the
41 * example above.
43 * Currently the following data types are supported:
45 * @li bools
46 * @li colors
47 * @li datetimes
48 * @li enumerations
49 * @li fonts
50 * @li ints
51 * @li passwords
52 * @li paths
53 * @li strings
54 * @li stringlists
55 * @li uints
56 * @li urls
57 * @li doubles
58 * @li int lists
59 * @li longlongs
60 * @li path lists
61 * @li points
62 * @li rects
63 * @li sizes
64 * @li ulonglongs
65 * @li url lists
66 **/
68 namespace Plasma
71 class PLASMA_EXPORT ConfigXml : public KConfigSkeleton
73 public:
74 /**
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
81 **/
82 ConfigXml(const QString &configFile, QIODevice *xml, QObject *parent = 0);
84 /**
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
91 **/
92 ConfigXml(KSharedConfigPtr config, QIODevice *xml, QObject *parent = 0);
94 /**
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);
103 ~ConfigXml();
105 class Private;
106 private:
107 Private * const d;
110 } // Plasma namespace
112 #endif //multiple inclusion guard