KCModuleLoader Class Reference

List of all members.

Detailed Description

Definition at line 44 of file kcmoduleloader.h.


Public Types

enum  ErrorReporting { None = 0, Inline = 1, Dialog = 2, Both = 3 }

Static Public Member Functions

static KCModuleloadModule (const KCModuleInfo &module, bool withFallback=true, QWidget *parent=0, const char *name=0, const QStringList &args=QStringList()) KDE_DEPRECATED
static KCModuleloadModule (const QString &module, QWidget *parent=0, const char *name=0, const QStringList &args=QStringList()) KDE_DEPRECATED
static KCModuleloadModule (const KCModuleInfo &module, ErrorReporting report, bool withFallback=true, QWidget *parent=0, const char *name=0, const QStringList &args=QStringList())
static KCModuleloadModule (const QString &module, ErrorReporting report, QWidget *parent=0, const char *name=0, const QStringList &args=QStringList())
static void unloadModule (const KCModuleInfo &mod)
static void showLastLoaderError (QWidget *parent) KDE_DEPRECATED
static bool testModule (const QString &module)
static bool testModule (const KCModuleInfo &module)
static KCModulereportError (ErrorReporting report, const QString &text, QString details, QWidget *parent)

Member Enumeration Documentation

enum KCModuleLoader::ErrorReporting
 

Determines the way errors are reported.

Enumerator:
None  no error reporting is done
Inline  the error report is shown instead of the KCModule that should have * been loaded
Dialog  shows a dialog with the error report
Both  does both Inline and Dialog

Definition at line 77 of file kcmoduleloader.h.


Member Function Documentation

KCModule * KCModuleLoader::loadModule const QString module,
ErrorReporting  report,
QWidget parent = 0,
const char *  name = 0,
const QStringList args = QStringList()
[static]
 

Loads a KCModule.

If loading fails a zero pointer is returned.

Parameters:
module what module to load
report see ErrorReporting with the module may appear and a zero pointer is a returned
Returns:
a pointer to the loaded KCModule
Since:
3.4

Definition at line 197 of file kcmoduleloader.cpp.

KCModule * KCModuleLoader::loadModule const KCModuleInfo module,
ErrorReporting  report,
bool  withFallback = true,
QWidget parent = 0,
const char *  name = 0,
const QStringList args = QStringList()
[static]
 

Loads a KCModule.

If loading fails a zero pointer is returned.

Parameters:
module what module to load
report see ErrorReporting
withFallback if true and loading failed a separate window with the module may appear and a zero pointer is a returned
Returns:
a pointer to the loaded KCModule
Since:
3.4

Definition at line 120 of file kcmoduleloader.cpp.

KCModule * KCModuleLoader::loadModule const QString module,
QWidget parent = 0,
const char *  name = 0,
const QStringList args = QStringList()
[static]
 

Loads a KCModule.

If loading fails a zero pointer is returned.

Parameters:
module what module to load with the module may appear and a zero pointer is a returned
Deprecated:
use the function which explicitly states the error reporting method

Definition at line 191 of file kcmoduleloader.cpp.

KCModule * KCModuleLoader::loadModule const KCModuleInfo module,
bool  withFallback = true,
QWidget parent = 0,
const char *  name = 0,
const QStringList args = QStringList()
[static]
 

Loads a KCModule.

If loading fails a zero pointer is returned.

Parameters:
module what module to load
withFallback if true and loading failed a separate window with the module may appear and a zero pointer is a returned
Returns:
a pointer to the loaded KCModule
Deprecated:
use the function which explicitly states the error reporting method

Definition at line 115 of file kcmoduleloader.cpp.

KCModule * KCModuleLoader::reportError ErrorReporting  report,
const QString text,
QString  details,
QWidget parent
[static]
 

Returns a KCModule containing the messages report and text.

Parameters:
report the type of error reporting, see ErrorReporting
text the main message
details any additional details
Since:
3.4

Definition at line 283 of file kcmoduleloader.cpp.

void KCModuleLoader::showLastLoaderError QWidget parent  )  [static]
 

Display a message box explaining an error occured and possible reasons to why.

Deprecated:
Use a constructor with ErrorReporting set to Dialog to show a message box like this function did.

Definition at line 216 of file kcmoduleloader.cpp.

bool KCModuleLoader::testModule const KCModuleInfo module  )  [static]
 

Convenience function, essentially the same as above.

Parameters:
module the module to check
Returns:
true if the module should be loaded
Since:
3.4

Definition at line 234 of file kcmoduleloader.cpp.

bool KCModuleLoader::testModule const QString module  )  [static]
 

Checks whether an KCModule should be shown by running its test function.

If it is unsure whether a module should be shown, it should be made available, leaving the decision to the user. If false is returned, the module should not be loaded in any interface.

A module declares it needs to be tested by having "X-KDE-Test-Module=true" in its desktop file. When that line exists, the following code must be available in the module's library:

 extern "C"
 {
    bool test_moduleName()
    {
      // Code testing for hardware/software presence.
      return true; // and the modue will be loaded.
    }

 }

where moduleName is the library name for the module.

Parameters:
module the module to check
Returns:
true if the module should be loaded
Since:
3.4

Definition at line 229 of file kcmoduleloader.cpp.

void KCModuleLoader::unloadModule const KCModuleInfo mod  )  [static]
 

Unloads the module's library.

Parameters:
mod What module to unload for

Definition at line 203 of file kcmoduleloader.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys