kdecore Library API Documentation

KInstance Class Reference

Access to KDE global objects for use in shared libraries. More...

#include <kinstance.h>

Inheritance diagram for KInstance:

KApplication KUniqueApplication List of all members.

Public Member Functions

 KInstance (const QCString &instanceName)
 KInstance (const KAboutData *aboutData)
 KInstance (KInstance *src)
virtual ~KInstance ()
KStandardDirsdirs () const
KConfigconfig () const
KSharedConfig * sharedConfig () const
KIconLoadericonLoader () const
void newIconLoader () const
const KAboutDataaboutData () const
QCString instanceName () const
KMimeSourceFactorymimeSourceFactory () const

Protected Member Functions

 KInstance (const KInstance &)
void setConfigName (const QString &name)
virtual void virtual_hook (int id, void *data)

Detailed Description

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
Version:
Id
kinstance.h,v 1.29 2003/09/24 13:05:09 waba Exp

Definition at line 44 of file kinstance.h.


Constructor & Destructor Documentation

KInstance::KInstance const QCString instanceName  ) 
 

Constructor.

Parameters:
instanceName the name of the instance

Definition at line 69 of file kinstance.cpp.

References KInstance().

Referenced by KInstance().

KInstance::KInstance const 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)

Definition at line 87 of file kinstance.cpp.

References QCString::isEmpty(), and KInstance().

KInstance::~KInstance  )  [virtual]
 

Destructor.

Definition at line 132 of file kinstance.cpp.

KInstance::KInstance const KInstance  )  [protected]
 

Copy Constructor is not allowed.


Member Function Documentation

KStandardDirs * KInstance::dirs  )  const
 

Returns the application standard dirs object.

Returns:
The KStandardDirs of the application.

Definition at line 159 of file kinstance.cpp.

References KConfig::reparseConfiguration().

Referenced by KGlobal::dirs(), KLibLoader::findLibrary(), iconLoader(), KStandardDirs::locate(), KStandardDirs::locateLocal(), and newIconLoader().

KConfig * KInstance::config  )  const
 

Returns the general config object ("appnamerc").

Returns:
the KConfig object for the instance.

Definition at line 175 of file kinstance.cpp.

References KStandardDirs::addCustomized(), and QCString::isEmpty().

Referenced by KGlobal::config(), KCmdLineArgs::enable_i18n(), KNotifyClient::Instance::Instance(), KApplication::invokeMailer(), KLocale::KLocale(), and sharedConfig().

KSharedConfig * KInstance::sharedConfig  )  const
 

Returns the general config object ("appnamerc").

Returns:
the KConfig object for the instance.

Definition at line 222 of file kinstance.cpp.

References config().

Referenced by KGlobal::sharedConfig().

KIconLoader * KInstance::iconLoader  )  const
 

Returns an iconloader object.

Returns:
the iconloader object.

Definition at line 237 of file kinstance.cpp.

References dirs().

Referenced by KIconLoader::BarIcon(), KIconLoader::BarIconSet(), KIconLoader::DesktopIcon(), KIconLoader::DesktopIconSet(), KWin::icon(), KGlobal::iconLoader(), KIconLoader::IconSize(), KIconLoader::MainBarIcon(), KIconLoader::MainBarIconSet(), mimeSourceFactory(), KIconLoader::SmallIcon(), KIconLoader::SmallIconSet(), KIconLoader::UserIcon(), and KIconLoader::UserIconSet().

void KInstance::newIconLoader  )  const
 

Re-allocate the global iconloader.

Definition at line 248 of file kinstance.cpp.

References dirs(), KIconLoader::reconfigure(), and KIconTheme::reconfigure().

const KAboutData * KInstance::aboutData  )  const
 

Returns the about data of this instance Warning, can be 0L.

Returns:
the about data of the instance, or 0 if it has not been set yet

Definition at line 255 of file kinstance.cpp.

Referenced by KApplication::caption(), and KCrash::defaultCrashHandler().

QCString KInstance::instanceName  )  const
 

Returns the name of the instance.

Returns:
the instance name, can be null if the KInstance has been created with a null name

Definition at line 261 of file kinstance.cpp.

Referenced by KConfigBackEnd::checkConfigFilesWritable(), KApplication::icon(), KApplication::iconName(), KApplication::KApplication(), KApplication::miniIcon(), and KApplication::miniIconName().

KMimeSourceFactory * KInstance::mimeSourceFactory  )  const
 

Returns the KMimeSourceFactory of the instance.

Mainly added for API completeness and future extensibility.

Returns:
the KMimeSourceFactory set as default for this application.

Definition at line 267 of file kinstance.cpp.

References iconLoader().

void KInstance::setConfigName const QString name  )  [protected]
 

Set name of default config file.

Parameters:
name the name of the default config file
Since:
3.1

Definition at line 231 of file kinstance.cpp.

References setConfigName().

Referenced by setConfigName().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 20 09:48:30 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003