kcmoduleproxy.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2003 Matthias Kretz <kretz@kde.org> 00003 Copyright (C) 2004 Frans Englich <frans.englich@telia.com> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 00019 */ 00020 00021 #ifndef KCMODULEPROXY_H 00022 #define KCMODULEPROXY_H 00023 00024 #include <tqwidget.h> 00025 #include <tqstringlist.h> 00026 00027 #include <kservice.h> 00028 #include <kdelibs_export.h> 00029 00030 class KAboutData; 00031 class KCModule; 00032 class KCModuleInfo; 00033 class KInstance; 00034 class KProcess; 00035 00068 class KUTILS_EXPORT KCModuleProxy : public TQWidget 00069 { 00070 Q_OBJECT 00071 TQ_OBJECT 00072 00073 friend class KCModuleProxyRootCommunicatorImpl; 00074 00075 public: 00076 00090 KCModuleProxy( const KCModuleInfo & info, bool withFallback = true, 00091 TQWidget * parent = 0, const char * name = 0, 00092 const TQStringList & args = TQStringList() ); 00093 00109 KCModuleProxy( const TQString& serviceName, bool withFallback = true, 00110 TQWidget * parent = 0, const char * name = 0, 00111 const TQStringList & args = TQStringList() ); 00112 00126 KCModuleProxy( const KService::Ptr& service, bool withFallback = true, 00127 TQWidget * parent = 0, const char * name = 0, 00128 const TQStringList & args = TQStringList() ); 00129 00133 ~KCModuleProxy(); 00134 00139 void load(); 00140 00148 void save(); 00149 00153 TQString quickHelp() const; 00154 00158 const KAboutData * aboutData() const; 00159 00164 int buttons() const; 00165 00171 TQString rootOnlyMsg() const; 00172 //KDE4 remove. There's a limit for convenience functions, 00173 // this one's available via moduleInfo()-> and realModule()-> 00174 00179 bool useRootOnlyMsg() const; 00180 //KDE4 remove. There's a limit for convenience functions, 00181 // this one's available via moduleInfo()-> and realModule()-> 00182 00188 KInstance * instance() const; 00189 //KDE4 remove. There's a limit for convenience functions, 00190 // this one's available via realModule() 00191 00196 bool changed() const; 00197 00208 bool rootMode() const; 00209 00218 KCModule* realModule() const; 00219 00224 const KCModuleInfo& moduleInfo() const; 00225 00232 TQCString dcopName() const; 00233 00234 public slots: 00235 00242 void runAsRoot(); 00243 00248 void defaults(); 00249 00257 void deleteClient(); 00258 00259 signals: 00260 00261 /* 00262 * This signal is emitted when the contained module is changed. 00263 */ 00264 void changed( bool state ); 00265 00272 void changed( KCModuleProxy* mod ); 00273 00280 void childClosed(); 00281 00282 /* 00283 * This signal is relayed from the encapsulated module, and 00284 * is equivalent to the module's own quickHelpChanged() signal. 00285 * 00286 * @since 3.4 00287 */ 00288 void quickHelpChanged(); 00289 00290 protected: 00291 00296 void showEvent( TQShowEvent * ); 00297 00304 void init( const KCModuleInfo& info ); 00305 00306 00311 void emitQuickHelpChanged(); 00312 00313 private slots: 00314 00322 void callRootModule( const TQCString& function ); 00323 00330 void rootExited(); 00331 00335 void moduleChanged( bool ); 00336 00340 void moduleDestroyed(); 00341 00349 void applicationRemoved( const TQCString& app ); 00350 00351 private: 00352 00353 class KCModuleProxyPrivate; 00354 KCModuleProxyPrivate * d; 00355 }; 00356 00357 #endif // KCMODULEPROXY_H 00358 // vim: sw=4 ts=4 noet