org.kde.koala
Class KInstance

java.lang.Object
  extended by org.kde.koala.KInstance
All Implemented Interfaces:
KInstanceInterface, org.kde.qt.QtSupport

public class KInstance
extends java.lang.Object
implements org.kde.qt.QtSupport, KInstanceInterface

Access to KDE global objects for use in shared libraries. In practical terms, this class is used in KDE components. This allows components to store things that normally would be accessed by KGlobal.

Author:
Torben Weis

Constructor Summary
protected KInstance(java.lang.Class dummy)
           
  KInstance(KAboutData aboutData)
          Constructor.
  KInstance(KInstanceInterface src)
           
  KInstance(java.lang.String instanceName)
          Constructor.
 
Method Summary
 KAboutData aboutData()
          Returns the about data of this instance Warning, can be null
 KConfig config()
          Returns the general config object ("appnamerc").
 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
 KIconLoader iconLoader()
          Returns an iconloader object.
 java.lang.String instanceName()
          Returns the name of the instance
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 KMimeSourceFactory mimeSourceFactory()
          Returns the KMimeSourceFactory of the instance.
 void newIconLoader()
          Re-allocate the global iconloader.
protected  void setConfigName(java.lang.String name)
          Set name of default config file.
 KSharedConfig sharedConfig()
          Returns the general config object ("appnamerc").
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KInstance

protected KInstance(java.lang.Class dummy)

KInstance

public KInstance(java.lang.String instanceName)
Constructor.

Parameters:
instanceName - the name of the instance

KInstance

public KInstance(KAboutData aboutData)
Constructor. When building a KInstance that is not your KApplication, make sure that the KAboutData and the KInstance have the same life time. You have to destroy both, since the instance doesn't own the about data. Don't build a KAboutData on the stack in this case ! Building a KAboutData on the stack is only ok for usage with KCmdLineArgs and KApplication (not destroyed until the app exits).

Parameters:
aboutData - data about this instance (see KAboutData)

KInstance

public KInstance(KInstanceInterface src)
Method Detail

dirs

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

Specified by:
dirs in interface KInstanceInterface
Returns:
The KStandardDirs of the application.

config

public KConfig config()
Returns the general config object ("appnamerc").

Specified by:
config in interface KInstanceInterface
Returns:
the KConfig object for the instance.

sharedConfig

public KSharedConfig sharedConfig()
Returns the general config object ("appnamerc").

Specified by:
sharedConfig in interface KInstanceInterface
Returns:
the KConfig object for the instance.

iconLoader

public KIconLoader iconLoader()
Returns an iconloader object.

Specified by:
iconLoader in interface KInstanceInterface
Returns:
the iconloader object.

newIconLoader

public void newIconLoader()
Re-allocate the global iconloader.

Specified by:
newIconLoader in interface KInstanceInterface

aboutData

public KAboutData aboutData()
Returns the about data of this instance Warning, can be null

Specified by:
aboutData in interface KInstanceInterface
Returns:
the about data of the instance, or 0 if it has not been set yet

instanceName

public java.lang.String instanceName()
Returns the name of the instance

Specified by:
instanceName in interface KInstanceInterface
Returns:
the instance name, can be null if the KInstance has been created with a null name

mimeSourceFactory

public KMimeSourceFactory mimeSourceFactory()
Returns the KMimeSourceFactory of the instance. Mainly added for API completeness and future extensibility.

Specified by:
mimeSourceFactory in interface KInstanceInterface
Returns:
the KMimeSourceFactory set as default for this application.

setConfigName

protected void setConfigName(java.lang.String name)
Set name of default config file.

Parameters:
name - the name of the default config file

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?