KDECore
#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().
Definition at line 46 of file kcomponentdata.h.
Member Enumeration Documentation
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.
|
explicit |
Constructor.
- Parameters
-
componentName the name of the component. catalogName the name of the translation catalog; if left empty componentName
is usedregisterAsMain 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.
|
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.
|
explicit |
Definition at line 90 of file kcomponentdata.cpp.
|
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.
|
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 | ) |
|
protected |
Set name of default config file.
- Parameters
-
name the name of the default config file
Definition at line 209 of file kcomponentdata.cpp.
|
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:
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.