DCOPObject Class Reference
Provides an interface for receiving DCOP messages. More...
#include <dcopobject.h>
Inheritance diagram for DCOPObject:

Public Member Functions | |
DCOPObject () | |
Creates a DCOPObject and calculates the object id using its physical memory address. | |
DCOPObject (QObject *obj) | |
Creates a DCOPObject and calculates the object id using QObject::name(). | |
DCOPObject (const QCString &objId) | |
Creates a DCOPObject with object Id objId . | |
virtual | ~DCOPObject () |
Destroys the DCOPObject and removes it from the map of known objects. | |
QCString | objId () const |
Returns the object id of the DCOPObject. | |
bool | setObjId (const QCString &objId) |
Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected. | |
virtual bool | process (const QCString &fun, const QByteArray &data, QCString &replyType, QByteArray &replyData) |
Dispatches a message. | |
virtual bool | processDynamic (const QCString &fun, const QByteArray &data, QCString &replyType, QByteArray &replyData) |
This function is of interest when you used an IDL compiler to generate the implementation for process() but you still want to dispatch some functions dynamically. | |
virtual QCStringList | functionsDynamic () |
This function is of interest when you used an IDL compiler to generate the implementation for functions() but you still want to list some functions dynamically. | |
virtual QCStringList | interfacesDynamic () |
This function is of interest when you used an IDL compiler to generate the implementation for interfaces() but you still want to list some interfaces dynamically. | |
virtual QCStringList | interfaces () |
Returns the names of the interfaces, specific ones last. | |
virtual QCStringList | functions () |
Returns the list of functions understood by the object. | |
void | emitDCOPSignal (const QCString &signal, const QByteArray &data) |
Emit signal as DCOP signal from this object with data as arguments. | |
bool | connectDCOPSignal (const QCString &sender, const QCString &senderObj, const QCString &signal, const QCString &slot, bool Volatile) |
Connects to a DCOP signal. | |
bool | disconnectDCOPSignal (const QCString &sender, const QCString &senderObj, const QCString &signal, const QCString &slot) |
Disconnects a DCOP signal. | |
DCOPClient * | callingDcopClient () |
Returns the DCOPClient responsible for making the call. | |
void | setCallingDcopClient (DCOPClient *) |
Static Public Member Functions | |
bool | hasObject (const QCString &objId) |
Checks whether an object with the given id is known in this process. | |
DCOPObject * | find (const QCString &objId) |
Try to find a dcop object with the given id. | |
QPtrList< DCOPObject > | match (const QCString &partialId) |
Tries to find an object using a partial object id. | |
QCString | objectName (QObject *obj) |
Creates an object id for the QObject obj . | |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
Provides an interface for receiving DCOP messages.This class provides an interface for receiving DCOP messages. To use it, simply multiply-inherit from DCOPObject and from some other class, and then implement the DCOPObject::process() method. Because this method is pure virtual, you must implement the method.
Note that it is usually more convenient to mark a section in the class with "k_dcop:", add your DCOP methods there and let the IDL compiler do the rest. Read the tutorials for more information.
- See also:
- DCOPClient
- Author:
- Preston Brown <pbrown@kde.org>, Matthias Ettrich <ettrich@kde.org>
Definition at line 65 of file dcopobject.h.
Constructor & Destructor Documentation
|
Creates a DCOPObject and calculates the object id using its physical memory address.
Definition at line 47 of file dcopobject.cpp. References QCString::sprintf(). |
|
Creates a DCOPObject and calculates the object id using QObject::name().
Definition at line 54 of file dcopobject.cpp. References QCString::mid(), QObject::name(), QObject::parent(), and QCString::prepend(). |
|
Creates a DCOPObject with object Id
Definition at line 69 of file dcopobject.cpp. References QCString::isEmpty(), and QCString::sprintf(). |
|
Destroys the DCOPObject and removes it from the map of known objects.
Definition at line 78 of file dcopobject.cpp. References DCOPClient::disconnectDCOPSignal(), DCOPClient::mainClient(), and objId(). |
Member Function Documentation
|
Returns the object id of the DCOPObject.
Definition at line 112 of file dcopobject.cpp. Referenced by connectDCOPSignal(), disconnectDCOPSignal(), emitDCOPSignal(), MyDCOPObject::process(), and ~DCOPObject(). |
|
Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected.
Definition at line 98 of file dcopobject.cpp. References DCOPClient::disconnectDCOPSignal(), and DCOPClient::mainClient(). |
|
Dispatches a message. Usually you want to use an IDL compiler to automatically generate an implementation for this function. If this function returns false, then processDynamic() is called. Note to implementators: remember to call the baseclasses implementation. It handles the functions "functions()" and "interfaces()" which return the lists of supported functions and interfaces, respectively.
Reimplemented in KUniqueApplication, and MyDCOPObject. Definition at line 166 of file dcopobject.cpp. References functions(), interfaces(), and processDynamic(). Referenced by MyDCOPObject::process(). |
|
This function is of interest when you used an IDL compiler to generate the implementation for process() but you still want to dispatch some functions dynamically. Dynamically means that methods may appear and vanish during runtime.
Definition at line 183 of file dcopobject.cpp. Referenced by process(). |
|
This function is of interest when you used an IDL compiler to generate the implementation for functions() but you still want to list some functions dynamically. Dynamically means that the methods may appear and vanish during runtime.
Definition at line 193 of file dcopobject.cpp. Referenced by functions(). |
|
This function is of interest when you used an IDL compiler to generate the implementation for interfaces() but you still want to list some interfaces dynamically. Dynamically means that they may appear and vanish during runtime.
Definition at line 187 of file dcopobject.cpp. Referenced by interfaces(). |
|
Returns the names of the interfaces, specific ones last. The functions gets reimplemented by the IDL compiler. If you don't use the IDL compiler, consider implementing this function manually if you want your object to be easily explorable.
Definition at line 198 of file dcopobject.cpp. References interfacesDynamic(). Referenced by process(). |
|
Returns the list of functions understood by the object. It gets reimplemented by the IDL compiler. If you don't use the IDL compiler, consider implementing this function manually if you want your object to be easily scriptable. Rationale: functions() allows an interpreter to do client-side type-casting properly. Note to implementators: remember to call the baseclasses implementation.
Reimplemented in MyDCOPObject. Definition at line 205 of file dcopobject.cpp. References functionsDynamic(), and QValueList::prepend(). Referenced by MyDCOPObject::functions(), and process(). |
|
Emit
Definition at line 213 of file dcopobject.cpp. References DCOPClient::emitDCOPSignal(), DCOPClient::mainClient(), and objId(). |
|
Connects to a DCOP signal.
Definition at line 220 of file dcopobject.cpp. References DCOPClient::connectDCOPSignal(), DCOPClient::mainClient(), and objId(). |
|
Disconnects a DCOP signal.
A special case is when both
Definition at line 234 of file dcopobject.cpp. References DCOPClient::disconnectDCOPSignal(), DCOPClient::mainClient(), and objId(). |
|
Returns the DCOPClient responsible for making the call. Only call this function while you are handling a DCOP call.
Definition at line 88 of file dcopobject.cpp. |
|
Checks whether an object with the given id is known in this process.
Definition at line 117 of file dcopobject.cpp. |
|
Try to find a dcop object with the given id. This function does not query the DCOPObjectProxy.
Definition at line 125 of file dcopobject.cpp. |
|
Tries to find an object using a partial object id. This function is used for multicasting a DCOP message to several objects inside a single process.
Definition at line 135 of file dcopobject.cpp. References QPtrList::append(), and QCString::length(). |
|
Creates an object id for the QObject This is done using the QObject::name() function.
Definition at line 146 of file dcopobject.cpp. References QCString::mid(), QObject::name(), QObject::parent(), and QCString::prepend(). |
The documentation for this class was generated from the following files: