• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

KComponentData Class Reference

Per component data. More...

#include <kcomponentdata.h>

List of all members.

Public Types

enum  MainComponentRegistration { RegisterAsMainComponent, SkipMainComponentRegistration }

Public Member Functions

const KAboutData * aboutData () const
QString catalogName () const
QString componentName () const
const KSharedConfig::Ptr & config () const
KStandardDirs * dirs () const
bool isValid () const
 KComponentData (const KAboutData *aboutData, MainComponentRegistration registerAsMain=RegisterAsMainComponent)
 KComponentData (const KAboutData &aboutData, MainComponentRegistration registerAsMain=RegisterAsMainComponent)
 KComponentData (const QByteArray &componentName, const QByteArray &catalogName=QByteArray(), MainComponentRegistration registerAsMain=RegisterAsMainComponent)
 KComponentData (const KComponentData &)
 KComponentData ()
bool operator!= (const KComponentData &rhs) const
KComponentData & operator= (const KComponentData &)
bool operator== (const KComponentData &) const
virtual ~KComponentData ()

Protected Member Functions

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

Detailed Description

Per component data.

This class holds a KAboutData object or only a component name, a KStandardDirs object and a KSharedConfig object. Those objects normally are different per component but the same per instance of one component.

The application component data can always be accessed using KGlobal::mainComponent() (or the convenience function KGlobal::dirs() and KGlobal::config()) while the component data of the currently active component (mainly used for KParts) can be accessed using KGlobal::activeComponent().

Author:
Torben Weis
Matthias Kretz <kretz@kde.org>

Definition at line 46 of file kcomponentdata.h.


Member Enumeration Documentation

enum KComponentData::MainComponentRegistration
Enumerator:
RegisterAsMainComponent 
SkipMainComponentRegistration 

Definition at line 84 of file kcomponentdata.h.


Constructor & Destructor Documentation

KComponentData::KComponentData (  ) 

Creates an invalid KComponentData object.

See also:
isValid()

Definition at line 36 of file kcomponentdata.cpp.

KComponentData::KComponentData ( const KComponentData &  rhs  ) 

Copy constructor.

It does not copy the data. The data is shared between the old and new objects.

Definition at line 41 of file kcomponentdata.cpp.

KComponentData::KComponentData ( const QByteArray &  componentName,
const QByteArray &  catalogName = QByteArray(),
MainComponentRegistration  registerAsMain = RegisterAsMainComponent 
) [explicit]

Constructor.

Parameters:
componentName the name of the component.
catalogName the name of the translation catalog; if left empty componentName is used
registerAsMain whether to register the component as the main component of the application. This has no effect, if the application already has a main component.
See also:
KGlobal::mainComponent

Definition at line 75 of file kcomponentdata.cpp.

KComponentData::KComponentData ( const KAboutData &  aboutData,
MainComponentRegistration  registerAsMain = RegisterAsMainComponent 
) [explicit]

Constructor.

A copy of the aboutData object is made.

Parameters:
aboutData data about this component
registerAsMain whether to register the component as the main component of the application. This has no effect, if the application already has a main component.
See also:
KGlobal::mainComponent
KAboutData

Definition at line 105 of file kcomponentdata.cpp.

KComponentData::KComponentData ( const KAboutData *  aboutData,
MainComponentRegistration  registerAsMain = RegisterAsMainComponent 
) [explicit]

Definition at line 90 of file kcomponentdata.cpp.

KComponentData::~KComponentData (  )  [virtual]

Destructor.

Definition at line 120 of file kcomponentdata.cpp.


Member Function Documentation

const KAboutData * KComponentData::aboutData (  )  const

Returns the about data of this component.

Returns:
The about data of the component. If none has been set in the constructor but a component name was set, a default constructed KAboutData object is returned.

Definition at line 211 of file kcomponentdata.cpp.

QString KComponentData::catalogName (  )  const

Returns the name of the translation catalog.

Returns:
The catalog name.

Definition at line 223 of file kcomponentdata.cpp.

QString KComponentData::componentName (  )  const

Returns the name of the component.

Returns:
The component name.

Definition at line 217 of file kcomponentdata.cpp.

const KSharedConfig::Ptr & KComponentData::config (  )  const

Returns the general config object ("appnamerc").

Returns:
the KConfig object for the component.

Definition at line 197 of file kcomponentdata.cpp.

KStandardDirs * KComponentData::dirs (  )  const

Returns the application standard dirs object.

Returns:
The KStandardDirs of the application.

Definition at line 189 of file kcomponentdata.cpp.

bool KComponentData::isValid (  )  const

Returns whether this is a valid object.

Don't call any functions on invalid objects, that will crash. Assignment (and of course destruction) is the only valid operation you may do.

Definition at line 128 of file kcomponentdata.cpp.

bool KComponentData::operator!= ( const KComponentData &  rhs  )  const [inline]

Returns whether two KComponentData objects do not reference the same data.

Definition at line 82 of file kcomponentdata.h.

KComponentData & KComponentData::operator= ( const KComponentData &  rhs  ) 

Assignment operator.

It does not copy the data. The data is shared between the old and new objects.

If the data of the left hand side object was only referenced from this object and no referenced KSharedConfig object needs it anymore, it is deleted

Definition at line 49 of file kcomponentdata.cpp.

bool KComponentData::operator== ( const KComponentData &  rhs  )  const

Returns whether two KComponentData objects reference the same data.

Definition at line 63 of file kcomponentdata.cpp.

void KComponentData::setConfigName ( const QString &  name  )  [protected]

Set name of default config file.

Parameters:
name the name of the default config file

Definition at line 205 of file kcomponentdata.cpp.

void KComponentData::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Standard trick to add virtuals later.

For internal use only.

Definition at line 229 of file kcomponentdata.cpp.


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

KDECore

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal