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

tdeutils

Public Slots | Signals | Public Member Functions | Protected Member Functions | Friends | List of all members
TDECModuleProxy Class Reference
KControl module classes

#include <tdecmoduleproxy.h>

Inherits TQWidget.

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.nosp@m..eng.nosp@m.lich@.nosp@m.teli.nosp@m.a.com
Matthias Kretz kretz.nosp@m.@kde.nosp@m..org

Definition at line 68 of file tdecmoduleproxy.h.

Constructor & Destructor Documentation

◆ TDECModuleProxy() [1/3]

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
infoThe TDECModuleInfo to construct the module from.
withFallbackIf 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.
parentthe parent TQWidget.
namethe module's name.
argsThis is used in the implementation and is internal. Use the default.

Definition at line 483 of file tdecmoduleproxy.cpp.

◆ TDECModuleProxy() [2/3]

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
serviceNameThe module's service name to construct from.
withFallbackIf 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.
parentthe parent TQWidget.
namethe module's name.
argsThis is used in the implementation and is internal. Use the default.

Definition at line 492 of file tdecmoduleproxy.cpp.

◆ TDECModuleProxy() [3/3]

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
serviceThe KService to construct from.
withFallbackIf 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.
parentthe parent TQWidget.
namethe module's name.
argsThis is used in the implementation and is internal. Use the default.

Definition at line 474 of file tdecmoduleproxy.cpp.

◆ ~TDECModuleProxy()

TDECModuleProxy::~TDECModuleProxy ( )

Default destructor.

Definition at line 429 of file tdecmoduleproxy.cpp.

Member Function Documentation

◆ aboutData()

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

Definition at line 589 of file tdecmoduleproxy.cpp.

◆ buttons()

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

Definition at line 625 of file tdecmoduleproxy.cpp.

◆ changed() [1/2]

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

Definition at line 646 of file tdecmoduleproxy.cpp.

◆ changed [2/2]

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

◆ childClosed

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

◆ dcopName()

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.

◆ defaults

void TDECModuleProxy::defaults ( )
slot

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

Definition at line 552 of file tdecmoduleproxy.cpp.

◆ deleteClient

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.

◆ emitQuickHelpChanged()

void TDECModuleProxy::emitQuickHelpChanged ( )
protected

Emits the quickHelpChanged signal.

Since
3.4

Definition at line 666 of file tdecmoduleproxy.cpp.

◆ handbookDocPath()

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

Definition at line 601 of file tdecmoduleproxy.cpp.

◆ handbookSection()

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

Definition at line 613 of file tdecmoduleproxy.cpp.

◆ init()

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

Internal intialization function, called by the constructors.

Definition at line 502 of file tdecmoduleproxy.cpp.

◆ instance()

TDEInstance * TDECModuleProxy::instance ( ) const

Returns the embedded TDECModule's TDEInstance.

Returns
The module's TDEInstance.
Deprecated:

Definition at line 641 of file tdecmoduleproxy.cpp.

◆ load()

void TDECModuleProxy::load ( )

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

Definition at line 516 of file tdecmoduleproxy.cpp.

◆ moduleInfo()

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

Definition at line 651 of file tdecmoduleproxy.cpp.

◆ quickHelp()

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

Definition at line 560 of file tdecmoduleproxy.cpp.

◆ realModule()

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.

◆ rootMode()

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.

◆ rootOnlyMsg()

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

Definition at line 631 of file tdecmoduleproxy.cpp.

◆ runAsRoot

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.

◆ save()

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.

◆ showEvent()

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.

Definition at line 285 of file tdecmoduleproxy.cpp.

◆ useRootOnlyMsg()

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

Definition at line 636 of file tdecmoduleproxy.cpp.

Friends And Related Function Documentation

◆ TDECModuleProxyRootCommunicatorImpl

friend class TDECModuleProxyRootCommunicatorImpl
friend

Definition at line 73 of file tdecmoduleproxy.h.


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.9.4
This website is maintained by Timothy Pearson.