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 <tqptrdict.h> 00027 00028 #include <kdialogbase.h> 00029 #include <tdelocale.h> 00030 #include <kservice.h> 00031 00032 class TDECModuleProxy; 00033 class TDECModuleInfo; 00034 00043 class TDEUTILS_EXPORT KCMultiDialog : public KDialogBase 00044 { 00045 Q_OBJECT 00046 00047 public: 00055 KCMultiDialog( TQWidget *parent=0, const char *name=0, bool modal=false ); 00056 00070 KCMultiDialog( int dialogFace, const TQString & caption, TQWidget * 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 TQString &caption=i18n("Configure"), TQWidget *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 00124 void addModule(const TQString& module, bool withfallback=true, TQStringList args = TQStringList()); 00125 00143 void addModule(const TDECModuleInfo& moduleinfo, TQStringList 00144 parentmodulenames = TQStringList(), bool withfallback=false, TQStringList args = TQStringList()); 00145 00149 void removeAllModules(); 00150 00155 void show(); 00156 00157 signals: 00164 void configCommitted(); 00165 00181 void configCommitted( const TQCString & instanceName ); 00182 00183 protected slots: 00190 virtual void slotDefault(); 00191 00198 virtual void slotUser1(); 00199 00206 virtual void slotApply(); 00207 00214 virtual void slotOk(); 00215 00226 virtual void slotHelp(); 00227 00228 private slots: 00229 00230 void slotAboutToShow(TQWidget *); 00231 00232 void clientChanged(bool state); 00233 00241 void disableRModeButton(); 00242 00249 void rootExit(); 00250 00259 void dialogClosed(); 00260 00261 private: 00262 00263 void init(); 00264 void apply(); 00265 00266 struct CreatedModule 00267 { 00268 TDECModuleProxy * kcm; 00269 KService::Ptr service; 00270 /* KDE 4 Move to Private class */ 00271 }; 00272 typedef TQValueList<CreatedModule> ModuleList; 00273 ModuleList m_modules; 00274 00275 typedef TQMap<KService::Ptr, TDECModuleProxy*> OrphanMap; 00276 OrphanMap m_orphanModules; 00277 00278 TQPtrDict<TQStringList> moduleParentComponents; 00279 TQString _docPath; 00280 int dialogface; 00281 00282 class KCMultiDialogPrivate; 00283 KCMultiDialogPrivate *d; 00284 }; 00285 00286 #endif //KCMULTIDIALOG_H 00287 00288 // vim: sw=4 sts=4 et