diff options
author | Jenkins CI <null@kde.org> | 2013-12-18 00:45:18 +0000 |
---|---|---|
committer | Jenkins CI <null@kde.org> | 2013-12-18 00:45:18 +0000 |
commit | c38b88497a833e482e6892b72c8f52adec6de857 (patch) | |
tree | 8c2d4b788cf54ab2179ffe53515d276feaeba2d1 /tier1/kconfig/src/gui/kconfigloader_p.h | |
download | kconfig-c38b88497a833e482e6892b72c8f52adec6de857.tar.gz kconfig-c38b88497a833e482e6892b72c8f52adec6de857.tar.bz2 |
Initial import from the monolithic kdelibs.
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:
http://community.kde.org/Frameworks/GitOldHistory
If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.
Branched from the monolithic repo, kdelibs frameworks branch, at commit
162066dbbecde401a7347a1cff4fe72a9c919f58
Diffstat (limited to 'tier1/kconfig/src/gui/kconfigloader_p.h')
-rw-r--r-- | tier1/kconfig/src/gui/kconfigloader_p.h | 222 |
1 files changed, 222 insertions, 0 deletions
diff --git a/tier1/kconfig/src/gui/kconfigloader_p.h b/tier1/kconfig/src/gui/kconfigloader_p.h new file mode 100644 index 00000000..f9aa9191 --- /dev/null +++ b/tier1/kconfig/src/gui/kconfigloader_p.h @@ -0,0 +1,222 @@ +/* + * Copyright 2007-2008 Aaron Seigo <aseigo@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef KCONFIGLOADER_P_H +#define KCONFIGLOADER_P_H + +#include <QUrl> + +class ConfigLoaderPrivate +{ + public: + ConfigLoaderPrivate() + : saveDefaults(false) + { + } + + ~ConfigLoaderPrivate() + { + clearData(); + } + + void clearData() + { + qDeleteAll(bools); + qDeleteAll(strings); + qDeleteAll(stringlists); + qDeleteAll(colors); + qDeleteAll(fonts); + qDeleteAll(ints); + qDeleteAll(uints); + qDeleteAll(urls); + qDeleteAll(dateTimes); + qDeleteAll(doubles); + qDeleteAll(intlists); + qDeleteAll(longlongs); + qDeleteAll(points); + qDeleteAll(rects); + qDeleteAll(sizes); + qDeleteAll(ulonglongs); + qDeleteAll(urllists); + } + + bool *newBool() + { + bool *v = new bool; + bools.append(v); + return v; + } + + QString *newString() + { + QString *v = new QString; + strings.append(v); + return v; + } + + QStringList *newStringList() + { + QStringList *v = new QStringList; + stringlists.append(v); + return v; + } + + QColor *newColor() + { + QColor *v = new QColor; + colors.append(v); + return v; + } + + QFont *newFont() + { + QFont *v = new QFont; + fonts.append(v); + return v; + } + + qint32 *newInt() + { + qint32 *v = new qint32; + ints.append(v); + return v; + } + + quint32 *newUint() + { + quint32 *v = new quint32; + uints.append(v); + return v; + } + + QUrl *newUrl() + { + QUrl *v = new QUrl; + urls.append(v); + return v; + } + + QDateTime *newDateTime() + { + QDateTime *v = new QDateTime; + dateTimes.append(v); + return v; + } + + double *newDouble() + { + double *v = new double; + doubles.append(v); + return v; + } + + QList<qint32>* newIntList() + { + QList<qint32> *v = new QList<qint32>; + intlists.append(v); + return v; + } + + qint64 *newLongLong() + { + qint64 *v = new qint64; + longlongs.append(v); + return v; + } + + QPoint *newPoint() + { + QPoint *v = new QPoint; + points.append(v); + return v; + } + + QRect *newRect() + { + QRect *v = new QRect; + rects.append(v); + return v; + } + + QSize *newSize() + { + QSize *v = new QSize; + sizes.append(v); + return v; + } + + quint64 *newULongLong() + { + quint64 *v = new quint64; + ulonglongs.append(v); + return v; + } + + QList<QUrl> *newUrlList() + { + QList<QUrl> *v = new QList<QUrl>(); + urllists.append(v); + return v; + } + + void parse(KConfigLoader *loader, QIODevice *xml); + + /** + * Whether or not to write out default values. + * + * @param writeDefaults true if defaults should be written out + */ + void setWriteDefaults(bool writeDefaults) + { + saveDefaults = writeDefaults; + } + + /** + * @return true if default values will also be written out + */ + bool writeDefaults() const + { + return saveDefaults; + } + + + QList<bool *> bools; + QList<QString *> strings; + QList<QStringList *> stringlists; + QList<QColor *> colors; + QList<QFont *> fonts; + QList<qint32 *> ints; + QList<quint32 *> uints; + QList<QUrl *> urls; + QList<QDateTime *> dateTimes; + QList<double *> doubles; + QList<QList<qint32> *> intlists; + QList<qint64 *> longlongs; + QList<QPoint *> points; + QList<QRect *> rects; + QList<QSize *> sizes; + QList<quint64 *> ulonglongs; + QList<QList<QUrl> *> urllists; + QString baseGroup; + QStringList groups; + QHash<QString, QString> keysToNames; + bool saveDefaults; +}; + +#endif |