• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeutils
 

tdeutils

Public Types | Static Public Member Functions | List of all members
TDECModuleLoader Class Reference
KControl module classes

#include <tdecmoduleloader.h>

Public Types

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

Static Public Member Functions

static TDECModule * loadModule (const TDECModuleInfo &module, bool withFallback=true, TQWidget *parent=0, const char *name=0, const TQStringList &args=TQStringList()) TDE_DEPRECATED
 
static TDECModule * loadModule (const TQString &module, TQWidget *parent=0, const char *name=0, const TQStringList &args=TQStringList()) TDE_DEPRECATED
 
static TDECModule * loadModule (const TDECModuleInfo &module, ErrorReporting report, bool withFallback=true, TQWidget *parent=0, const char *name=0, const TQStringList &args=TQStringList())
 
static TDECModule * loadModule (const TQString &module, ErrorReporting report, TQWidget *parent=0, const char *name=0, const TQStringList &args=TQStringList())
 
static void unloadModule (const TDECModuleInfo &mod)
 
static void showLastLoaderError (TQWidget *parent) TDE_DEPRECATED
 
static bool testModule (const TQString &module)
 
static bool testModule (const TDECModuleInfo &module)
 
static TDECModule * reportError (ErrorReporting report, const TQString &text, TQString details, TQWidget *parent)
 

Detailed Description

Loads a KControl Module.

TDECModuleLoader tries in several ways to locate and load a TDECModule. If loading fails a zero pointer is returned.
It is very unlikely TDECModuleLoader is what you want and TDECModuleProxy suits your needs.

Author
Matthias Hoelzer-Kluepfel mhk@k.nosp@m.de.o.nosp@m.rg
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.teli.nosp@m.a.com
Since
3.2

Definition at line 45 of file tdecmoduleloader.h.

Member Enumeration Documentation

◆ ErrorReporting

enum TDECModuleLoader::ErrorReporting

Determines the way errors are reported.

Enumerator
None 

no error reporting is done

Inline 

the error report is shown instead of the TDECModule that should have * been loaded

Dialog 

shows a dialog with the error report

Both 

does both Inline and Dialog

Definition at line 84 of file tdecmoduleloader.h.

Member Function Documentation

◆ loadModule() [1/4]

TDECModule * TDECModuleLoader::loadModule ( const TDECModuleInfo &  module,
bool  withFallback = true,
TQWidget *  parent = 0,
const char *  name = 0,
const TQStringList &  args = TQStringList() 
)
static

Loads a TDECModule.

If loading fails a zero pointer is returned.

Parameters
modulewhat module to load
withFallbackif true and loading failed a separate window with the module may appear and a zero pointer is a returned
parentThe parent widget
nameThe widget's name
argsA list of arguments for the module to load
Returns
a pointer to the loaded TDECModule
Deprecated:
use the function which explicitly states the error reporting method

Definition at line 116 of file tdecmoduleloader.cpp.

◆ loadModule() [2/4]

TDECModule * TDECModuleLoader::loadModule ( const TDECModuleInfo &  module,
ErrorReporting  report,
bool  withFallback = true,
TQWidget *  parent = 0,
const char *  name = 0,
const TQStringList &  args = TQStringList() 
)
static

Loads a TDECModule.

If loading fails a zero pointer is returned.

Parameters
modulewhat module to load
reportsee ErrorReporting
withFallbackif true and loading failed a separate window with the module may appear and a zero pointer is a returned
parentThe parent widget
nameThe widget's name
argsA list of arguments for the module to load
Returns
a pointer to the loaded TDECModule
Since
3.4

Definition at line 121 of file tdecmoduleloader.cpp.

◆ loadModule() [3/4]

TDECModule * TDECModuleLoader::loadModule ( const TQString &  module,
ErrorReporting  report,
TQWidget *  parent = 0,
const char *  name = 0,
const TQStringList &  args = TQStringList() 
)
static

Loads a TDECModule.

If loading fails a zero pointer is returned.

Parameters
modulewhat module to load
reportsee ErrorReporting with the module may appear and a zero pointer is a returned
parentThe parent widget
nameThe widget's name
argsA list of arguments for the module to load
Returns
a pointer to the loaded TDECModule
Since
3.4

Definition at line 198 of file tdecmoduleloader.cpp.

◆ loadModule() [4/4]

TDECModule * TDECModuleLoader::loadModule ( const TQString &  module,
TQWidget *  parent = 0,
const char *  name = 0,
const TQStringList &  args = TQStringList() 
)
static

Loads a TDECModule.

If loading fails a zero pointer is returned.

Parameters
modulewhat module to load with the module may appear and a zero pointer is a returned
parentThe parent widget
nameThe widget's name
argsA list of arguments for the module to load
Deprecated:
use the function which explicitly states the error reporting method

Definition at line 192 of file tdecmoduleloader.cpp.

◆ reportError()

TDECModule * TDECModuleLoader::reportError ( ErrorReporting  report,
const TQString &  text,
TQString  details,
TQWidget *  parent 
)
static

Returns a TDECModule containing the messages report and text.

Parameters
reportthe type of error reporting, see ErrorReporting
textthe main message
detailsany additional details
parentThe parent widget
Since
3.4

Definition at line 284 of file tdecmoduleloader.cpp.

◆ showLastLoaderError()

void TDECModuleLoader::showLastLoaderError ( TQWidget *  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 217 of file tdecmoduleloader.cpp.

◆ testModule() [1/2]

bool TDECModuleLoader::testModule ( const TDECModuleInfo &  module)
static

Convenience function, essentially the same as above.

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

If something fails we return true - we can't risk functionality becoming unavailable because of a buggy test. Furthermore, the error needs to show so it is discovered. TDECModuleProxy will detect the error and load a corresponding KCMError.

Definition at line 235 of file tdecmoduleloader.cpp.

◆ testModule() [2/2]

bool TDECModuleLoader::testModule ( const TQString &  module)
static

Checks whether an TDECModule 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-TDE-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
modulethe module to check
Returns
true if the module should be loaded
Since
3.4

Definition at line 230 of file tdecmoduleloader.cpp.

◆ unloadModule()

void TDECModuleLoader::unloadModule ( const TDECModuleInfo &  mod)
static

Unloads the module's library.

Parameters
modWhat module to unload for

Definition at line 204 of file tdecmoduleloader.cpp.


The documentation for this class was generated from the following files:
  • tdecmoduleloader.h
  • tdecmoduleloader.cpp

tdeutils

Skip menu "tdeutils"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeutils

Skip menu "tdeutils"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeutils by doxygen 1.9.4
This website is maintained by Timothy Pearson.