org.kde.koala
Class KCModuleLoader

java.lang.Object
  extended by org.kde.koala.KCModuleLoader
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KCModuleLoader
extends java.lang.Object
implements org.kde.qt.QtSupport

Author:
Frans Englich

Field Summary
static int Both
           
static int Dialog
           
static int Inline
           
static int None
          Determines the way errors are reported
 
Constructor Summary
  KCModuleLoader()
           
protected KCModuleLoader(java.lang.Class dummy)
           
 
Method Summary
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
static KCModule loadModule(KCModuleInfo module, int report)
           
static KCModule loadModule(KCModuleInfo module, int report, boolean withFallback)
           
static KCModule loadModule(KCModuleInfo module, int report, boolean withFallback, org.kde.qt.QWidget parent)
           
static KCModule loadModule(KCModuleInfo module, int report, boolean withFallback, org.kde.qt.QWidget parent, java.lang.String name)
           
static KCModule loadModule(KCModuleInfo module, int report, boolean withFallback, org.kde.qt.QWidget parent, java.lang.String name, java.lang.String[] args)
          Loads a KCModule.
static KCModule loadModule(java.lang.String module, int report)
           
static KCModule loadModule(java.lang.String module, int report, org.kde.qt.QWidget parent)
           
static KCModule loadModule(java.lang.String module, int report, org.kde.qt.QWidget parent, java.lang.String name)
           
static KCModule loadModule(java.lang.String module, int report, org.kde.qt.QWidget parent, java.lang.String name, java.lang.String[] args)
          Loads a KCModule.
static KCModule reportError(int report, java.lang.String text, java.lang.String details, org.kde.qt.QWidget parent)
          Returns a KCModule containing the messages report and text.
static boolean testModule(KCModuleInfo module)
          Convenience function, essentially the same as above.
static boolean testModule(java.lang.String module)
          Checks whether an KCModule should be shown by running its test function.
static void unloadModule(KCModuleInfo mod)
          Unloads the module's library
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

None

public static final int None
Determines the way errors are reported

See Also:
Constant Field Values

Inline

public static final int Inline
See Also:
Constant Field Values

Dialog

public static final int Dialog
See Also:
Constant Field Values

Both

public static final int Both
See Also:
Constant Field Values
Constructor Detail

KCModuleLoader

protected KCModuleLoader(java.lang.Class dummy)

KCModuleLoader

public KCModuleLoader()
Method Detail

loadModule

public static KCModule loadModule(KCModuleInfo module,
                                  int report,
                                  boolean withFallback,
                                  org.kde.qt.QWidget parent,
                                  java.lang.String name,
                                  java.lang.String[] args)
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 @ref KCModule

loadModule

public static KCModule loadModule(KCModuleInfo module,
                                  int report,
                                  boolean withFallback,
                                  org.kde.qt.QWidget parent,
                                  java.lang.String name)

loadModule

public static KCModule loadModule(KCModuleInfo module,
                                  int report,
                                  boolean withFallback,
                                  org.kde.qt.QWidget parent)

loadModule

public static KCModule loadModule(KCModuleInfo module,
                                  int report,
                                  boolean withFallback)

loadModule

public static KCModule loadModule(KCModuleInfo module,
                                  int report)

loadModule

public static KCModule loadModule(java.lang.String module,
                                  int report,
                                  org.kde.qt.QWidget parent,
                                  java.lang.String name,
                                  java.lang.String[] args)
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 @ref KCModule

loadModule

public static KCModule loadModule(java.lang.String module,
                                  int report,
                                  org.kde.qt.QWidget parent,
                                  java.lang.String name)

loadModule

public static KCModule loadModule(java.lang.String module,
                                  int report,
                                  org.kde.qt.QWidget parent)

loadModule

public static KCModule loadModule(java.lang.String module,
                                  int report)

unloadModule

public static void unloadModule(KCModuleInfo mod)
Unloads the module's library

Parameters:
mod - What module to unload for

testModule

public static boolean testModule(java.lang.String module)
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"
                 {
                    boolean 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

testModule

public static boolean testModule(KCModuleInfo module)
Convenience function, essentially the same as above.

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

reportError

public static KCModule reportError(int report,
                                   java.lang.String text,
                                   java.lang.String details,
                                   org.kde.qt.QWidget parent)
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

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()


isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?