kcmultidialog.h
00001 /* 00002 Copyright (c) 2000 Matthias Elter <elter@kde.org> 00003 Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org> 00004 Copyright (c) 2003 Matthias Kretz <kretz@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 */ 00022 00023 #ifndef KCMULTIDIALOG_H 00024 #define KCMULTIDIALOG_H 00025 00026 #include <qptrdict.h> 00027 00028 #include <kdialogbase.h> 00029 #include <klocale.h> 00030 #include <kservice.h> 00031 00032 class KCModuleProxy; 00033 class KCModuleInfo; 00034 00043 class KUTILS_EXPORT KCMultiDialog : public KDialogBase 00044 { 00045 Q_OBJECT 00046 00047 public: 00055 KCMultiDialog( QWidget *parent=0, const char *name=0, bool modal=false ); 00056 00070 KCMultiDialog( int dialogFace, const QString & caption, QWidget * parent = 0, 00071 const char * name = 0, bool modal = false ); 00072 00073 00102 KCMultiDialog( int dialogFace, const KGuiItem &user2, 00103 const KGuiItem &user3=KGuiItem(), int buttonMask=User2, 00104 const QString &caption=i18n("Configure"), QWidget *parent=0, 00105 const char *name=0, bool modal=false ) KDE_DEPRECATED; 00106 // KDE4 remove the user3 argument, and instead initialize it to KStdGuiItem::adminMode. 00107 00111 virtual ~KCMultiDialog(); 00112 00122 void addModule(const QString& module, bool withfallback=true); 00123 00139 void addModule(const KCModuleInfo& moduleinfo, QStringList 00140 parentmodulenames = QStringList(), bool withfallback=false); 00141 00145 void removeAllModules(); 00146 00151 void show(); 00152 00153 signals: 00160 void configCommitted(); 00161 00177 void configCommitted( const QCString & instanceName ); 00178 00179 protected slots: 00186 virtual void slotDefault(); 00187 00194 virtual void slotUser1(); 00195 00202 virtual void slotApply(); 00203 00210 virtual void slotOk(); 00211 00222 virtual void slotHelp(); 00223 00224 private slots: 00225 00226 void slotAboutToShow(QWidget *); 00227 00228 void clientChanged(bool state); 00229 00237 void disableRModeButton(); 00238 00245 void rootExit(); 00246 00255 void dialogClosed(); 00256 00257 private: 00258 00259 void init(); 00260 void apply(); 00261 00262 struct CreatedModule 00263 { 00264 KCModuleProxy * kcm; 00265 KService::Ptr service; 00266 /* KDE 4 Move to Private class */ 00267 }; 00268 typedef QValueList<CreatedModule> ModuleList; 00269 ModuleList m_modules; 00270 00271 typedef QMap<KService::Ptr, KCModuleProxy*> OrphanMap; 00272 OrphanMap m_orphanModules; 00273 00274 QPtrDict<QStringList> moduleParentComponents; 00275 QString _docPath; 00276 int dialogface; 00277 00278 class KCMultiDialogPrivate; 00279 KCMultiDialogPrivate *d; 00280 }; 00281 00282 #endif //KCMULTIDIALOG_H 00283 00284 // vim: sw=4 sts=4 et