kdeui Library API Documentation

KDCOPActionProxy Class Reference

The KDCOPActionProxy class provides an easy way to publish a collection of KAction objects through DCOP. A proxy class publishing a DCOP interface for actions. More...

#include <kdcopactionproxy.h>

Inheritance diagram for KDCOPActionProxy:

DCOPObjectProxy List of all members.

Public Methods

 KDCOPActionProxy (KActionCollection *actionCollection, DCOPObject *parent)
 Constructs a dcop action proxy, being able to export the actions of the provided KActionCollection through DCOP, using the parent DCOPObject's object id to generate unique object ids for the actions.

 KDCOPActionProxy (DCOPObject *parent)
 Use this constructor if do not want to provide the exportable actions through a KActionCollection .

 ~KDCOPActionProxy ()
 Destructor.

virtual QValueList< KAction * > actions () const
 Returns a list of exportable actions.

virtual KActionaction (const char *name) const
 Returns an action object with the given name.

virtual QCString actionObjectId (const QCString &name) const
 Use this method to retrieve a DCOP object id for an action with the given name.

virtual QMap< QCString, DCOPRefactionMap (const QCString &appId=QCString()) const
 Returns a map of all exported actions, with the action name as keys and a global DCOP reference as data entries.

virtual bool process (const QCString &obj, const QCString &fun, const QByteArray &data, QCString &replyType, QByteArray &replyData)
 Internal reimplementation of DCOPObjectProxy::process .

virtual bool processAction (const QCString &obj, const QCString &fun, const QByteArray &data, QCString &replyType, QByteArray &replyData, KAction *action)
 Called by the process method and takes care of processing the object request for an action object.


Detailed Description

The KDCOPActionProxy class provides an easy way to publish a collection of KAction objects through DCOP. A proxy class publishing a DCOP interface for actions.

For the DCOP client the exported actions behave like full-fledged DCOP objects, providing full access to the KAction object functionality in the server.

This class can generate DCOP object ids for given action objects, which it automatically processes, as being a DCOPObjectProxy .

Definition at line 38 of file kdcopactionproxy.h.


Constructor & Destructor Documentation

KDCOPActionProxy::KDCOPActionProxy KActionCollection   actionCollection,
DCOPObject   parent
 

Constructs a dcop action proxy, being able to export the actions of the provided KActionCollection through DCOP, using the parent DCOPObject's object id to generate unique object ids for the actions.

Definition at line 46 of file kdcopactionproxy.cpp.

KDCOPActionProxy::KDCOPActionProxy DCOPObject   parent
 

Use this constructor if do not want to provide the exportable actions through a KActionCollection .

You have to reimplement the virtual actions() and action() methods if you use this constructor.

Definition at line 51 of file kdcopactionproxy.cpp.

KDCOPActionProxy::~KDCOPActionProxy  
 

Destructor.

Definition at line 65 of file kdcopactionproxy.cpp.


Member Function Documentation

QValueList< KAction * > KDCOPActionProxy::actions   [virtual]
 

Returns a list of exportable actions.

The default implementation returns a list of actions provided by a KActionCollection, if the first constructor has been used.

Definition at line 70 of file kdcopactionproxy.cpp.

Referenced by actionMap().

KAction * KDCOPActionProxy::action const char *    name const [virtual]
 

Returns an action object with the given name.

The default implementation queries the action object from the KActionCollection, if the first constructor has been used.

Definition at line 78 of file kdcopactionproxy.cpp.

Referenced by process().

QCString KDCOPActionProxy::actionObjectId const QCString   name const [virtual]
 

Use this method to retrieve a DCOP object id for an action with the given name.

This class automatically takes care of processing DCOP object requests for the returned object id.

You can construct a global DCOP object referenence using DCOPRef. For example like DCOPRef( kapp->dcopClient()->appId, actionProxy->actionObjectId( actionName ) );

The action with the given name has to be available through the action method.

Definition at line 86 of file kdcopactionproxy.cpp.

Referenced by actionMap().

QMap< QCString, DCOPRef > KDCOPActionProxy::actionMap const QCString   appId = QCString() const [virtual]
 

Returns a map of all exported actions, with the action name as keys and a global DCOP reference as data entries.

The appId argument is used to specify the appid component of the DCOP reference. By default the global application id is used ( kapp->dcopClient()->appId() ) .

Definition at line 91 of file kdcopactionproxy.cpp.

References actionObjectId(), actions(), QValueList::begin(), QValueList::end(), KStdAccel::end(), QMap::insert(), and QCString::isEmpty().

bool KDCOPActionProxy::process const QCString   obj,
const QCString   fun,
const QByteArray   data,
QCString   replyType,
QByteArray   replyData
[virtual]
 

Internal reimplementation of DCOPObjectProxy::process .

Reimplemented from DCOPObjectProxy.

Definition at line 108 of file kdcopactionproxy.cpp.

References action(), QCString::left(), QCString::mid(), and processAction().

bool KDCOPActionProxy::processAction const QCString   obj,
const QCString   fun,
const QByteArray   data,
QCString   replyType,
QByteArray   replyData,
KAction   action
[virtual]
 

Called by the process method and takes care of processing the object request for an action object.

Definition at line 121 of file kdcopactionproxy.cpp.

References KAction::activate(), KDCOPPropertyProxy::functions(), KAction::isPlugged(), and KDCOPPropertyProxy::processPropertyRequest().

Referenced by process().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:04 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001