kutils Library API Documentation

KCModuleInfo Class Reference

A class that provides information about a KCModule. More...

#include <kcmoduleinfo.h>

List of all members.

Public Member Functions

 KCModuleInfo (const QString &desktopFile)
 KCModuleInfo (KService::Ptr moduleInfo)
 KCModuleInfo (const KCModuleInfo &rhs)
 KCModuleInfo ()
KCModuleInfooperator= (const KCModuleInfo &rhs)
bool operator== (const KCModuleInfo &rhs) const
bool operator!= (const KCModuleInfo &rhs) const
 ~KCModuleInfo ()
QString fileName () const
const QStringListkeywords () const
QString factoryName () const
QString moduleName () const
KService::Ptr service () const
QString comment () const
QString icon () const
QString docPath () const
QString library () const
QString handle () const
int weight () const
bool needsRootPrivileges () const
bool isHiddenByDefault () const KDE_DEPRECATED
bool needsTest () const

Protected Member Functions

void setKeywords (const QStringList &keyword)
void setName (const QString &name)
void setComment (const QString &comment)
void setIcon (const QString &icon)
void setLibrary (const QString &lib)
void setHandle (const QString &handle)
void setWeight (int weight)
void setNeedsTest (bool val)
void setNeedsRootPrivileges (bool needsRootPrivileges)
void setIsHiddenByDefault (bool isHiddenByDefault)
void setDocPath (const QString &p)
void loadAll ()


Detailed Description

A class that provides information about a KCModule.

KCModuleInfo provides various technical information, such as icon, library etc. about a KCModule.n

Note:
Any values set with the set* functions is not written back with KCModuleInfo it only reads value from the desktop file.

Definition at line 48 of file kcmoduleinfo.h.


Constructor & Destructor Documentation

KCModuleInfo::KCModuleInfo const QString desktopFile  ) 
 

Constructs a KCModuleInfo.

Note:
a KCModuleInfo object will have to be manually deleted, it is not done automatically for you.
Parameters:
desktopFile the desktop file representing the module, or the name of the module.

Definition at line 54 of file kcmoduleinfo.cpp.

References KService::serviceByStorageId().

KCModuleInfo::KCModuleInfo KService::Ptr  moduleInfo  ) 
 

Same as above but takes a KService::Ptr as argument.

Note:
moduleInfo must be a valid pointer.
Parameters:
moduleInfo specifies the module

Definition at line 59 of file kcmoduleinfo.cpp.

KCModuleInfo::KCModuleInfo const KCModuleInfo rhs  ) 
 

Same as above but takes a KCModuleInfo as argument.

Parameters:
rhs specifies the module

Definition at line 64 of file kcmoduleinfo.cpp.

KCModuleInfo::KCModuleInfo  ) 
 

Same as above but creates an empty KCModuleInfo.

You should not normally call this.

Since:
3.4

Definition at line 48 of file kcmoduleinfo.cpp.

KCModuleInfo::~KCModuleInfo  ) 
 

Default destructor.

Definition at line 115 of file kcmoduleinfo.cpp.


Member Function Documentation

KCModuleInfo & KCModuleInfo::operator= const KCModuleInfo rhs  ) 
 

Assignment operator.

Definition at line 73 of file kcmoduleinfo.cpp.

References _allLoaded, _comment, _doc, _fileName, _handle, _icon, _isHiddenByDefault, _keywords, _lib, _name, _needsRootPrivileges, _service, and d.

bool KCModuleInfo::operator== const KCModuleInfo rhs  )  const
 

Equal operator.

Returns:
true if rhs equals itself

Definition at line 105 of file kcmoduleinfo.cpp.

References _fileName, _lib, and _name.

Referenced by operator!=().

bool KCModuleInfo::operator!= const KCModuleInfo rhs  )  const
 

Returns:
true if rhs is not equal itself

Definition at line 110 of file kcmoduleinfo.cpp.

References operator==().

QString KCModuleInfo::fileName  )  const [inline]
 

Returns:
the filename of the .desktop file that describes the KCM

Definition at line 112 of file kcmoduleinfo.h.

Referenced by KCModuleLoader::loadModule(), and KCModuleLoader::testModule().

const QStringList& KCModuleInfo::keywords  )  const [inline]
 

Returns:
the keywords associated with this KCM.

Definition at line 117 of file kcmoduleinfo.h.

QString KCModuleInfo::factoryName  )  const
 

Returns the module's factory name, if it's set.

If not, the library name is returned.

Returns:
the module's factory name
Since:
3.4

Definition at line 93 of file kcmoduleinfo.cpp.

References library().

Referenced by KCModuleLoader::testModule().

QString KCModuleInfo::moduleName  )  const [inline]
 

Returns:
the module\'s (translated) name

Definition at line 130 of file kcmoduleinfo.h.

Referenced by KCMultiDialog::addModule(), KCModuleContainer::addModule(), and KCModuleLoader::loadModule().

KService::Ptr KCModuleInfo::service  )  const [inline]
 

Returns:
a KSharedPtr to KService created from the modules .desktop file

Definition at line 136 of file kcmoduleinfo.h.

Referenced by KCMultiDialog::addModule(), KCModuleLoader::loadModule(), KCModuleProxy::runAsRoot(), and KCModuleLoader::testModule().

QString KCModuleInfo::comment  )  const [inline]
 

Returns:
the module's (translated) comment field

Definition at line 141 of file kcmoduleinfo.h.

Referenced by KCMultiDialog::addModule(), and KCModuleContainer::addModule().

QString KCModuleInfo::icon  )  const [inline]
 

Returns:
the module's icon name

Definition at line 146 of file kcmoduleinfo.h.

Referenced by KCMultiDialog::addModule(), and KCModuleContainer::addModule().

QString KCModuleInfo::docPath  )  const
 

Returns:
the path of the module's documentation

Definition at line 181 of file kcmoduleinfo.cpp.

QString KCModuleInfo::library  )  const [inline]
 

Returns:
the library name

Definition at line 156 of file kcmoduleinfo.h.

Referenced by factoryName(), KCModuleLoader::loadModule(), KCModuleLoader::testModule(), and KCModuleLoader::unloadModule().

QString KCModuleInfo::handle  )  const
 

Returns:
a handle (usually the contents of the FactoryName field)

Definition at line 190 of file kcmoduleinfo.cpp.

References QString::isEmpty().

Referenced by KCModuleProxy::realModule().

int KCModuleInfo::weight  )  const
 

Returns:
the weight of the module which determines the order of the pages in the KCMultiDialog. It's set by the X-KDE-Weight field.

Definition at line 202 of file kcmoduleinfo.cpp.

bool KCModuleInfo::needsRootPrivileges  )  const
 

Returns:
whether the module might require root permissions

Definition at line 211 of file kcmoduleinfo.cpp.

Referenced by KCMultiDialog::addModule(), and KCModuleContainer::addModule().

bool KCModuleInfo::isHiddenByDefault  )  const
 

Deprecated:
Returns:
the isHiddenByDefault attribute.

Definition at line 220 of file kcmoduleinfo.cpp.

bool KCModuleInfo::needsTest  )  const
 

Returns:
true if the module should be conditionally loaded.
Since:
3.4

Definition at line 228 of file kcmoduleinfo.cpp.

void KCModuleInfo::setKeywords const QStringList keyword  )  [inline, protected]
 

Sets the object's keywords.

Parameters:
keyword the new keywords

Definition at line 195 of file kcmoduleinfo.h.

void KCModuleInfo::setName const QString name  )  [inline, protected]
 

Sets the object's name.

Parameters:
name the new name

Definition at line 201 of file kcmoduleinfo.h.

void KCModuleInfo::setComment const QString comment  )  [inline, protected]
 

Sets the object's name.

Parameters:
comment the new comment

Definition at line 207 of file kcmoduleinfo.h.

void KCModuleInfo::setIcon const QString icon  )  [inline, protected]
 

Sets the object's icon.

Parameters:
icon the name of the new icon

Definition at line 213 of file kcmoduleinfo.h.

void KCModuleInfo::setLibrary const QString lib  )  [inline, protected]
 

Set the object's library.

Parameters:
lib the name of the new library without any extensions or prefixs.

Definition at line 219 of file kcmoduleinfo.h.

void KCModuleInfo::setHandle const QString handle  )  [inline, protected]
 

Sets the factory name.

Parameters:
handle The new factory name

Definition at line 225 of file kcmoduleinfo.h.

Referenced by loadAll().

void KCModuleInfo::setWeight int  weight  )  [inline, protected]
 

Sets the object's weight property which determines in what order modules will be displayed.

Default is 100.

Parameters:
weight the new weight

Definition at line 233 of file kcmoduleinfo.h.

Referenced by loadAll().

void KCModuleInfo::setNeedsTest bool  val  )  [protected]
 

Sets if the module should be tested for loading.

Parameters:
val the value to set
Since:
3.4

Definition at line 233 of file kcmoduleinfo.cpp.

Referenced by loadAll().

void KCModuleInfo::setNeedsRootPrivileges bool  needsRootPrivileges  )  [inline, protected]
 

Toggles whether the represented module needs root privileges.

Use with caution.

Parameters:
needsRootPrivileges if module needs root privilges

Definition at line 248 of file kcmoduleinfo.h.

Referenced by loadAll().

void KCModuleInfo::setIsHiddenByDefault bool  isHiddenByDefault  )  [inline, protected]
 

Deprecated:

Definition at line 254 of file kcmoduleinfo.h.

Referenced by loadAll().

void KCModuleInfo::setDocPath const QString p  )  [inline, protected]
 

Sets the object's documentation path.

Parameters:
p the new documentation path

Definition at line 261 of file kcmoduleinfo.h.

Referenced by loadAll().

void KCModuleInfo::loadAll  )  [protected]
 

Reads the service entries specific for KCModule from the desktop file.

The usual desktop entries are read in

See also:
init.

Definition at line 148 of file kcmoduleinfo.cpp.

References QVariant::asBool(), QVariant::isValid(), setDocPath(), setHandle(), setIsHiddenByDefault(), setNeedsRootPrivileges(), setNeedsTest(), setWeight(), QVariant::toBool(), and QVariant::toInt().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kutils Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 8 06:24:22 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003