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 TQWidget; 00028 class KLibLoader; 00029 00045 class KUTILS_EXPORT KCModuleLoader 00046 { 00047 public: 00048 00063 static KCModule *loadModule(const KCModuleInfo &module, bool withFallback=true, 00064 TQWidget * parent = 0, const char * name = 0, 00065 const TQStringList & args = TQStringList() ) KDE_DEPRECATED; 00066 00078 static KCModule *loadModule(const TQString &module, TQWidget *parent = 0, 00079 const char *name = 0, const TQStringList & args = TQStringList()) KDE_DEPRECATED; 00080 00084 enum ErrorReporting { 00088 None = 0, 00093 Inline = 1, 00097 Dialog = 2, 00101 Both = 3 00102 }; 00103 00117 static KCModule *loadModule(const KCModuleInfo &module, ErrorReporting 00118 report, bool withFallback=true, TQWidget * parent = 0, 00119 const char * name = 0, const TQStringList & args = TQStringList() ); 00120 00133 static KCModule *loadModule(const TQString &module, ErrorReporting 00134 report, TQWidget *parent = 0, const char *name = 0, 00135 const TQStringList & args = TQStringList()); 00136 00141 static void unloadModule(const KCModuleInfo &mod); 00142 00150 static void showLastLoaderError(TQWidget *parent) KDE_DEPRECATED; 00151 00152 00181 static bool testModule( const TQString& module ); 00182 00190 static bool testModule( const KCModuleInfo& module ); 00191 00203 static KCModule* reportError( ErrorReporting report, const TQString & text, 00204 TQString details, TQWidget * parent ); 00205 00206 private: 00207 00212 static KCModule* load(const KCModuleInfo &mod, const TQString &libname, 00213 KLibLoader *loader, ErrorReporting report, TQWidget * parent = 0, 00214 const char * name = 0, const TQStringList & args = TQStringList() ); 00215 00216 }; 00217 00218 // vim: ts=2 sw=2 et 00219 #endif // MODLOADER_H 00220