KDEUI
kconfigdialogmanager.h
Go to the documentation of this file.
00001 /* 00002 * This file is part of the KDE libraries 00003 * Copyright (C) 2003 Benjamin C Meyer (ben+kdelibs at meyerhome dot net) 00004 * Copyright (C) 2003 Waldo Bastian <bastian@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 #ifndef KCONFIGDIALOGMANAGER_H 00022 #define KCONFIGDIALOGMANAGER_H 00023 00024 #include <kdeui_export.h> 00025 00026 #include <QtCore/QObject> 00027 #include <QtCore/QHash> 00028 00029 class KCoreConfigSkeleton; 00030 class KConfigSkeleton; 00031 class KConfigSkeletonItem; 00032 class QWidget; 00033 00085 class KDEUI_EXPORT KConfigDialogManager : public QObject { 00086 00087 Q_OBJECT 00088 00089 Q_SIGNALS: 00095 void settingsChanged(); 00096 00104 void settingsChanged( QWidget *widget ); 00105 00113 void widgetModified(); 00114 00115 00116 public: 00117 00123 KConfigDialogManager(QWidget *parent, KCoreConfigSkeleton *conf); 00124 00130 KConfigDialogManager(QWidget *parent, KConfigSkeleton *conf); 00131 00135 ~KConfigDialogManager(); 00136 00141 void addWidget(QWidget *widget); 00142 00147 bool hasChanged() const; 00148 00153 bool isDefault() const; 00154 00158 static QHash<QString, QByteArray> *propertyMap(); 00159 00163 static QHash<QString, QByteArray> *changedMap(); 00164 00165 public Q_SLOTS: 00172 void updateSettings(); 00173 00181 void updateWidgets(); 00182 00189 void updateWidgetsDefault(); 00190 00191 protected: 00192 00199 void init(bool trackChanges); 00200 00211 bool parseChildren(const QWidget *widget, bool trackChanges); 00212 00217 QByteArray getUserProperty(const QWidget *widget) const; 00218 00225 QByteArray getCustomProperty(const QWidget *widget) const; 00226 00230 void setProperty(QWidget *w, const QVariant &v); 00231 00235 QVariant property(QWidget *w) const; 00236 00240 void setupWidget(QWidget *widget, KConfigSkeletonItem *item); 00241 00245 static void initMaps(); 00246 00247 private: 00248 class Private; 00249 friend class Private; 00250 00254 Private *const d; 00255 00256 Q_DISABLE_COPY(KConfigDialogManager) 00257 }; 00258 00259 #endif // KCONFIGDIALOGMANAGER_H 00260
KDE 4.6 API Reference