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

tdeutils

TDECModuleProxy Class Reference
[KControl module classes]

Encapsulates a TDECModule for embedding. More...

#include <tdecmoduleproxy.h>

Inheritance diagram for TDECModuleProxy:
TQWidget

List of all members.

Public Slots

void runAsRoot ()
void defaults ()
void deleteClient ()

Signals

void changed (bool state)
void changed (TDECModuleProxy *mod)
void childClosed ()
void quickHelpChanged ()

Public Member Functions

 TDECModuleProxy (const TDECModuleInfo &info, bool withFallback=true, TQWidget *parent=0, const char *name=0, const TQStringList &args=TQStringList())
 TDECModuleProxy (const TQString &serviceName, bool withFallback=true, TQWidget *parent=0, const char *name=0, const TQStringList &args=TQStringList())
 TDECModuleProxy (const KService::Ptr &service, bool withFallback=true, TQWidget *parent=0, const char *name=0, const TQStringList &args=TQStringList())
 ~TDECModuleProxy ()
void load ()
void save ()
TQString quickHelp () const
const TDEAboutData * aboutData () const
TQString handbookDocPath () const
TQString handbookSection () const
int buttons () const
TQString rootOnlyMsg () const
bool useRootOnlyMsg () const
TDEInstance * instance () const
bool changed () const
bool rootMode () const
TDECModule * realModule () const
const TDECModuleInfo & moduleInfo () const
TQCString dcopName () const

Protected Member Functions

void showEvent (TQShowEvent *)
void init (const TDECModuleInfo &info)
void emitQuickHelpChanged ()

Friends

class TDECModuleProxyRootCommunicatorImpl

Detailed Description

Encapsulates a TDECModule for embedding.

TDECModuleProxy is a wrapper for TDECModule intended for cases where modules are to be displayed. It ensures layout is consistent, handles root/administrator modules and in general takes care of the details needed for making a module available in an interface. A TDECModuleProxy can be treated as a TQWidget, without worrying about the details specific for modules such as library loading. TDECModuleProxy is not a sub class of TDECModule but its API closely resembles TDECModule's.
Usually, an instance is created by passing one of the constructors a KService::Ptr, TDECModuleInfo or simply the name of the module and then added to the layout as any other widget.
When the user have changed the module, changed( bool ) as well as changed ( TDECModuleProxy * ) is emitted. TDECModuleProxy does not take care of prompting for saving - if the object is deleted while changes is not saved the changes will be lost. changed() returns true if changes are unsaved.

TDECModuleProxy does not take care of authorization of TDECModules.
TDECModuleProxy do lazy loading, meaning the library will not be loaded or any other initialization done before its show() function is called. This means modules will only be loaded when they are actually needed as well as it is possible to load many TDECModuleProxy without any speed penalty.

TDECModuleProxy should be used in all cases where modules are embedded in order to promote code efficiency and usability consistency.

Author:
Frans Englich <frans.englich@telia.com>
Matthias Kretz <kretz@kde.org>

Definition at line 68 of file tdecmoduleproxy.h.


Constructor & Destructor Documentation

TDECModuleProxy::TDECModuleProxy ( const TDECModuleInfo &  info,
bool  withFallback = true,
TQWidget *  parent = 0,
const char *  name = 0,
const TQStringList &  args = TQStringList() 
)

Constructs a TDECModuleProxy from a TDECModuleInfo class.

Parameters:
info The TDECModuleInfo to construct the module from.
withFallback If set to true and loading of the module fails, a alternative will be tried, resulting in the module appearing in its own window, if at all. The embedded module will be load()ed.
parent the parent TQWidget.
name the module's name.
args This is used in the implementation and is internal. Use the default.

Definition at line 483 of file tdecmoduleproxy.cpp.

TDECModuleProxy::TDECModuleProxy ( const TQString &  serviceName,
bool  withFallback = true,
TQWidget *  parent = 0,
const char *  name = 0,
const TQStringList &  args = TQStringList() 
)

Constructs a TDECModuleProxy from a module's service name, which is equivalent to the desktop file for the kcm without the ".desktop" part.

Otherwise equal to the one above.

Parameters:
serviceName The module's service name to construct from.
withFallback If set to true and loading of the module fails, a alternative will be tried, resulting in the module appearing in its own window, if at all. The embedded module will be load()ed.
parent the parent TQWidget.
name the module's name.
args This is used in the implementation and is internal. Use the default.

Definition at line 492 of file tdecmoduleproxy.cpp.

TDECModuleProxy::TDECModuleProxy ( const KService::Ptr &  service,
bool  withFallback = true,
TQWidget *  parent = 0,
const char *  name = 0,
const TQStringList &  args = TQStringList() 
)

Constructs a TDECModuleProxy from KService.

Otherwise equal to the one above.

Parameters:
service The KService to construct from.
withFallback If set to true and loading of the module fails, a alternative will be tried, resulting in the module appearing in its own window, if at all. The embedded module will be load()ed.
parent the parent TQWidget.
name the module's name.
args This is used in the implementation and is internal. Use the default.

Definition at line 474 of file tdecmoduleproxy.cpp.

TDECModuleProxy::~TDECModuleProxy (  ) 

Default destructor.

Definition at line 429 of file tdecmoduleproxy.cpp.


Member Function Documentation

const TDEAboutData * TDECModuleProxy::aboutData (  )  const
Returns:
the module's aboutData()

Definition at line 589 of file tdecmoduleproxy.cpp.

int TDECModuleProxy::buttons (  )  const
Returns:
what buttons the module needs

Definition at line 625 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::changed ( TDECModuleProxy *  mod  )  [signal]

This is emitted in the same situations as in the one above.

Practical when several TDECModuleProxys are loaded.

Since:
3.4
bool TDECModuleProxy::changed (  )  const
Returns:
true if the module is modified and needs to be saved.

Definition at line 646 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::childClosed (  )  [signal]

When a module running with root privileges and exits, returns to normal mode, the childClosed() signal is emitted.

Since:
3.4
TQCString TDECModuleProxy::dcopName (  )  const

Returns the DCOP the module's DCOPClient and DCOPObject has(they are identical).

Since:
3.4

Definition at line 661 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::defaults (  )  [slot]

Calling it will cause the contained module to load its default values.

Definition at line 552 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::deleteClient (  )  [slot]

Calling this, results in deleting the contained module, and unregistering from DCOP.

A similar result is achieved by deleting the TDECModuleProxy itself.

Since:
3.4

Definition at line 437 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::emitQuickHelpChanged (  )  [protected]

Emits the quickHelpChanged signal.

Since:
3.4

Definition at line 666 of file tdecmoduleproxy.cpp.

TQString TDECModuleProxy::handbookDocPath (  )  const
Returns:
the module's handbookDocPath()

Definition at line 601 of file tdecmoduleproxy.cpp.

TQString TDECModuleProxy::handbookSection (  )  const
Returns:
the module's handbookSection()

Definition at line 613 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::init ( const TDECModuleInfo &  info  )  [protected]

Internal intialization function, called by the constructors.

Definition at line 502 of file tdecmoduleproxy.cpp.

TDEInstance * TDECModuleProxy::instance (  )  const

Returns the embedded TDECModule's TDEInstance.

Returns:
The module's TDEInstance.
Deprecated:

Definition at line 641 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::load (  ) 

Calling it will cause the contained module to run its load() routine.

Definition at line 516 of file tdecmoduleproxy.cpp.

const TDECModuleInfo & TDECModuleProxy::moduleInfo (  )  const
Returns:
a TDECModuleInfo for the encapsulated module

Definition at line 651 of file tdecmoduleproxy.cpp.

TQString TDECModuleProxy::quickHelp (  )  const
Returns:
the module's quickHelp();

Definition at line 560 of file tdecmoduleproxy.cpp.

TDECModule * TDECModuleProxy::realModule (  )  const

Access to the actual module.

However, if the module is running in root mode, see rootMode(), this function returns a NULL pointer, since the module is in another process. It may also return NULL if anything goes wrong.

Returns:
the encapsulated module.

Definition at line 140 of file tdecmoduleproxy.cpp.

bool TDECModuleProxy::rootMode (  )  const

Returns whether the module is running in root mode.

A module is in root mode when runAsRoot() has been called. A session under root user will never reach root mode.

Note:
realModule() will return null when the module is running in root mode.
Returns:
true if the module is running with root privileges
Since:
3.4

Definition at line 656 of file tdecmoduleproxy.cpp.

TQString TDECModuleProxy::rootOnlyMsg (  )  const
Returns:
The module's custom root message, if it has one
Deprecated:

Definition at line 631 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::runAsRoot (  )  [slot]

Calling this will cause the module to be run in "administrator mode".

Since:
3.4

Definition at line 299 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::save (  ) 

Calling it will cause the contained module to run its save() routine.

If the module was not modified, it will not be asked to save.

Definition at line 528 of file tdecmoduleproxy.cpp.

void TDECModuleProxy::showEvent ( TQShowEvent *  ev  )  [protected]

Reimplemented for internal purposes.

Makes sure the encapsulated module is loaded before the show event is taken care of.

Reimplemented from TQWidget.

Definition at line 285 of file tdecmoduleproxy.cpp.

bool TDECModuleProxy::useRootOnlyMsg (  )  const
Returns:
If the module is a root module.
Deprecated:

Definition at line 636 of file tdecmoduleproxy.cpp.


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

tdeutils

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

tdeutils

Skip menu "tdeutils"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeutils by doxygen 1.6.3
This website is maintained by Timothy Pearson.