.TH "DCOPObject" kde3 "11 Jun 2005" "Version Version 3.4.1" "dcop Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
DCOPObject \- Provides an interface for receiving DCOP messages.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <dcopobject.h>\fP
.PP
Inherited by DefaultTest\fC [virtual]\fP, HashingTest\fC [virtual]\fP, \fBKAppDCOPInterface\fP\fC [virtual]\fP, \fBKDebugDCOPIface\fP\fC [virtual]\fP, \fBKUniqueApplication\fP, MyDCOPObject, MyDCOPObject, NoFunctions, NonHashingTest\fC [virtual]\fP, SignalTest\fC [virtual]\fP, \fBTest\fP\fC [virtual]\fP, Test2, and TheNameSpace::Test3.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBDCOPObject\fP ()"
.br
.ti -1c
.RI "\fBDCOPObject\fP (\fBQObject\fP *obj)"
.br
.ti -1c
.RI "\fBDCOPObject\fP (const \fBQCString\fP &objId)"
.br
.ti -1c
.RI "virtual \fB~DCOPObject\fP ()"
.br
.ti -1c
.RI "\fBQCString\fP \fBobjId\fP () const "
.br
.ti -1c
.RI "bool \fBsetObjId\fP (const \fBQCString\fP &objId)"
.br
.ti -1c
.RI "virtual bool \fBprocess\fP (const \fBQCString\fP &fun, const \fBQByteArray\fP &data, \fBQCString\fP &replyType, \fBQByteArray\fP &replyData)"
.br
.ti -1c
.RI "virtual bool \fBprocessDynamic\fP (const \fBQCString\fP &fun, const \fBQByteArray\fP &data, \fBQCString\fP &replyType, \fBQByteArray\fP &replyData)"
.br
.ti -1c
.RI "virtual QCStringList \fBfunctionsDynamic\fP ()"
.br
.ti -1c
.RI "virtual QCStringList \fBinterfacesDynamic\fP ()"
.br
.ti -1c
.RI "virtual QCStringList \fBinterfaces\fP ()"
.br
.ti -1c
.RI "virtual QCStringList \fBfunctions\fP ()"
.br
.ti -1c
.RI "void \fBemitDCOPSignal\fP (const \fBQCString\fP &signal, const \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "bool \fBconnectDCOPSignal\fP (const \fBQCString\fP &sender, const \fBQCString\fP &senderObj, const \fBQCString\fP &signal, const \fBQCString\fP &slot, bool Volatile)"
.br
.ti -1c
.RI "bool \fBdisconnectDCOPSignal\fP (const \fBQCString\fP &sender, const \fBQCString\fP &senderObj, const \fBQCString\fP &signal, const \fBQCString\fP &slot)"
.br
.ti -1c
.RI "\fBDCOPClient\fP * \fBcallingDcopClient\fP ()"
.br
.ti -1c
.RI "void \fBsetCallingDcopClient\fP (\fBDCOPClient\fP *)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static bool \fBhasObject\fP (const \fBQCString\fP &objId)"
.br
.ti -1c
.RI "static \fBDCOPObject\fP * \fBfind\fP (const \fBQCString\fP &objId)"
.br
.ti -1c
.RI "static \fBQPtrList\fP< \fBDCOPObject\fP > \fBmatch\fP (const \fBQCString\fP &partialId)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBobjectName\fP (\fBQObject\fP *obj)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
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 \fBDCOPObject::process()\fP method. Because this method is pure virtual, you must implement the method.
.PP
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.
.PP
\fBSee also:\fP
.RS 4
\fBDCOPClient\fP 
.PP
\fBDCOPObjectProxy\fP 
.RE
.PP
\fBAuthor:\fP
.RS 4
Preston Brown <pbrown@kde.org>, Matthias Ettrich <ettrich@kde.org> 
.RE
.PP

.PP
Definition at line 67 of file dcopobject.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "DCOPObject::DCOPObject ()"
.PP
Creates a DCOPObject and calculates the object id using its physical memory address. 
.PP
Definition at line 47 of file dcopobject.cpp.
.PP
References QCString::insert(), and QCString::sprintf().
.SS "DCOPObject::DCOPObject (\fBQObject\fP * obj)"
.PP
Creates a DCOPObject and calculates the object id using \fBQObject::name()\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIobj\fP the object to extract the name from 
.RE
.PP

.PP
Definition at line 54 of file dcopobject.cpp.
.PP
References QCString::insert(), QCString::mid(), QObject::name(), QObject::parent(), and QCString::prepend().
.SS "DCOPObject::DCOPObject (const \fBQCString\fP & objId)"
.PP
Creates a DCOPObject with object Id \fCobjId\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIobjId\fP the object id of the DCOP object 
.RE
.PP

.PP
Definition at line 69 of file dcopobject.cpp.
.PP
References QCString::insert(), QCString::isEmpty(), and QCString::sprintf().
.SS "DCOPObject::~\fBDCOPObject\fP ()\fC [virtual]\fP"
.PP
Destroys the DCOPObject and removes it from the map of known objects. 
.PP
Definition at line 78 of file dcopobject.cpp.
.PP
References DCOPClient::disconnectDCOPSignal(), DCOPClient::mainClient(), and objId().
.SH "Member Function Documentation"
.PP 
.SS "\fBQCString\fP DCOPObject::objId () const"
.PP
Returns the object id of the DCOPObject. 
.PP
\fBReturns:\fP
.RS 4
the object's id 
.RE
.PP

.PP
Definition at line 112 of file dcopobject.cpp.
.PP
Referenced by connectDCOPSignal(), disconnectDCOPSignal(), emitDCOPSignal(), setObjId(), and ~DCOPObject().
.SS "bool DCOPObject::setObjId (const \fBQCString\fP & objId)"
.PP
Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected. 
.PP
\fBParameters:\fP
.RS 4
\fIobjId\fP the new object id 
.RE
.PP

.PP
Definition at line 98 of file dcopobject.cpp.
.PP
References DCOPClient::disconnectDCOPSignal(), find(), QCString::insert(), DCOPClient::mainClient(), and objId().
.SS "bool DCOPObject::process (const \fBQCString\fP & fun, const \fBQByteArray\fP & data, \fBQCString\fP & replyType, \fBQByteArray\fP & replyData)\fC [virtual]\fP"
.PP
Dispatches a message. 
.PP
Usually you want to use an IDL compiler to automatically generate an implementation for this function.
.PP
If this function returns false, then \fBprocessDynamic()\fP is called.
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIfun\fP is the normalized function signature. Such a signature usually looks like foobar(QString,int). The return type, qualifiers like 'const' etc. are not part of the signature. 
.br
\fIdata\fP the received data 
.br
\fIreplyType\fP write the reply type in this string 
.br
\fIreplyData\fP write the reply data in this array 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise. The default implementation returns false for all \fCfun\fP except 'functions()' and 'interfaces()'.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBDCOPClient::normalizeFunctionSignature()\fP 
.PP
\fBfunctions()\fP 
.PP
\fBDCOPClient::process()\fP 
.RE
.PP

.PP
Reimplemented in \fBKUniqueApplication\fP.
.PP
Definition at line 166 of file dcopobject.cpp.
.PP
References functions(), interfaces(), and processDynamic().
.SS "bool DCOPObject::processDynamic (const \fBQCString\fP & fun, const \fBQByteArray\fP & data, \fBQCString\fP & replyType, \fBQByteArray\fP & replyData)\fC [virtual]\fP"
.PP
This function is of interest when you used an IDL compiler to generate the implementation for \fBprocess()\fP but you still want to dispatch some functions dynamically. 
.PP
Dynamically means that methods may appear and vanish during runtime.
.PP
\fBParameters:\fP
.RS 4
\fIfun\fP is the normalized function signature. Such a signature usually looks like foobar(QString,int). The return type, qualifiers like 'const' etc. are not part of the signature. 
.br
\fIdata\fP the received data 
.br
\fIreplyType\fP write the reply type in this string 
.br
\fIreplyData\fP write the reply data in this array 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise. The default implementation returns always false. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBprocess()\fP 
.PP
\fBDCOPClient::normalizeFunctionSignature()\fP 
.PP
\fBfunctions()\fP, 
.PP
\fBDCOPClient::process()\fP 
.RE
.PP

.PP
Definition at line 183 of file dcopobject.cpp.
.PP
Referenced by process().
.SS "QCStringList DCOPObject::functionsDynamic ()\fC [virtual]\fP"
.PP
This function is of interest when you used an IDL compiler to generate the implementation for \fBfunctions()\fP but you still want to list some functions dynamically. 
.PP
Dynamically means that the methods may appear and vanish during runtime.
.PP
\fBReturns:\fP
.RS 4
A list of the additional functions, default is an empty list.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBfunctions()\fP, 
.RE
.PP

.PP
Definition at line 193 of file dcopobject.cpp.
.PP
Referenced by functions().
.SS "QCStringList DCOPObject::interfacesDynamic ()\fC [virtual]\fP"
.PP
This function is of interest when you used an IDL compiler to generate the implementation for \fBinterfaces()\fP but you still want to list some interfaces dynamically. 
.PP
Dynamically means that they may appear and vanish during runtime.
.PP
\fBReturns:\fP
.RS 4
A list of the additional interfaces, default is an empty list.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBinterfaces()\fP, 
.RE
.PP

.PP
Definition at line 187 of file dcopobject.cpp.
.PP
Referenced by interfaces().
.SS "QCStringList DCOPObject::interfaces ()\fC [virtual]\fP"
.PP
Returns the names of the interfaces, specific ones last. 
.PP
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.
.PP
\fBReturns:\fP
.RS 4
a list of interfaces 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBfunctions()\fP 
.RE
.PP

.PP
Definition at line 198 of file dcopobject.cpp.
.PP
References interfacesDynamic().
.PP
Referenced by process().
.SS "QCStringList DCOPObject::functions ()\fC [virtual]\fP"
.PP
Returns the list of functions understood by the object. 
.PP
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.
.PP
Rationale: \fBfunctions()\fP allows an interpreter to do client-side type-casting properly.
.PP
Note to implementators: remember to call the baseclasses implementation.
.PP
\fBReturns:\fP
.RS 4
a list of functions 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBinterfaces()\fP 
.PP
\fBprocess()\fP 
.PP
\fBprocessDynamic()\fP 
.PP
\fBDCOPClient::normalizeFunctionSignature()\fP 
.RE
.PP

.PP
Definition at line 205 of file dcopobject.cpp.
.PP
References functionsDynamic(), and QValueList::prepend().
.PP
Referenced by process().
.SS "void DCOPObject::emitDCOPSignal (const \fBQCString\fP & signal, const \fBQByteArray\fP & data)"
.PP
Emit \fCsignal\fP as DCOP signal from this object with \fCdata\fP as arguments. 
.PP
\fBParameters:\fP
.RS 4
\fIsignal\fP the signal to emit 
.br
\fIdata\fP the data to send 
.RE
.PP

.PP
Definition at line 213 of file dcopobject.cpp.
.PP
References DCOPClient::emitDCOPSignal(), DCOPClient::mainClient(), and objId().
.SS "bool DCOPObject::connectDCOPSignal (const \fBQCString\fP & sender, const \fBQCString\fP & senderObj, const \fBQCString\fP & signal, const \fBQCString\fP & slot, bool Volatile)"
.PP
Connects to a DCOP signal. 
.PP
\fBParameters:\fP
.RS 4
\fIsender\fP the name of the client that emits the signal. When empty the signal will be passed from any client. 
.br
\fIsenderObj\fP the name of the sending object that emits the signal. 
.br
\fIsignal\fP the name of the signal. The arguments should match with slot. 
.br
\fIslot\fP The name of the slot to call. Its arguments should match with signal. 
.br
\fIVolatile\fP If true, the connection will not be reestablished when \fCsender\fP unregisters and reregisters with DCOP. In this case the \fCsender\fP must be registered when the connection is made. If false, the connection will be reestablished when \fCsender\fP reregisters. In this case the connection can be made even if \fCsender\fP is not registered at that time.
.RE
.PP
\fBReturns:\fP
.RS 4
false if a connection could not be established. This will be the case when 
.PD 0

.IP "\(bu" 2
\fCVolatile\fP is true and \fCsender\fP does not exist. 
.IP "\(bu" 2
\fCsignal\fP and \fCslot\fP do not have matching arguments. 
.PP
.RE
.PP

.PP
Definition at line 220 of file dcopobject.cpp.
.PP
References DCOPClient::connectDCOPSignal(), DCOPClient::mainClient(), and objId().
.SS "bool DCOPObject::disconnectDCOPSignal (const \fBQCString\fP & sender, const \fBQCString\fP & senderObj, const \fBQCString\fP & signal, const \fBQCString\fP & slot)"
.PP
Disconnects a DCOP signal. 
.PP
A special case is when both \fCsender\fP & \fCsignal\fP are empty. In this case all connections related to this object in the current client are disconnected. (Both connections from as well as to this object!)
.PP
\fBParameters:\fP
.RS 4
\fIsender\fP the name of the client that emits the signal. 
.br
\fIsenderObj\fP the name of the object that emits the signal. If empty all objects will be disconnected. 
.br
\fIsignal\fP the name of the signal. The arguments should match with slot. If empty all objects will be disconnected. 
.br
\fIslot\fP The name of the slot the signal is connected to. If empty all slots will be disconnected.
.RE
.PP
\fBReturns:\fP
.RS 4
false if no connection(s) where removed. 
.RE
.PP

.PP
Definition at line 234 of file dcopobject.cpp.
.PP
References DCOPClient::disconnectDCOPSignal(), DCOPClient::mainClient(), and objId().
.SS "\fBDCOPClient\fP * DCOPObject::callingDcopClient ()"
.PP
Returns the \fBDCOPClient\fP responsible for making the call. 
.PP
Only call this function while you are handling a DCOP call. 
.PP
\fBReturns:\fP
.RS 4
the \fBDCOPClient\fP responsible for making the call. This information is only guaranteed to be correct when entering your DCOP function. 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 88 of file dcopobject.cpp.
.SS "bool DCOPObject::hasObject (const \fBQCString\fP & objId)\fC [static]\fP"
.PP
Checks whether an object with the given id is known in this process. 
.PP
\fBReturns:\fP
.RS 4
true if an object with the questionable \fCobjId\fP is known in this process. This query does not ask proxies.
.RE
.PP
\fBDCOPObjectProxy\fP 
.PP
Definition at line 117 of file dcopobject.cpp.
.SS "\fBDCOPObject\fP * DCOPObject::find (const \fBQCString\fP & objId)\fC [static]\fP"
.PP
Try to find a dcop object with the given id. 
.PP
This function does not query the \fBDCOPObjectProxy\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIobjId\fP the object id to search 
.RE
.PP
\fBReturns:\fP
.RS 4
the DCOPObject for the id \fCobjId\fP. 
.RE
.PP

.PP
Definition at line 125 of file dcopobject.cpp.
.PP
References QMap::find().
.PP
Referenced by setObjId().
.SS "\fBQPtrList\fP< \fBDCOPObject\fP > DCOPObject::match (const \fBQCString\fP & partialId)\fC [static]\fP"
.PP
Tries to find an object using a partial object id. 
.PP
This function is used for multicasting a DCOP message to several objects inside a single process.
.PP
\fBParameters:\fP
.RS 4
\fIpartialId\fP the partial object id to search for 
.RE
.PP
\fBReturns:\fP
.RS 4
a list of DCOPObjects beginning with the string contained in \fCpartialId\fP. 
.RE
.PP

.PP
Definition at line 135 of file dcopobject.cpp.
.PP
References QPtrList::append().
.SS "\fBQCString\fP DCOPObject::objectName (\fBQObject\fP * obj)\fC [static]\fP"
.PP
Creates an object id for the \fBQObject\fP \fCobj\fP. 
.PP
This is done using the \fBQObject::name()\fP function. 
.PP
\fBParameters:\fP
.RS 4
\fIobj\fP the object whose name will be used 
.RE
.PP
\fBReturns:\fP
.RS 4
the created object id 
.RE
.PP

.PP
Definition at line 146 of file dcopobject.cpp.
.PP
References QCString::mid(), QObject::name(), QObject::parent(), and QCString::prepend().

.SH "Author"
.PP 
Generated automatically by Doxygen for dcop Library from the source code.
