KDEUI
kconfigskeleton.h
Go to the documentation of this file.
00001 /* 00002 * This file is part of KDE. 00003 * 00004 * Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org> 00005 * Copyright (c) 2003 Waldo Bastian <bastian@kde.org> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Library General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Library General Public License 00018 * along with this library; see the file COPYING.LIB. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef KCONFIGSKELETON_H 00024 #define KCONFIGSKELETON_H 00025 00026 #include <kdeui_export.h> 00027 00028 #include <kcoreconfigskeleton.h> 00029 00030 #include <QtGui/QColor> 00031 #include <QtGui/QFont> 00032 00040 class KDEUI_EXPORT KConfigSkeleton : public KCoreConfigSkeleton 00041 { 00042 Q_OBJECT 00043 public: 00047 class KDEUI_EXPORT ItemColor:public KConfigSkeletonGenericItem < QColor > 00048 { 00049 public: 00051 ItemColor(const QString & _group, const QString & _key, 00052 QColor & reference, 00053 const QColor & defaultValue = QColor(128, 128, 128)); 00054 00056 void readConfig(KConfig * config); 00057 00059 void setProperty(const QVariant & p); 00060 00062 bool isEqual(const QVariant &p) const; 00063 00065 QVariant property() const; 00066 }; 00067 00068 00072 class KDEUI_EXPORT ItemFont:public KConfigSkeletonGenericItem < QFont > 00073 { 00074 public: 00076 ItemFont(const QString & _group, const QString & _key, QFont & reference, 00077 const QFont & defaultValue = QFont()); 00078 00080 void readConfig(KConfig * config); 00081 00083 void setProperty(const QVariant & p); 00084 00086 bool isEqual(const QVariant &p) const; 00087 00089 QVariant property() const; 00090 }; 00091 00092 public: 00099 explicit KConfigSkeleton(const QString & configname = QString(), QObject* parent = 0); 00100 00106 explicit KConfigSkeleton(KSharedConfig::Ptr config, QObject* parent = 0); 00107 00119 ItemColor *addItemColor(const QString & name, QColor & reference, 00120 const QColor & defaultValue = QColor(128, 128, 128), 00121 const QString & key = QString()); 00122 00134 ItemFont *addItemFont(const QString & name, QFont & reference, 00135 const QFont & defaultValue = QFont(), 00136 const QString & key = QString()); 00137 00138 }; 00139 00140 #endif
KDE 4.6 API Reference