org.kde.koala
Class KGlobal

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

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

Access to the KDE global objects. KGlobal provides you with pointers of many central objects that exist only once in the process. It is also responsible for managing instances of KStaticDeleterBase.

Author:
Sirtaj Singh Kang (taj@kde.org)
See Also:
KStaticDeleterBase

Constructor Summary
  KGlobal()
           
protected KGlobal(java.lang.Class dummy)
           
 
Method Summary
static KInstanceInterface activeInstance()
           
static KCharsets charsets()
          The global charset manager.
static KConfig config()
          Returns the general config object.
static void deleteStaticDeleters()
          Calls KStaticDeleterBase.destructObject() on all registered static deleters and unregisters them all.
static KStandardDirs dirs()
          Returns the application standard dirs object.
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
static KIconLoader iconLoader()
          Returns an iconloader object.
static KInstanceInterface instance()
          Returns the global instance.
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
static KLocale locale()
          Returns the global locale object.
static void registerStaticDeleter(KStaticDeleterBase d)
          Registers a static deleter.
static void setActiveInstance(KInstanceInterface d)
          The instance currently active (useful in a multi-instance application, such as a KParts application).
static KSharedConfig sharedConfig()
          Returns the general config object.
static java.lang.String staticQString(java.lang.String str)
          Creates a static String.
static void unregisterStaticDeleter(KStaticDeleterBase d)
          Unregisters a static deleter.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KGlobal

protected KGlobal(java.lang.Class dummy)

KGlobal

public KGlobal()
Method Detail

instance

public static KInstanceInterface instance()
Returns the global instance. There is always at least one instance of a component in one application (in most cases the application itself).

Returns:
the global instance

dirs

public static KStandardDirs dirs()
Returns the application standard dirs object.

Returns:
the global standard dir object

config

public static KConfig config()
Returns the general config object.

Returns:
the global configuration object.

sharedConfig

public static KSharedConfig sharedConfig()
Returns the general config object.

Returns:
the global configuration object.

iconLoader

public static KIconLoader iconLoader()
Returns an iconloader object.

Returns:
the global iconloader object

locale

public static KLocale locale()
Returns the global locale object.

Returns:
the global locale object

charsets

public static KCharsets charsets()
The global charset manager.

Returns:
the global charset manager

staticQString

public static java.lang.String staticQString(java.lang.String str)
Creates a static String. To be used inside functions(!) like:
                 static StringmyString = KGlobal.staticString("myText");
                 
!!! Do _NOT_ use: !!!
                 static String myString = KGlobal.staticString("myText");
                 
This creates a static object (instead of a static reference) and as you know static objects are EVIL.

Parameters:
str - the string to create
Returns:
the static string

registerStaticDeleter

public static void registerStaticDeleter(KStaticDeleterBase d)
Registers a static deleter.

Parameters:
d - the static deleter to register
See Also:
KStaticDeleterBase, KStaticDeleter

unregisterStaticDeleter

public static void unregisterStaticDeleter(KStaticDeleterBase d)
Unregisters a static deleter.

Parameters:
d - the static deleter to unregister
See Also:
KStaticDeleterBase, KStaticDeleter

deleteStaticDeleters

public static void deleteStaticDeleters()
Calls KStaticDeleterBase.destructObject() on all registered static deleters and unregisters them all.

See Also:
KStaticDeleterBase, KStaticDeleter

setActiveInstance

public static void setActiveInstance(KInstanceInterface d)
The instance currently active (useful in a multi-instance application, such as a KParts application). Don't use this - it's mainly for KAboutDialog and KBugReport.


activeInstance

public static KInstanceInterface activeInstance()

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?