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)
KCModuleInfooperator= (const KCModuleInfo &rhs)
bool operator== (const KCModuleInfo &rhs) const
bool operator!= (const KCModuleInfo &rhs) const
 ~KCModuleInfo ()
QString fileName () const
const QStringListkeywords () 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

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 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 49 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 33 of file kcmoduleinfo.cpp.

References kdWarning(), KService::Ptr, and KService::serviceByStorageId().

KCModuleInfo::KCModuleInfo KService::Ptr  moduleInfo  ) 
 

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

Parameters:
moduleInfo specifies the module

Definition at line 48 of file kcmoduleinfo.cpp.

References k_funcinfo, kdDebug(), and KService::Ptr.

KCModuleInfo::KCModuleInfo const KCModuleInfo rhs  ) 
 

Same as above but takes a KCModuleInfo as argument.

Parameters:
rhs specifies the module

Definition at line 57 of file kcmoduleinfo.cpp.

KCModuleInfo::~KCModuleInfo  ) 
 

Default constructor.

Definition at line 96 of file kcmoduleinfo.cpp.


Member Function Documentation

KCModuleInfo & KCModuleInfo::operator= const KCModuleInfo rhs  ) 
 

Assignment operator.

Definition at line 66 of file kcmoduleinfo.cpp.

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

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

Equal operator.

Returns:
true if rhs equals itself

Definition at line 86 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 91 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 104 of file kcmoduleinfo.h.

Referenced by KCModuleLoader::loadModule().

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

Returns:
the keywords associated with this KCM.

Definition at line 109 of file kcmoduleinfo.h.

QString KCModuleInfo::moduleName  )  const [inline]
 

Returns:
the module\'s (translated) name

Definition at line 114 of file kcmoduleinfo.h.

Referenced by KCMultiDialog::addModule().

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

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

Definition at line 120 of file kcmoduleinfo.h.

References KService::Ptr.

Referenced by KCMultiDialog::addModule().

QString KCModuleInfo::comment  )  const [inline]
 

Returns:
the module's (translated) comment field

Definition at line 125 of file kcmoduleinfo.h.

Referenced by KCMultiDialog::addModule().

QString KCModuleInfo::icon  )  const [inline]
 

Returns:
the module's icon name

Definition at line 130 of file kcmoduleinfo.h.

Referenced by KCMultiDialog::addModule().

QString KCModuleInfo::docPath  )  const
 

Returns:
the path of the module's documentation

Definition at line 147 of file kcmoduleinfo.cpp.

QString KCModuleInfo::library  )  const [inline]
 

Returns:
the library name

Definition at line 140 of file kcmoduleinfo.h.

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

QString KCModuleInfo::handle  )  const
 

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

Definition at line 156 of file kcmoduleinfo.cpp.

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 168 of file kcmoduleinfo.cpp.

bool KCModuleInfo::needsRootPrivileges  )  const
 

Returns:
whether the module might require root permissions

Definition at line 177 of file kcmoduleinfo.cpp.

bool KCModuleInfo::isHiddenByDefault  )  const
 

Deprecated:
Returns:
the isHiddenByDefault attribute.

Definition at line 186 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 170 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 176 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 182 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 188 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 194 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 200 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:
the new weight

Definition at line 208 of file kcmoduleinfo.h.

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 215 of file kcmoduleinfo.h.

Referenced by loadAll().

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

Deprecated:

Definition at line 221 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 228 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 117 of file kcmoduleinfo.cpp.

References setDocPath(), setHandle(), setIsHiddenByDefault(), setNeedsRootPrivileges(), and setWeight().


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.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Feb 18 15:11:05 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003