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 <qwidget.h>
00025 #include <qstringlist.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 
00067 class KUTILS_EXPORT KCModuleProxy : public QWidget
00068 {
00069 Q_OBJECT
00070 
00071     friend class KCModuleProxyRootCommunicatorImpl;
00072 
00073 public:
00074 
00088     KCModuleProxy( const KCModuleInfo & info, bool withFallback = true,
00089             QWidget * parent = 0, const char * name = 0,
00090             const QStringList & args = QStringList() );
00091 
00107     KCModuleProxy( const QString& serviceName, bool withFallback = true,
00108             QWidget * parent = 0, const char * name = 0,
00109             const QStringList & args = QStringList() );
00110 
00124     KCModuleProxy( const KService::Ptr& service, bool withFallback = true,
00125             QWidget  * parent = 0, const char * name = 0,
00126             const QStringList & args = QStringList() );
00127 
00131     ~KCModuleProxy();
00132 
00137     void load();
00138 
00146     void save();
00147 
00151     QString quickHelp() const;
00152 
00156     const KAboutData * aboutData() const;
00157 
00162     int buttons() const;
00163 
00169     QString rootOnlyMsg() const;
00170     //KDE4 remove. There's a limit for convenience functions,
00171     // this one's available via moduleInfo()-> and realModule()->
00172 
00177     bool useRootOnlyMsg() const;
00178     //KDE4 remove. There's a limit for convenience functions,
00179     // this one's available via moduleInfo()-> and realModule()->
00180 
00186     KInstance * instance() const;
00187     //KDE4 remove. There's a limit for convenience functions,
00188     // this one's available via realModule()
00189 
00194     bool changed() const;
00195 
00206     bool rootMode() const;
00207 
00216     KCModule* realModule() const;
00217 
00222     const KCModuleInfo& moduleInfo() const;
00223 
00230     QCString dcopName() const;
00231 
00232 public slots:
00233 
00240     void runAsRoot();
00241 
00246     void defaults();
00247 
00255     void deleteClient();
00256 
00257 signals:
00258 
00259     /*
00260      * This signal is emitted when the contained module is changed.
00261      */
00262     void changed( bool state );
00263 
00270     void changed( KCModuleProxy* mod );
00271 
00278     void childClosed();
00279 
00280     /*
00281      * This signal is relayed from the encapsulated module, and
00282      * is equivalent to the module's own quickHelpChanged() signal.
00283      *
00284      * @since 3.4
00285      */
00286     void quickHelpChanged();
00287 
00288 protected:
00289 
00294     void showEvent( QShowEvent * );
00295 
00302     void init( const KCModuleInfo& info );
00303 
00304 
00309     void emitQuickHelpChanged();
00310 
00311 private slots:
00312 
00320     void callRootModule( const QCString& function );
00321 
00328     void rootExited();
00329 
00333     void moduleChanged( bool );
00334 
00338     void moduleDestroyed();
00339 
00347     void applicationRemoved( const QCString& app );
00348 
00349 private:
00350 
00351     class KCModuleProxyPrivate;
00352     KCModuleProxyPrivate * d;
00353 };
00354 
00355 #endif // KCMODULEPROXY_H
00356 // vim: sw=4 ts=4 noet
KDE Home | KDE Accessibility Home | Description of Access Keys