From c38b88497a833e482e6892b72c8f52adec6de857 Mon Sep 17 00:00:00 2001 From: Jenkins CI Date: Wed, 18 Dec 2013 00:45:18 +0000 Subject: 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 --- tier1/kconfig/src/gui/kconfigloader_p.h | 222 ++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 tier1/kconfig/src/gui/kconfigloader_p.h (limited to 'tier1/kconfig/src/gui/kconfigloader_p.h') 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 + * + * 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 + +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* newIntList() + { + QList *v = new QList; + 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 *newUrlList() + { + QList *v = new QList(); + 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 bools; + QList strings; + QList stringlists; + QList colors; + QList fonts; + QList ints; + QList uints; + QList urls; + QList dateTimes; + QList doubles; + QList *> intlists; + QList longlongs; + QList points; + QList rects; + QList sizes; + QList ulonglongs; + QList *> urllists; + QString baseGroup; + QStringList groups; + QHash keysToNames; + bool saveDefaults; +}; + +#endif -- cgit v1.2.1