.TH "DCOPClient" 3 "28 Jan 2004" "dcop Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
DCOPClient \- Inter-process communication and remote procedure calls for \fBKDE\fP applications.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <dcopclient.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBapplicationRegistered\fP (const  \fBQCString\fP &appId)"
.br
.RI "\fIIndicates that the application \fCappId\fP has been registered with the server we are attached to. \fP"
.ti -1c
.RI "void \fBapplicationRemoved\fP (const  \fBQCString\fP &appId)"
.br
.RI "\fIIndicates that the formerly registered application \fCappId\fP has been removed. \fP"
.ti -1c
.RI "void \fBattachFailed\fP (const  \fBQString\fP &msg)"
.br
.RI "\fIIndicates that the process of establishing DCOP communications failed in some manner. \fP"
.ti -1c
.RI "void \fBblockUserInput\fP (bool block)"
.br
.RI "\fIIndicates that user input shall be blocked or released, depending on the argument. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBDCOPClient\fP ()"
.br
.RI "\fIConstructs a new DCOP client, but does not attach to any server. \fP"
.ti -1c
.RI "virtual \fB~DCOPClient\fP ()"
.br
.RI "\fICleans up any open connections and dynamic data. \fP"
.ti -1c
.RI "bool \fBattach\fP ()"
.br
.RI "\fIAttaches to the DCOP server. \fP"
.ti -1c
.RI "void \fBbindToApp\fP ()"
.br
.ti -1c
.RI "bool \fBdetach\fP ()"
.br
.RI "\fIDetaches from the DCOP server. \fP"
.ti -1c
.RI "bool \fBisAttached\fP () const "
.br
.RI "\fIReturns whether or not the client is attached to the server. \fP"
.ti -1c
.RI "bool \fBisAttachedToForeignServer\fP () const "
.br
.RI "\fIReturns whether the client is attached to a server owned by another user. \fP"
.ti -1c
.RI "bool \fBacceptCalls\fP () const "
.br
.RI "\fIReturns whether the client handles incoming calls. \fP"
.ti -1c
.RI "void \fBsetAcceptCalls\fP (bool b)"
.br
.RI "\fISpecify whether the client should accept incoming calls. \fP"
.ti -1c
.RI "bool \fBqtBridgeEnabled\fP ()"
.br
.RI "\fIReturns whether the DCOP - \fBQt\fP bridge is enabled. \fP"
.ti -1c
.RI "void \fBsetQtBridgeEnabled\fP (bool b)"
.br
.RI "\fISpecify whether \fBQt\fP objects of the application should be accessible via DCOP. \fP"
.ti -1c
.RI "\fBQCString\fP \fBregisterAs\fP (const  \fBQCString\fP &appId, bool addPID=true)"
.br
.RI "\fIRegisters at the DCOP server. \fP"
.ti -1c
.RI "bool \fBisRegistered\fP () const "
.br
.RI "\fIReturns whether or not the client is registered at the server. \fP"
.ti -1c
.RI "\fBQCString\fP \fBappId\fP () const "
.br
.RI "\fIReturns the current app id or a null string if the application hasn't yet been registered. \fP"
.ti -1c
.RI "int \fBsocket\fP () const "
.br
.RI "\fIReturns the socket fd that is used for communication with the server. \fP"
.ti -1c
.RI "void \fBsuspend\fP ()"
.br
.RI "\fITemporarily suspends processing of DCOP events. \fP"
.ti -1c
.RI "void \fBresume\fP ()"
.br
.RI "\fIResumes the processing of DCOP events. \fP"
.ti -1c
.RI "bool \fBisSuspended\fP () const "
.br
.RI "\fIReturns whether DCOP events are being processed. \fP"
.ti -1c
.RI "bool \fBsend\fP (const  \fBQCString\fP &remApp, const  \fBQCString\fP &remObj, const  \fBQCString\fP &remFun, const  \fBQByteArray\fP &data)"
.br
.RI "\fISends a data block to the server. \fP"
.ti -1c
.RI "bool \fBsend\fP (const  \fBQCString\fP &remApp, const  \fBQCString\fP &remObj, const  \fBQCString\fP &remFun, const  \fBQString\fP &data)"
.br
.RI "\fIThis function acts exactly the same as the above, but the data parameter can be specified as a \fBQString\fP for convenience. \fP"
.ti -1c
.RI "bool \fBcall\fP (const  \fBQCString\fP &remApp, const  \fBQCString\fP &remObj, const  \fBQCString\fP &remFun, const  \fBQByteArray\fP &data, \fBQCString\fP &replyType, \fBQByteArray\fP &replyData, bool useEventLoop=false)"
.br
.RI "\fIPerforms a synchronous send and receive. \fP"
.ti -1c
.RI "bool \fBfindObject\fP (const  \fBQCString\fP &remApp, const  \fBQCString\fP &remObj, const  \fBQCString\fP &remFun, const  \fBQByteArray\fP &data, \fBQCString\fP &foundApp, \fBQCString\fP &foundObj, bool useEventLoop=false)"
.br
.RI "\fISearches for an object which matches a criteria. \fP"
.ti -1c
.RI "void \fBemitDCOPSignal\fP (const  \fBQCString\fP &object, const  \fBQCString\fP &signal, const  \fBQByteArray\fP &data)"
.br
.RI "\fIEmits \fCsignal\fP as DCOP signal from object \fCobject\fP with \fCdata\fP as arguments. \fP"
.ti -1c
.RI "void \fBemitDCOPSignal\fP (const  \fBQCString\fP &signal, const  \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "bool \fBconnectDCOPSignal\fP (const  \fBQCString\fP &\fBsender\fP, const  \fBQCString\fP &senderObj, const  \fBQCString\fP &signal, const  \fBQCString\fP &receiverObj, const  \fBQCString\fP &slot, bool Volatile)"
.br
.RI "\fIConnects to a DCOP signal. \fP"
.ti -1c
.RI "bool \fBconnectDCOPSignal\fP (const  \fBQCString\fP &\fBsender\fP, const  \fBQCString\fP &signal, const  \fBQCString\fP &receiverObj, const  \fBQCString\fP &slot, bool Volatile)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP For backwards compatibility \fP"
.ti -1c
.RI "bool \fBdisconnectDCOPSignal\fP (const  \fBQCString\fP &\fBsender\fP, const  \fBQCString\fP &senderObj, const  \fBQCString\fP &signal, const  \fBQCString\fP &receiverObj, const  \fBQCString\fP &slot)"
.br
.RI "\fIDisconnects a DCOP signal. \fP"
.ti -1c
.RI "bool \fBdisconnectDCOPSignal\fP (const  \fBQCString\fP &\fBsender\fP, const  \fBQCString\fP &signal, const  \fBQCString\fP &receiverObj, const  \fBQCString\fP &slot)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP For backwards compatibility \fP"
.ti -1c
.RI "virtual bool \fBprocess\fP (const  \fBQCString\fP &fun, const  \fBQByteArray\fP &data, \fBQCString\fP &replyType, \fBQByteArray\fP &replyData)"
.br
.RI "\fIReimplement this function to handle app-wide function calls unassociated w/an object. \fP"
.ti -1c
.RI "DCOPClientTransaction * \fBbeginTransaction\fP ()"
.br
.RI "\fIDelays the reply of the current function call until \fBendTransaction\fP() is called. \fP"
.ti -1c
.RI "void \fBendTransaction\fP (DCOPClientTransaction *t, \fBQCString\fP &replyType, \fBQByteArray\fP &replyData)"
.br
.RI "\fISends the delayed reply of a function call. \fP"
.ti -1c
.RI "Q_INT32 \fBtransactionId\fP () const "
.br
.RI "\fITest whether the current function call is delayed. \fP"
.ti -1c
.RI "bool \fBisApplicationRegistered\fP (const  \fBQCString\fP &remApp)"
.br
.RI "\fIChecks whether \fCremApp\fP is registered with the DCOP server. \fP"
.ti -1c
.RI "\fBQCStringList\fP \fBregisteredApplications\fP ()"
.br
.RI "\fIRetrieves the list of all currently registered applications from dcopserver. \fP"
.ti -1c
.RI "\fBQCStringList\fP \fBremoteObjects\fP (const  \fBQCString\fP &remApp, bool *ok=0)"
.br
.RI "\fIRetrieves the list of objects of the remote application \fCremApp\fP. \fP"
.ti -1c
.RI "\fBQCStringList\fP \fBremoteInterfaces\fP (const  \fBQCString\fP &remApp, const  \fBQCString\fP &remObj, bool *ok=0)"
.br
.RI "\fIRetrieves the list of interfaces of the remote object \fCremObj\fP of application \fCremApp\fP. \fP"
.ti -1c
.RI "\fBQCStringList\fP \fBremoteFunctions\fP (const  \fBQCString\fP &remApp, const  \fBQCString\fP &remObj, bool *ok=0)"
.br
.RI "\fIRetrieves the list of functions of the remote object \fCremObj\fP of application \fCremApp\fP. \fP"
.ti -1c
.RI "bool \fBreceive\fP (const  \fBQCString\fP &app, const  \fBQCString\fP &obj, const  \fBQCString\fP &fun, const  \fBQByteArray\fP &data, \fBQCString\fP &replyType, \fBQByteArray\fP &replyData)"
.br
.ti -1c
.RI "bool \fBfind\fP (const  \fBQCString\fP &app, const  \fBQCString\fP &obj, const  \fBQCString\fP &fun, const  \fBQByteArray\fP &data, \fBQCString\fP &replyType, \fBQByteArray\fP &replyData)"
.br
.ti -1c
.RI "\fBQCString\fP \fBsenderId\fP () const "
.br
.RI "\fIReturns the appId of the last application that talked to us. \fP"
.ti -1c
.RI "void \fBsetDefaultObject\fP (const  \fBQCString\fP &objId)"
.br
.RI "\fIInstalls object \fCobjId\fP as application-wide default object. \fP"
.ti -1c
.RI "\fBQCString\fP \fBdefaultObject\fP () const "
.br
.RI "\fIReturns the current default object or an empty string if no object is installed as default object. \fP"
.ti -1c
.RI "void \fBsetNotifications\fP (bool enabled)"
.br
.RI "\fIEnables / disables the \fBapplicationRegistered\fP() / \fBapplicationRemoved\fP() signals. \fP"
.ti -1c
.RI "void \fBsetDaemonMode\fP (bool daemonMode)"
.br
.RI "\fITells the dcopserver to treat the client as daemon client, not as regular client. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "void \fBsetServerAddress\fP (const  \fBQCString\fP &addr)"
.br
.RI "\fISets the address of a server to use upon attaching. \fP"
.ti -1c
.RI "\fBQCString\fP \fBnormalizeFunctionSignature\fP (const  \fBQCString\fP &fun)"
.br
.RI "\fINormalizes the function signature \fCfun\fP. \fP"
.ti -1c
.RI "\fBDCOPClient\fP * \fBmainClient\fP ()"
.br
.RI "\fIReturns the application's main dcop client. \fP"
.ti -1c
.RI "void \fBsetMainClient\fP (\fBDCOPClient\fP *mainClient)"
.br
.RI "\fISets the application's main dcop client. \fP"
.ti -1c
.RI "void \fBemergencyClose\fP ()"
.br
.ti -1c
.RI "const  char * \fBpostMortemSender\fP ()"
.br
.ti -1c
.RI "const  char * \fBpostMortemObject\fP ()"
.br
.ti -1c
.RI "const  char * \fBpostMortemFunction\fP ()"
.br
.ti -1c
.RI "\fBQCString\fP \fBdcopServerFile\fP (const  \fBQCString\fP &hostname=0)"
.br
.RI "\fIFile with information how to reach the dcopserver. \fP"
.ti -1c
.RI "\fBQCString\fP \fBdcopServerFileOld\fP (const  \fBQCString\fP &hostname=0)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP For backwards compatibility with \fBKDE\fP 2.x \fP"
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBprocessSocketData\fP (int socknum)"
.br
.RI "\fIProcess data from the socket. \fP"
.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 
Inter-process communication and remote procedure calls for \fBKDE\fP applications. 

This class provides IPC and RPC for \fBKDE\fP applications. Usually you will not have to instantiate one yourself because \fBKApplication\fP contains a method to return a pointer to a DCOPClient object which can be used for your whole application.
.PP
Before being able to send or receive any DCOP messages, you will have to attach your client object to the DCOP server, and then register your application with a specific name. See \fBattach\fP() and \fBregisterAs\fP() for more information.
.PP
Data to be sent should be serialized into a \fBQDataStream\fP which was initialized with the \fBQByteArray\fP that you actually intend to send the data in. An example of how you might do this:
.PP
.PP
.nf

   \fBQByteArray\fP data;
   \fBQDataStream\fP arg(data, IO_WriteOnly);
   arg << \fBQString\fP('This is text I am serializing');
   client->send('someApp', 'someObject', 'someFunction', arg);
 
.PP
.PP
\fBSee also:\fP
.RS 4
\fBKApplication::dcopClient()\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 dcopclient.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "DCOPClient::DCOPClient ()"
.PP
Constructs a new DCOP client, but does not attach to any server. Definition at line 490 of file dcopclient.cpp.
.PP
References QObject::connect(), mainClient(), and setMainClient().
.SS "DCOPClient::~\fBDCOPClient\fP ()\fC [virtual]\fP"
.PP
Cleans up any open connections and dynamic data. Definition at line 514 of file dcopclient.cpp.
.PP
References detach(), mainClient(), and setMainClient().
.SH "Member Function Documentation"
.PP 
.SS "void DCOPClient::setServerAddress (const \fBQCString\fP & addr)\fC [static]\fP"
.PP
Sets the address of a server to use upon attaching. If no server address is ever specified, attach will try its best to find the server anyway. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP the new address of the server 
.RE
.PP
Definition at line 531 of file dcopclient.cpp.
.SS "bool DCOPClient::attach ()"
.PP
Attaches to the DCOP server. If the connection was already attached, the connection will be re-established with the current server address.
.PP
Naturally, only attached application can use DCOP services.
.PP
If a \fBQApplication\fP object exists then client registers itself as QApplication::name() + '-' + <pid>. If no \fBQApplication\fP object exists the client registers itself as 'anonymous'.
.PP
If you want to register differently, you should use \fBregisterAs()\fP instead.
.PP
\fBReturns:\fP
.RS 4
true if attaching was successful. 
.RE
.PP
Definition at line 539 of file dcopclient.cpp.
.SS "bool DCOPClient::detach ()"
.PP
Detaches from the DCOP server. \fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP
Definition at line 752 of file dcopclient.cpp.
.PP
Referenced by processSocketData(), registerAs(), and ~DCOPClient().
.SS "bool DCOPClient::isAttached () const"
.PP
Returns whether or not the client is attached to the server. \fBReturns:\fP
.RS 4
true if attached, false if not 
.RE
.PP
Definition at line 775 of file dcopclient.cpp.
.PP
Referenced by acceptCalls(), endTransaction(), isAttachedToForeignServer(), registerAs(), and send().
.SS "bool DCOPClient::isAttachedToForeignServer () const"
.PP
Returns whether the client is attached to a server owned by another user. \fBReturns:\fP
.RS 4
true if attached to a foreign server, false if not 
.RE
.PP
Definition at line 783 of file dcopclient.cpp.
.PP
References isAttached().
.SS "bool DCOPClient::acceptCalls () const"
.PP
Returns whether the client handles incoming calls. \fBReturns:\fP
.RS 4
true if the client accepts calls 
.RE
.PP
Definition at line 788 of file dcopclient.cpp.
.PP
References isAttached().
.SS "void DCOPClient::setAcceptCalls (bool b)"
.PP
Specify whether the client should accept incoming calls. By default clients accept incoming calls, but not when connected to a foreign server. 
.PP
\fBParameters:\fP
.RS 4
\fIb\fP true to accept calls, false to reject them 
.RE
.PP
Definition at line 793 of file dcopclient.cpp.
.SS "bool DCOPClient::qtBridgeEnabled ()"
.PP
Returns whether the DCOP - \fBQt\fP bridge is enabled. By default the DCOP - \fBQt\fP bridge is enabled. 
.PP
\fBReturns:\fP
.RS 4
true if \fBQt\fP objects are accessible over DCOP 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 799 of file dcopclient.cpp.
.SS "void DCOPClient::setQtBridgeEnabled (bool b)"
.PP
Specify whether \fBQt\fP objects of the application should be accessible via DCOP. By default the DCOP - \fBQt\fP bridge is enabled. 
.PP
\fBParameters:\fP
.RS 4
\fIb\fP true to make \fBQt\fP objects accessible over DCOP 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 804 of file dcopclient.cpp.
.SS "\fBQCString\fP DCOPClient::registerAs (const \fBQCString\fP & appId, bool addPID = true)"
.PP
Registers at the DCOP server. If the application was already registered, the registration will be re-done with the new \fBappId\fP.
.PP
\fCappId\fP is a \fCunique\fP application/program id that the server will use to associate requests with. If there is already an application registered with the same name, the server will add a number to the id to unify it. If \fCaddPID\fP is true, the PID of the current process will be added to id.
.PP
Registration is necessary if you want to allow other clients to talk to you. They can do so using your \fCappId\fP as first parameter for \fBsend\fP() or \fBcall\fP(). If you just want to talk to other clients, you do not need to register at the server. In that case \fBattach\fP() is enough. It will implicitly register you as 'anonymous'.
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP the id of the application 
.br
\fIaddPID\fP true to add the process id 
.RE
.PP
\fBReturns:\fP
.RS 4
The actual \fCappId\fP used for the registration or a null string if the registration wasn't successful. 
.RE
.PP
Definition at line 809 of file dcopclient.cpp.
.PP
References call(), detach(), isAttached(), QCString::isNull(), isRegistered(), and QCString::sprintf().
.SS "bool DCOPClient::isRegistered () const"
.PP
Returns whether or not the client is registered at the server. \fBReturns:\fP
.RS 4
true if registered at the server 
.RE
.PP
Definition at line 856 of file dcopclient.cpp.
.PP
Referenced by registerAs().
.SS "\fBQCString\fP DCOPClient::appId () const"
.PP
Returns the current app id or a null string if the application hasn't yet been registered. \fBReturns:\fP
.RS 4
the application id, or QString::null if not registered 
.RE
.PP
Definition at line 862 of file dcopclient.cpp.
.SS "int DCOPClient::socket () const"
.PP
Returns the socket fd that is used for communication with the server. \fBReturns:\fP
.RS 4
The socket over which DCOP is communicating with the server. 
.RE
.PP
Definition at line 868 of file dcopclient.cpp.
.SS "void DCOPClient::suspend ()"
.PP
Temporarily suspends processing of DCOP events. This can be usefull if you need to show e.g. a dialog before your application is ready to accept DCOP requests. Normally the dialog would start an event loop and in this event loop DCOP requests will be handled.
.PP
Be aware that not responding to DCOP requests may cause other programs that want to communicate with your application, to hang. 
.PP
\fBSee also:\fP
.RS 4
\fBresume()\fP 
.PP
\fBisSuspended()\fP 
.RE
.PP
Definition at line 561 of file dcopclient.cpp.
.SS "void DCOPClient::resume ()"
.PP
Resumes the processing of DCOP events. \fBSee also:\fP
.RS 4
\fBsuspend()\fP. 
.PP
\fBisSuspended()\fP 
.RE
.PP
Definition at line 567 of file dcopclient.cpp.
.SS "bool DCOPClient::isSuspended () const"
.PP
Returns whether DCOP events are being processed. \fBSee also:\fP
.RS 4
\fBsuspend()\fP 
.PP
\fBresume()\fP. 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 573 of file dcopclient.cpp.
.SS "bool DCOPClient::send (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, const \fBQCString\fP & remFun, const \fBQByteArray\fP & data)"
.PP
Sends a data block to the server. \fBParameters:\fP
.RS 4
\fIremApp\fP The remote application id. 
.br
\fIremObj\fP The name of the remote object. 
.br
\fIremFun\fP The remote function in the specified object to call. 
.br
\fIdata\fP The data to provide to the remote function.
.RE
.PP
\fBReturns:\fP
.RS 4
Whether or not the server was able to accept the send. 
.RE
.PP
Definition at line 916 of file dcopclient.cpp.
.PP
References isAttached(), QCString::isEmpty(), normalizeFunctionSignature(), and receive().
.PP
Referenced by emitDCOPSignal(), and send().
.SS "bool DCOPClient::send (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, const \fBQCString\fP & remFun, const \fBQString\fP & data)"
.PP
This function acts exactly the same as the above, but the data parameter can be specified as a \fBQString\fP for convenience. \fBParameters:\fP
.RS 4
\fIremApp\fP The remote application id. 
.br
\fIremObj\fP The name of the remote object. 
.br
\fIremFun\fP The remote function in the specified object to call. 
.br
\fIdata\fP The data to provide to the remote function.
.RE
.PP
\fBReturns:\fP
.RS 4
Whether or not the server was able to accept the send. 
.RE
.PP
Definition at line 963 of file dcopclient.cpp.
.PP
References send().
.SS "bool DCOPClient::call (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, const \fBQCString\fP & remFun, const \fBQByteArray\fP & data, \fBQCString\fP & replyType, \fBQByteArray\fP & replyData, bool useEventLoop = false)"
.PP
Performs a synchronous send and receive. The parameters are the same as for send, with the exception of another \fBQByteArray\fP being provided for results to be (optionally) returned in.
.PP
A call blocks the application until the process receives the answer.
.PP
If \fCuseEventLoop\fP is true, a local event loop will be started after 1/10th of a second in order to keep the user interface updated (by processing paint events and such) until an answer is received.
.PP
\fBParameters:\fP
.RS 4
\fIremApp\fP the remote application's id 
.br
\fIremObj\fP the remote object id 
.br
\fIremFun\fP the remote function id 
.br
\fIdata\fP the data to send 
.br
\fIreplyType\fP the type of the reply will be written here 
.br
\fIreplyData\fP the data of the reply will be written here 
.br
\fIuseEventLoop\fP if true the event loop will be started when the call blocks too long 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsend()\fP 
.RE
.PP
Definition at line 1543 of file dcopclient.cpp.
.PP
References QCString::isEmpty(), and receive().
.PP
Referenced by connectDCOPSignal(), disconnectDCOPSignal(), isApplicationRegistered(), registerAs(), registeredApplications(), remoteFunctions(), remoteInterfaces(), remoteObjects(), setDaemonMode(), and setNotifications().
.SS "bool DCOPClient::findObject (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, const \fBQCString\fP & remFun, const \fBQByteArray\fP & data, \fBQCString\fP & foundApp, \fBQCString\fP & foundObj, bool useEventLoop = false)"
.PP
Searches for an object which matches a criteria. findObject calls \fCremFun\fP in the applications and objects identified by \fCremApp\fP and \fCremObj\fP until \fCremFun\fP returns true. The name of the application and object that returned true are returned in \fCfoundApp\fP and \fCfoundObj\fP respectively.
.PP
If \fCremFun\fP is empty a default function is called in the object which always returns \fCtrue\fP.
.PP
A findObject blocks the application until the process receives the answer.
.PP
If \fCuseEventLoop\fP is true, a local event loop will be started after 1/10th of a second in order to keep the user interface updated (by processing paint events and such) until an answer is received.
.PP
\fBParameters:\fP
.RS 4
\fIremApp\fP The remote application id. 
.br
\fIremObj\fP The name of the remote object. 
.br
\fIremFun\fP The remote function in the specified object to call. This function should return a bool and is used as criteria. 
.br
\fIdata\fP The data to provide to the remote function. 
.br
\fIfoundApp\fP The remote application id that matched the criteria. 
.br
\fIfoundObj\fP The remote object that matched the criteria. 
.br
\fIuseEventLoop\fP if true the event loop will be started when the call blocks too long 
.RE
.PP
\fBReturns:\fP
.RS 4
true is returned when an object was found for which \fCremFun\fP returned true. If no such object is the function returns false. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsend()\fP 
.RE
.PP
Definition at line 972 of file dcopclient.cpp.
.PP
References QValueList::append(), QValueList::begin(), QValueList::end(), QCString::isEmpty(), QCString::length(), and registeredApplications().
.SS "void DCOPClient::emitDCOPSignal (const \fBQCString\fP & object, const \fBQCString\fP & signal, const \fBQByteArray\fP & data)"
.PP
Emits \fCsignal\fP as DCOP signal from object \fCobject\fP with \fCdata\fP as arguments. Definition at line 1762 of file dcopclient.cpp.
.PP
References normalizeFunctionSignature(), and send().
.PP
Referenced by DCOPObject::emitDCOPSignal().
.SS "bool DCOPClient::connectDCOPSignal (const \fBQCString\fP & sender, const \fBQCString\fP & senderObj, const \fBQCString\fP & signal, const \fBQCString\fP & receiverObj, const \fBQCString\fP & slot, bool Volatile)"
.PP
Connects to a DCOP signal. \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
\fIreceiverObj\fP The name of the object to call 
.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 
.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
Definition at line 1775 of file dcopclient.cpp.
.PP
References call(), and normalizeFunctionSignature().
.PP
Referenced by DCOPObject::connectDCOPSignal(), and connectDCOPSignal().
.SS "bool DCOPClient::connectDCOPSignal (const \fBQCString\fP & sender, const \fBQCString\fP & signal, const \fBQCString\fP & receiverObj, const \fBQCString\fP & slot, bool Volatile)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP For backwards compatibility Definition at line 1801 of file dcopclient.cpp.
.PP
References connectDCOPSignal().
.SS "bool DCOPClient::disconnectDCOPSignal (const \fBQCString\fP & sender, const \fBQCString\fP & senderObj, const \fBQCString\fP & signal, const \fBQCString\fP & receiverObj, const \fBQCString\fP & slot)"
.PP
Disconnects a DCOP signal. A special case is when both \fCsender\fP & \fCsignal\fP are empty. In this case all connections related to \fCreceiverObj\fP 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. 
.br
\fIreceiverObj\fP The name of the object the signal is connected to. 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
Definition at line 1808 of file dcopclient.cpp.
.PP
References call(), and normalizeFunctionSignature().
.PP
Referenced by DCOPObject::disconnectDCOPSignal(), disconnectDCOPSignal(), DCOPObject::setObjId(), and DCOPObject::~DCOPObject().
.SS "bool DCOPClient::disconnectDCOPSignal (const \fBQCString\fP & sender, const \fBQCString\fP & signal, const \fBQCString\fP & receiverObj, const \fBQCString\fP & slot)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP For backwards compatibility Definition at line 1833 of file dcopclient.cpp.
.PP
References disconnectDCOPSignal().
.SS "bool DCOPClient::process (const \fBQCString\fP & fun, const \fBQByteArray\fP & data, \fBQCString\fP & replyType, \fBQByteArray\fP & replyData)\fC [virtual]\fP"
.PP
Reimplement this function to handle app-wide function calls unassociated w/an object. Note that \fCfun\fP is normalized. See \fBnormalizeFunctionSignature\fP().
.PP
If you do not want to reimplement this function for whatever reason, you can also use a default object or a \fBDCOPObjectProxy\fP.
.PP
\fBParameters:\fP
.RS 4
\fIfun\fP the normalized function 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 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetDefaultObject()\fP 
.RE
.PP
Definition at line 1033 of file dcopclient.cpp.
.SS "DCOPClientTransaction * DCOPClient::beginTransaction ()"
.PP
Delays the reply of the current function call until \fBendTransaction\fP() is called. This allows a server to queue requests.
.PP
Note: Should be called from inside \fBprocess\fP() only! 
.PP
\fBSee also:\fP
.RS 4
\fBendTransaction()\fP 
.RE
.PP
Definition at line 1696 of file dcopclient.cpp.
.SS "void DCOPClient::endTransaction (DCOPClientTransaction * t, \fBQCString\fP & replyType, \fBQByteArray\fP & replyData)"
.PP
Sends the delayed reply of a function call. \fBParameters:\fP
.RS 4
\fIt\fP the transaction as received from \fBbeginTransaction\fP() 
.br
\fIreplyType\fP write the reply type in this string 
.br
\fIreplyData\fP write the reply data in this array 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBbeginTransaction()\fP 
.RE
.PP
Definition at line 1725 of file dcopclient.cpp.
.PP
References isAttached().
.SS "Q_INT32 DCOPClient::transactionId () const"
.PP
Test whether the current function call is delayed. Note: Should be called from inside \fBprocess\fP() only! 
.PP
\fBReturns:\fP
.RS 4
The ID of the current transaction or 0 if no transaction is going on. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBprocess()\fP 
.PP
\fBbeginTransaction()\fP 
.RE
.PP
Definition at line 1716 of file dcopclient.cpp.
.SS "bool DCOPClient::isApplicationRegistered (const \fBQCString\fP & remApp)"
.PP
Checks whether \fCremApp\fP is registered with the DCOP server. \fBParameters:\fP
.RS 4
\fIremApp\fP the id of the remote application 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the remote application is registered, otherwise \fCfalse\fP. 
.RE
.PP
Definition at line 1039 of file dcopclient.cpp.
.PP
References call().
.SS "\fBQCStringList\fP DCOPClient::registeredApplications ()"
.PP
Retrieves the list of all currently registered applications from dcopserver. \fBReturns:\fP
.RS 4
a list of all regietered applications 
.RE
.PP
Definition at line 1053 of file dcopclient.cpp.
.PP
References call().
.PP
Referenced by findObject().
.SS "\fBQCStringList\fP DCOPClient::remoteObjects (const \fBQCString\fP & remApp, bool * ok = 0)"
.PP
Retrieves the list of objects of the remote application \fCremApp\fP. \fBParameters:\fP
.RS 4
\fIremApp\fP the id of the application 
.br
\fIok\fP if not null, the function sets \fCok\fP to true if successful and false if an error occurred 
.RE
.PP
\fBReturns:\fP
.RS 4
the list of object ids 
.RE
.PP
Definition at line 1065 of file dcopclient.cpp.
.PP
References call().
.SS "\fBQCStringList\fP DCOPClient::remoteInterfaces (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, bool * ok = 0)"
.PP
Retrieves the list of interfaces of the remote object \fCremObj\fP of application \fCremApp\fP. \fBParameters:\fP
.RS 4
\fIremApp\fP the id of the application 
.br
\fIremObj\fP the id of the object 
.br
\fIok\fP if not null, the function sets \fCok\fP to true if successful and false if an error occurred 
.RE
.PP
\fBReturns:\fP
.RS 4
the list of interfaces 
.RE
.PP
Definition at line 1081 of file dcopclient.cpp.
.PP
References call().
.SS "\fBQCStringList\fP DCOPClient::remoteFunctions (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, bool * ok = 0)"
.PP
Retrieves the list of functions of the remote object \fCremObj\fP of application \fCremApp\fP. \fBParameters:\fP
.RS 4
\fIremApp\fP the id of the application 
.br
\fIremObj\fP the id of the object 
.br
\fIok\fP if not null, the function sets \fCok\fP to true if successful and false if an error occurred 
.RE
.PP
\fBReturns:\fP
.RS 4
the list of function ids 
.RE
.PP
Definition at line 1097 of file dcopclient.cpp.
.PP
References call().
.SS "\fBQCString\fP DCOPClient::normalizeFunctionSignature (const \fBQCString\fP & fun)\fC [static]\fP"
.PP
Normalizes the function signature \fCfun\fP. A normalized signature doesn't contain any unnecessary whitespace anymore. The remaining whitespace consists of single blanks only (0x20).
.PP
Example for a normalized signature: 
.PP
.nf

   'someFunction(QString,int)'
 
.PP
.PP
When using \fBsend\fP() or \fBcall\fP(), normalization is done automatically for you.
.PP
\fBParameters:\fP
.RS 4
\fIfun\fP the function signature to normalize 
.RE
.PP
\fBReturns:\fP
.RS 4
the normalized function 
.RE
.PP
Definition at line 882 of file dcopclient.cpp.
.PP
References QCString::copy(), QCString::isEmpty(), and QCString::resize().
.PP
Referenced by connectDCOPSignal(), disconnectDCOPSignal(), emitDCOPSignal(), and send().
.SS "\fBQCString\fP DCOPClient::senderId () const"
.PP
Returns the appId of the last application that talked to us. \fBReturns:\fP
.RS 4
the application id of the last application that send a message to this client 
.RE
.PP
Definition at line 910 of file dcopclient.cpp.
.SS "void DCOPClient::setDefaultObject (const \fBQCString\fP & objId)"
.PP
Installs object \fCobjId\fP as application-wide default object. All app-wide messages that have not been processed by the dcopclient will be send further to \fCobjId\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIobjId\fP the id of the new default object 
.RE
.PP
Definition at line 1684 of file dcopclient.cpp.
.SS "\fBQCString\fP DCOPClient::defaultObject () const"
.PP
Returns the current default object or an empty string if no object is installed as default object. A default object receives application-wide messages that have not been processed by the DCOPClient itself. 
.PP
\fBReturns:\fP
.RS 4
the id of the new default object 
.RE
.PP
Definition at line 1690 of file dcopclient.cpp.
.SS "void DCOPClient::setNotifications (bool enabled)"
.PP
Enables / disables the \fBapplicationRegistered\fP() / \fBapplicationRemoved\fP() signals. Note that a counter is maintained about how often this method was called. If this method is called twice with \fCenabled\fP set to true, notifications will be enabled until it was called with \fCenabled\fP set to false as often.
.PP
They are disabled by default. 
.PP
\fBParameters:\fP
.RS 4
\fIenabled\fP true to enable notifications, false to disable 
.RE
.PP
Definition at line 1113 of file dcopclient.cpp.
.PP
References call().
.SS "void DCOPClient::setDaemonMode (bool daemonMode)"
.PP
Tells the dcopserver to treat the client as daemon client, not as regular client. If the number of regular clients drops down to zero, the dcopserver will emit a \fBKDE\fP termination signal after 10 seconds. 
.PP
\fBParameters:\fP
.RS 4
\fIdaemonMode\fP true to enable daemon mode, false to disable 
.RE
.PP
Definition at line 1125 of file dcopclient.cpp.
.PP
References call().
.SS "\fBDCOPClient\fP * DCOPClient::mainClient ()\fC [static]\fP"
.PP
Returns the application's main dcop client. The main client can be used by objects that do not have any specific access to a dcop client. In \fBKDE\fP applications, the main client usually is the same as KAppliction::dcopClient(). 
.PP
\fBReturns:\fP
.RS 4
the application's main dcop client 
.RE
.PP
Definition at line 479 of file dcopclient.cpp.
.PP
Referenced by DCOPObject::connectDCOPSignal(), DCOPStub::dcopClient(), DCOPRef::dcopClient(), DCOPClient(), DCOPObject::disconnectDCOPSignal(), DCOPObject::emitDCOPSignal(), DCOPObject::setObjId(), ~DCOPClient(), and DCOPObject::~DCOPObject().
.SS "void DCOPClient::setMainClient (\fBDCOPClient\fP * mainClient)\fC [static]\fP"
.PP
Sets the application's main dcop client. The main client can be used by objects that do not have any specific access to a dcop client. In \fBKDE\fP applications, the main client usually is the same as KAppliction::dcopClient(). 
.PP
\fBParameters:\fP
.RS 4
\fImainClient\fP the new main dcop client 
.RE
.PP
Definition at line 484 of file dcopclient.cpp.
.PP
Referenced by DCOPClient(), and ~DCOPClient().
.SS "\fBQCString\fP DCOPClient::dcopServerFile (const \fBQCString\fP & hostname = 0)\fC [static]\fP"
.PP
File with information how to reach the dcopserver. \fBParameters:\fP
.RS 4
\fIhostname\fP Hostname to use, if empty current hostname of the system is used. 
.RE
.PP
\fBReturns:\fP
.RS 4
Filename that contains information how to contact the DCOPserver. 
.RE
.PP
Definition at line 232 of file dcopclient.cpp.
.SS "\fBQCString\fP DCOPClient::dcopServerFileOld (const \fBQCString\fP & hostname = 0)\fC [static]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP For backwards compatibility with \fBKDE\fP 2.x Definition at line 239 of file dcopclient.cpp.
.SS "void DCOPClient::applicationRegistered (const \fBQCString\fP & appId)\fC [signal]\fP"
.PP
Indicates that the application \fCappId\fP has been registered with the server we are attached to. You need to call \fBsetNotifications\fP() first, to tell the DCOP server that you want to get these events. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP the id of the new application 
.RE
.PP

.SS "void DCOPClient::applicationRemoved (const \fBQCString\fP & appId)\fC [signal]\fP"
.PP
Indicates that the formerly registered application \fCappId\fP has been removed. You need to call \fBsetNotifications\fP() first, to tell the DCOP server that you want to get these events. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP the id of the removed application 
.RE
.PP

.SS "void DCOPClient::attachFailed (const \fBQString\fP & msg)\fC [signal]\fP"
.PP
Indicates that the process of establishing DCOP communications failed in some manner. Usually attached to a dialog box or some other visual aid. 
.PP
\fBParameters:\fP
.RS 4
\fImsg\fP the message tha contains further information 
.RE
.PP

.SS "void DCOPClient::blockUserInput (bool block)\fC [signal]\fP"
.PP
Indicates that user input shall be blocked or released, depending on the argument. The signal is emitted whenever the client has to wait too long (i.e. more than 1/10 of a second) for an answer to a synchronous call. In that case, it will enter a local event loop to keep the GUI updated until finally an answer arrives.
.PP
In \fBKDE\fP, the \fBKApplication\fP object connects to this signal to be able to block any user input (i.e. mouse and key events) while we are waiting for an answer. If we did not do this, the application might end up in an illegal state, as a keyboard shortcut or a mouse action might cause another dcop call to be issued. 
.PP
\fBParameters:\fP
.RS 4
\fIblock\fP true to block user input, false otherwise 
.RE
.PP

.SS "void DCOPClient::processSocketData (int socknum)\fC [protected, slot]\fP"
.PP
Process data from the socket. \fBParameters:\fP
.RS 4
\fIsocknum\fP the fd of the socket 
.RE
.PP
Definition at line 1650 of file dcopclient.cpp.
.PP
References detach().

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