kcmoduleloader.h

00001 /*
00002   Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
00003   Copyright (c) 2002-2003 Daniel Molkentin <molkentin@kde.org>
00004   
00005   This file is part of the KDE project
00006   
00007   This library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Library General Public
00009   License version 2, as published by the Free Software Foundation.
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 MODLOADER_H
00022 #define MODLOADER_H
00023 
00024 #include <kcmodule.h>
00025 #include <kcmoduleinfo.h>
00026 
00027 class QWidget;
00028 class KLibLoader;
00029 
00044 class KUTILS_EXPORT KCModuleLoader
00045 {
00046   public:
00047 
00059     static KCModule *loadModule(const KCModuleInfo &module, bool withFallback=true, 
00060         QWidget * parent = 0, const char * name = 0,
00061         const QStringList & args = QStringList() ) KDE_DEPRECATED;
00062 
00071     static KCModule *loadModule(const QString &module, QWidget *parent = 0,
00072         const char *name = 0, const QStringList & args = QStringList()) KDE_DEPRECATED;
00073 
00077     enum ErrorReporting {
00081       None = 0,
00086       Inline = 1,
00090       Dialog = 2,
00094       Both = 3
00095     };
00096 
00107     static KCModule *loadModule(const KCModuleInfo &module, ErrorReporting
00108         report, bool withFallback=true, QWidget * parent = 0,
00109         const char * name = 0, const QStringList & args = QStringList() );
00110 
00120     static KCModule *loadModule(const QString &module, ErrorReporting
00121         report, QWidget *parent = 0, const char *name = 0,
00122         const QStringList & args = QStringList());
00123 
00128     static void unloadModule(const KCModuleInfo &mod);
00129 
00137     static void showLastLoaderError(QWidget *parent) KDE_DEPRECATED;
00138 
00139 
00168     static bool testModule( const QString& module );
00169 
00177     static bool testModule( const KCModuleInfo& module );
00178 
00189     static KCModule* reportError( ErrorReporting report, const QString & text,
00190         QString details, QWidget * parent );
00191 
00192   private:
00193 
00198     static KCModule* load(const KCModuleInfo &mod, const QString &libname, 
00199         KLibLoader *loader, ErrorReporting report, QWidget * parent = 0,
00200         const char * name = 0, const QStringList & args = QStringList() );
00201 
00202 };
00203 
00204 // vim: ts=2 sw=2 et
00205 #endif // MODLOADER_H
00206 
KDE Home | KDE Accessibility Home | Description of Access Keys