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

KUtils

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

#include <kcmodulecontainer.h>

Inheritance diagram for KCModuleContainer:
Inheritance graph
[legend]

Public Member Functions

 KCModuleContainer (QWidget *parent, const QStringList &mods)
 
 KCModuleContainer (QWidget *parent, const QString &mods=QString())
 
virtual ~KCModuleContainer ()
 
void addModule (const QString &module)
 
void defaults ()
 
void load ()
 
void save ()
 
- Public Member Functions inherited from KCModule
 KCModule (const KComponentData &componentData, QWidget *parent=0, const QVariantList &args=QVariantList())
 
 ~KCModule ()
 
virtual const KAboutData * aboutData () const
 
KAuth::Action * authAction () const
 
Buttons buttons () const
 
KComponentData componentData () const
 
QList< KConfigDialogManager * > configs () const
 
QString exportText () const
 
bool needsAuthorization () const
 
virtual QString quickHelp () const
 
QString rootOnlyMessage () const
 
void setAboutData (const KAboutData *about)
 
void setExportText (const QString &)
 
void setNeedsAuthorization (bool needsAuth)
 
bool useRootOnlyMessage () const
 

Protected Types

typedef QList< KCModuleProxy * > ModuleList
 

Protected Attributes

ModuleList allModules
 
ModuleList changedModules
 

Additional Inherited Members

- Public Types inherited from KCModule
enum  Button
 
- Public Slots inherited from KCModule
- Signals inherited from KCModule
void changed (bool state)
 
void quickHelpChanged ()
 
void rootOnlyMessageChanged (bool use, QString message)
 
- Protected Slots inherited from KCModule
void authStatusChanged (int)
 
void changed ()
 
void widgetChanged ()
 
- Protected Member Functions inherited from KCModule
KConfigDialogManager * addConfig (KCoreConfigSkeleton *config, QWidget *widget)
 
KConfigDialogManager * addConfig (KConfigSkeleton *config, QWidget *widget)
 
bool managedWidgetChangeState () const
 
void setButtons (Buttons btn)
 
void setQuickHelp (const QString &help)
 
void setRootOnlyMessage (const QString &message)
 
void setUseRootOnlyMessage (bool on)
 
virtual void showEvent (QShowEvent *ev)
 
void unmanagedWidgetChangeState (bool)
 

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.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.teli.nosp@m.a.com

Definition at line 49 of file kcmodulecontainer.h.

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
parentthe parent QWidget.
modsThe 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 74 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") );

The other constructor takes its modules in a QStringlist which also can be constructed from a string and thus you will have to be explicit on the data type.

What you probably want is the KCMODULECONTAINER macro which builds an KCModule for you, taking the modules you want as argument.

Parameters
parentThe parent widget
modsThe modules to load
Returns
The KCModule containing the requested modules.

Definition at line 67 of file kcmodulecontainer.cpp.

KCModuleContainer::~KCModuleContainer ( )
virtual

Default destructor.

Definition at line 187 of file kcmodulecontainer.cpp.

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
modulethe name of the module to add. The name is the desktop file's name without the ".desktop" part.

Definition at line 99 of file kcmodulecontainer.cpp.

void KCModuleContainer::defaults ( )
virtual

Reimplemented for internal purposes.

Reimplemented from KCModule.

Definition at line 165 of file kcmodulecontainer.cpp.

void KCModuleContainer::load ( )
virtual

Reimplemented for internal purposes.

Reimplemented from KCModule.

Definition at line 153 of file kcmodulecontainer.cpp.

void KCModuleContainer::save ( )
virtual

Reimplemented for internal purposes.

Reimplemented from KCModule.

Definition at line 140 of file kcmodulecontainer.cpp.

Member Data Documentation

ModuleList KCModuleContainer::allModules
protected

A list of all modules which are encapsulated.

Definition at line 127 of file kcmodulecontainer.h.

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:
  • kcmodulecontainer.h
  • kcmodulecontainer.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KUtils

Skip menu "KUtils"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • 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