• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kutils
 

kutils

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

#include <kcmodulecontainer.h>

Inheritance diagram for KCModuleContainer:
KCModule

Public Member Functions

 KCModuleContainer (TQWidget *parent, const char *name, const TQStringList &mods)
 
 KCModuleContainer (TQWidget *parent, const char *name, const TQString &mods=TQString())
 
void addModule (const TQString &module)
 
virtual ~KCModuleContainer ()
 
void save ()
 
void load ()
 
void defaults ()
 
- Public Member Functions inherited from KCModule
virtual void sysdefaults ()
 
virtual TQString quickHelp () const
 
virtual const KAboutData * aboutData () const
 
void setAboutData (KAboutData *about)
 
int buttons () const
 
TQString rootOnlyMsg () const
 
bool useRootOnlyMsg () const
 
const TQPtrList
< KConfigDialogManager > & 
configs () const
 

Protected Types

typedef TQValueList
< KCModuleProxy * > 
ModuleList
 

Protected Member Functions

void finalize ()
 
- Protected Member Functions inherited from KCModule
KConfigDialogManager * addConfig (KConfigSkeleton *config, TQWidget *widget)
 
void setQuickHelp (const TQString &help)
 
void setButtons (int btn)
 
void setRootOnlyMsg (const TQString &msg)
 
void setUseRootOnlyMsg (bool on)
 
bool managedWidgetChangeState () const
 
void unmanagedWidgetChangeState (bool)
 

Protected Attributes

ModuleList changedModules
 
ModuleList allModules
 

Additional Inherited Members

- Public Types inherited from KCModule
enum  Button
 
- Signals inherited from KCModule
void changed (bool state)
 
void quickHelpChanged ()
 
- Protected Slots inherited from KCModule
void changed ()
 
void widgetChanged ()
 

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
Since
3.4

Definition at line 53 of file kcmodulecontainer.h.

Constructor & Destructor Documentation

KCModuleContainer::KCModuleContainer ( TQWidget *  parent,
const char *  name,
const TQStringList &  mods 
)

Creates a KCModuleContainer with tabs, each one containing one of the specified modules in mods.

Parameters
parentthe parent TQWidget.
namethe module's name.
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 81 of file kcmodulecontainer.cpp.

KCModuleContainer::KCModuleContainer ( TQWidget *  parent,
const char *  name,
const TQString &  mods = TQString() 
)

This is a convenience function, instead of building a TQStringList you can specify the modules in a comma separated TQString.

For example;

KCModuleContainer* cont = KCModuleContainer( this, "kcm_misc", TQString("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
nameThe service name
modsThe modules to load
Returns
The KCModule containing the requested modules.

Definition at line 73 of file kcmodulecontainer.cpp.

KCModuleContainer::~KCModuleContainer ( )
virtual

Default destructor.

Definition at line 249 of file kcmodulecontainer.cpp.

Member Function Documentation

void KCModuleContainer::addModule ( const TQString &  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 124 of file kcmodulecontainer.cpp.

void KCModuleContainer::defaults ( )
virtual

Reimplemented for internal purposes.

Reimplemented from KCModule.

Definition at line 227 of file kcmodulecontainer.cpp.

void KCModuleContainer::finalize ( )
protected

Sets this KCM's buttons and adds a AdminMode button if necessary.

If KCModuleContainer is subclassed finalize() should be called in the constructor after all calls to addModule have been done. Call it once.

Definition at line 107 of file kcmodulecontainer.cpp.

void KCModuleContainer::load ( )
virtual

Reimplemented for internal purposes.

Reimplemented from KCModule.

Definition at line 215 of file kcmodulecontainer.cpp.

void KCModuleContainer::save ( )
virtual

Reimplemented for internal purposes.

Reimplemented from KCModule.

Definition at line 202 of file kcmodulecontainer.cpp.

Member Data Documentation

ModuleList KCModuleContainer::allModules
protected

A list of all modules which are encapsulated.

Definition at line 142 of file kcmodulecontainer.h.

ModuleList KCModuleContainer::changedModules
protected

A list containing KCModuleProxy objects which have changed and must be saved.

Definition at line 137 of file kcmodulecontainer.h.


The documentation for this class was generated from the following files:
  • kcmodulecontainer.h
  • kcmodulecontainer.cpp

kutils

Skip menu "kutils"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kutils

Skip menu "kutils"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kutils by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |