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

KDECore

Public Types | Public Member Functions | Protected Member Functions | List of all members
KComponentData Class Reference

#include <kcomponentdata.h>

Public Types

enum  MainComponentRegistration { RegisterAsMainComponent, SkipMainComponentRegistration }
 

Public Member Functions

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

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.nosp@m.@kde.nosp@m..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
componentNamethe name of the component.
catalogNamethe name of the translation catalog; if left empty componentName is used
registerAsMainwhether 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
aboutDatadata about this component
registerAsMainwhether 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 215 of file kcomponentdata.cpp.

QString KComponentData::catalogName ( ) const

Returns the name of the translation catalog.

Returns
The catalog name.

Definition at line 232 of file kcomponentdata.cpp.

QString KComponentData::componentName ( ) const

Returns the name of the component.

Returns
The component name.

Definition at line 226 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 201 of file kcomponentdata.cpp.

KStandardDirs * KComponentData::dirs ( ) const

Returns the application standard dirs object.

Returns
The KStandardDirs of the application.

Definition at line 193 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::setAboutData ( const KAboutData &  aboutData)

Sets the about data of this component.

Since
4.5

Definition at line 221 of file kcomponentdata.cpp.

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

Set name of default config file.

Parameters
namethe name of the default config file

Definition at line 209 of file kcomponentdata.cpp.

void KComponentData::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Standard trick to add virtuals later.

Definition at line 238 of file kcomponentdata.cpp.


The documentation for this class was generated from the following files:
  • kcomponentdata.h
  • kcomponentdata.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal