KDEUI
kconfigdialog.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 KCONFIGDIALOG_H 00022 #define KCONFIGDIALOG_H 00023 00024 #include <kpagedialog.h> 00025 00026 class KConfig; 00027 class KConfigSkeleton; 00028 class KConfigDialogManager; 00029 00072 class KDEUI_EXPORT KConfigDialog : public KPageDialog { 00073 Q_OBJECT 00074 00075 Q_SIGNALS: 00079 void widgetModified(); 00080 00086 void settingsChanged(const QString& dialogName); 00087 00088 public: 00101 KConfigDialog( QWidget *parent, const QString& name, 00102 KConfigSkeleton *config ); 00103 00109 ~KConfigDialog(); 00110 00124 KPageWidgetItem* addPage( QWidget *page, const QString &itemName, 00125 const QString &pixmapName=QString(), 00126 const QString &header=QString(), 00127 bool manage=true ); 00128 00144 KPageWidgetItem* addPage( QWidget *page, KConfigSkeleton *config, 00145 const QString &itemName, 00146 const QString &pixmapName=QString(), 00147 const QString &header=QString() ); 00148 00155 static KConfigDialog* exists( const QString& name ); 00156 00163 static bool showDialog( const QString& name ); 00164 00165 00166 protected Q_SLOTS: 00173 virtual void updateSettings(); 00174 00182 virtual void updateWidgets(); 00183 00190 virtual void updateWidgetsDefault(); 00191 00192 00199 void updateButtons(); 00200 00206 void settingsChangedSlot(); 00207 00208 protected: 00209 00215 virtual bool hasChanged(); 00216 00221 virtual bool isDefault(); 00222 00226 virtual void showEvent(QShowEvent *e); 00227 00228 private Q_SLOTS: 00232 void onPageRemoved(KPageWidgetItem* item); 00233 00234 private: 00235 class KConfigDialogPrivate; 00236 friend class KConfigDialogPrivate; 00237 00238 KConfigDialogPrivate *const d; 00239 00240 Q_PRIVATE_SLOT( d, void _k_updateButtons() ) 00241 Q_PRIVATE_SLOT( d, void _k_settingsChangedSlot() ) 00242 00243 Q_DISABLE_COPY(KConfigDialog) 00244 }; 00245 00246 #endif //KCONFIGDIALOG_H 00247
KDE 4.6 API Reference