KUtils
KCModuleContainer Class Reference
#include <kcmodulecontainer.h>

Detailed Description
KCModuleContainer is a convenience class encapsulating several KCModules.
The KCModuleContainer class is a convenience class for organizing a multiple set of KCModule. KCModuleContainer is a sub class of KCModule and builds an interface mainly consisting of a tab widget where each tab contains one of the modules specified via one of the constructors. KCModuleContainer can handle modules which requires root permissions. What you most likely want is the KCMODULECONTAINER macro.
Sometimes it is of interest to detect in runtime whether a module should be loaded or not. This can be achieved by sub classing KCModuleContainer, doing the probing/testing checks and then manually call addModule for each module which should be displayed. When all calls to addModule is done, call finalize() which performs some necessary final steps.
Definition at line 49 of file kcmodulecontainer.h.
Public Member Functions | |
void | addModule (const QString &module) |
void | defaults () |
KCModuleContainer (QWidget *parent, const QString &mods=QString()) | |
KCModuleContainer (QWidget *parent, const QStringList &mods) | |
void | load () |
void | save () |
virtual | ~KCModuleContainer () |
Protected Types | |
typedef QList< KCModuleProxy * > | ModuleList |
Protected Attributes | |
ModuleList | allModules |
ModuleList | changedModules |
Member Typedef Documentation
typedef QList<KCModuleProxy*> KCModuleContainer::ModuleList [protected] |
Definition at line 116 of file kcmodulecontainer.h.
Constructor & Destructor Documentation
KCModuleContainer::KCModuleContainer | ( | QWidget * | parent, | |
const QStringList & | mods | |||
) |
Creates a KCModuleContainer with tabs, each one containing one of the specified modules in mods
.
- Parameters:
-
parent the parent QWidget. mods The list of KCModules to be loaded. The name of each KCModule is its service name, that is the name of the desktop file without the ".desktop" part
Definition at line 73 of file kcmodulecontainer.cpp.
KCModuleContainer::KCModuleContainer | ( | QWidget * | parent, | |
const QString & | mods = QString() | |||
) | [explicit] |
This is a convenience function, instead of building a QStringList you can specify the modules in a comma separated QString.
For example;
KCModuleContainer* cont = KCModuleContainer( this, "kcm_misc", QString("kcm_energy, kcm_keyboard ,kcm_useraccount, kcm_mouse") );
What you probably want is the KCMODULECONTAINER macro which builds an KCModule for you, taking the modules you want as argument.
- Parameters:
-
parent The parent widget mods The modules to load
- Returns:
- The KCModule containing the requested modules.
Definition at line 67 of file kcmodulecontainer.cpp.
KCModuleContainer::~KCModuleContainer | ( | ) | [virtual] |
Member Function Documentation
void KCModuleContainer::addModule | ( | const QString & | module | ) |
Adds the specified module to the tab widget.
Setting the tab icon, text, tool tip, connecting the signals is what it does.
- Parameters:
-
module the name of the module to add. The name is the desktop file's name without the ".desktop" part.
Definition at line 98 of file kcmodulecontainer.cpp.
void KCModuleContainer::defaults | ( | ) | [virtual] |
Reimplemented for internal purposes.
Reimplemented from KCModule.
Definition at line 164 of file kcmodulecontainer.cpp.
void KCModuleContainer::load | ( | ) | [virtual] |
Reimplemented for internal purposes.
Reimplemented from KCModule.
Definition at line 152 of file kcmodulecontainer.cpp.
void KCModuleContainer::save | ( | ) | [virtual] |
Reimplemented for internal purposes.
Reimplemented from KCModule.
Definition at line 139 of file kcmodulecontainer.cpp.
Member Data Documentation
ModuleList KCModuleContainer::allModules [protected] |
ModuleList KCModuleContainer::changedModules [protected] |
A list containing KCModuleProxy objects which have changed and must be saved.
Definition at line 122 of file kcmodulecontainer.h.
The documentation for this class was generated from the following files: