.TH "DCOPClient" kde3 "11 Jun 2005" "Version Version 3.4.1" "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
.ti -1c
.RI "void \fBapplicationRemoved\fP (const \fBQCString\fP &appId)"
.br
.ti -1c
.RI "void \fBattachFailed\fP (const \fBQString\fP &msg)"
.br
.ti -1c
.RI "void \fBblockUserInput\fP (bool block)"
.br
.ti -1c
.RI "void \fBcallBack\fP (int, const \fBQCString\fP &, const \fBQByteArray\fP &)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBDCOPClient\fP ()"
.br
.ti -1c
.RI "virtual \fB~DCOPClient\fP ()"
.br
.ti -1c
.RI "bool \fBattach\fP ()"
.br
.ti -1c
.RI "void \fBbindToApp\fP ()"
.br
.ti -1c
.RI "bool \fBdetach\fP ()"
.br
.ti -1c
.RI "bool \fBisAttached\fP () const "
.br
.ti -1c
.RI "bool \fBisAttachedToForeignServer\fP () const "
.br
.ti -1c
.RI "bool \fBacceptCalls\fP () const "
.br
.ti -1c
.RI "void \fBsetAcceptCalls\fP (bool b)"
.br
.ti -1c
.RI "bool \fBqtBridgeEnabled\fP ()"
.br
.ti -1c
.RI "void \fBsetQtBridgeEnabled\fP (bool b)"
.br
.ti -1c
.RI "\fBQCString\fP \fBregisterAs\fP (const \fBQCString\fP &appId, bool addPID=true)"
.br
.ti -1c
.RI "bool \fBisRegistered\fP () const "
.br
.ti -1c
.RI "\fBQCString\fP \fBappId\fP () const "
.br
.ti -1c
.RI "int \fBsocket\fP () const "
.br
.ti -1c
.RI "void \fBsuspend\fP ()"
.br
.ti -1c
.RI "void \fBresume\fP ()"
.br
.ti -1c
.RI "bool \fBisSuspended\fP () const "
.br
.ti -1c
.RI "bool \fBsend\fP (const \fBQCString\fP &remApp, const \fBQCString\fP &remObj, const \fBQCString\fP &remFun, const \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "bool \fBsend\fP (const \fBQCString\fP &remApp, const \fBQCString\fP &remObj, const \fBQCString\fP &remFun, const \fBQString\fP &data)"
.br
.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, int timeout)"
.br
.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
.ti -1c
.RI "int \fBcallAsync\fP (const \fBQCString\fP &remApp, const \fBQCString\fP &remObj, const \fBQCString\fP &remFun, const \fBQByteArray\fP &data, \fBQObject\fP *callBackObj, const char *callBackSlot)"
.br
.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, int timeout)"
.br
.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
.ti -1c
.RI "void \fBemitDCOPSignal\fP (const \fBQCString\fP &object, const \fBQCString\fP &signal, const \fBQByteArray\fP &data)"
.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 &\fBsender\fP, const \fBQCString\fP &senderObj, const \fBQCString\fP &signal, const \fBQCString\fP &receiverObj, const \fBQCString\fP &slot, bool Volatile)"
.br
.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) KDE_DEPRECATED"
.br
.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
.ti -1c
.RI "bool \fBdisconnectDCOPSignal\fP (const \fBQCString\fP &\fBsender\fP, const \fBQCString\fP &signal, const \fBQCString\fP &receiverObj, const \fBQCString\fP &slot) KDE_DEPRECATED"
.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 "DCOPClientTransaction * \fBbeginTransaction\fP ()"
.br
.ti -1c
.RI "void \fBendTransaction\fP (DCOPClientTransaction *t, \fBQCString\fP &replyType, \fBQByteArray\fP &replyData)"
.br
.ti -1c
.RI "Q_INT32 \fBtransactionId\fP () const "
.br
.ti -1c
.RI "bool \fBisApplicationRegistered\fP (const \fBQCString\fP &remApp)"
.br
.ti -1c
.RI "QCStringList \fBregisteredApplications\fP ()"
.br
.ti -1c
.RI "QCStringList \fBremoteObjects\fP (const \fBQCString\fP &remApp, bool *ok=0)"
.br
.ti -1c
.RI "QCStringList \fBremoteInterfaces\fP (const \fBQCString\fP &remApp, const \fBQCString\fP &remObj, bool *ok=0)"
.br
.ti -1c
.RI "QCStringList \fBremoteFunctions\fP (const \fBQCString\fP &remApp, const \fBQCString\fP &remObj, bool *ok=0)"
.br
.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
.ti -1c
.RI "void \fBsetDefaultObject\fP (const \fBQCString\fP &objId)"
.br
.ti -1c
.RI "\fBQCString\fP \fBdefaultObject\fP () const "
.br
.ti -1c
.RI "void \fBsetNotifications\fP (bool enabled)"
.br
.ti -1c
.RI "void \fBsetDaemonMode\fP (bool daemonMode)"
.br
.ti -1c
.RI "void \fBsetPriorityCall\fP (bool)"
.br
.ti -1c
.RI "void \fBhandleAsyncReply\fP (ReplyStruct *replyStruct)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static void \fBsetServerAddress\fP (const \fBQCString\fP &addr)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBnormalizeFunctionSignature\fP (const \fBQCString\fP &fun)"
.br
.ti -1c
.RI "static \fBDCOPClient\fP * \fBmainClient\fP ()"
.br
.ti -1c
.RI "static void \fBsetMainClient\fP (\fBDCOPClient\fP *mainClient)"
.br
.ti -1c
.RI "static \fBDCOPClient\fP * \fBfindLocalClient\fP (const \fBQCString\fP &_appId)"
.br
.ti -1c
.RI "static void \fBemergencyClose\fP ()"
.br
.ti -1c
.RI "static const char * \fBpostMortemSender\fP ()"
.br
.ti -1c
.RI "static const char * \fBpostMortemObject\fP ()"
.br
.ti -1c
.RI "static const char * \fBpostMortemFunction\fP ()"
.br
.ti -1c
.RI "static \fBQCString\fP \fBdcopServerFile\fP (const \fBQCString\fP &hostname=0)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBdcopServerFileOld\fP (const \fBQCString\fP &hostname=0) KDE_DEPRECATED"
.br
.ti -1c
.RI "static \fBQCString\fP \fBiceauthPath\fP ()"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBprocessSocketData\fP (int socknum)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Related Functions"
(Note that these are not member functions.) 
.in +1c
.ti -1c
.RI "Bool \fBdcop_attach\fP (void)"
.br
.ti -1c
.RI "char * \fBdcop_register\fP (const char *app_name, Bool add_pid)"
.br
.ti -1c
.RI "Bool \fBdcop_detach\fP (void)"
.br
.ti -1c
.RI "Bool \fBdcop_register_callback\fP (const char *object_id, dcop_callback_t callback)"
.br
.ti -1c
.RI "Bool \fBdcop_send_signal\fP (const char *receiving_app, const char *object, const char *function, char *data, int data_length)"
.br
.ti -1c
.RI "Bool \fBdcop_call\fP (const char *app_name, const char *remote_app_name, const char *remote_object_id, const char *remote_function, const char *data, int data_length, char **reply_type, char **reply_data, int *reply_data_length)"
.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
   QByteArray data;
   QDataStream arg(data, IO_WriteOnly);
   arg << QString('This is text I am serializing');
   client->send('someApp', 'someObject', 'someFunction(QString)', data);
.fi
.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 68 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. 
.PP
Definition at line 602 of file dcopclient.cpp.
.PP
References appId(), QObject::connect(), mainClient(), QObject::parent(), and setMainClient().
.SS "DCOPClient::~\fBDCOPClient\fP ()\fC [virtual]\fP"
.PP
Cleans up any open connections and dynamic data. 
.PP
Definition at line 629 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. 
.PP
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

.PP
Definition at line 667 of file dcopclient.cpp.
.SS "bool DCOPClient::attach ()"
.PP
Attaches to the DCOP server. 
.PP
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

.PP
Definition at line 675 of file dcopclient.cpp.
.SS "bool DCOPClient::detach ()"
.PP
Detaches from the DCOP server. 
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 883 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. 
.PP
\fBReturns:\fP
.RS 4
true if attached, false if not 
.RE
.PP

.PP
Definition at line 910 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. 
.PP
\fBReturns:\fP
.RS 4
true if attached to a foreign server, false if not 
.RE
.PP

.PP
Definition at line 922 of file dcopclient.cpp.
.PP
References isAttached().
.SS "bool DCOPClient::acceptCalls () const"
.PP
Returns whether the client handles incoming calls. 
.PP
\fBReturns:\fP
.RS 4
true if the client accepts calls 
.RE
.PP

.PP
Definition at line 927 of file dcopclient.cpp.
.PP
References isAttached().
.SS "void DCOPClient::setAcceptCalls (bool b)"
.PP
Specify whether the client should accept incoming calls. 
.PP
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

.PP
Definition at line 932 of file dcopclient.cpp.
.SS "bool DCOPClient::qtBridgeEnabled ()"
.PP
Returns whether the DCOP - \fBQt\fP bridge is enabled. 
.PP
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.0.2 
.RE
.PP

.PP
Definition at line 938 of file dcopclient.cpp.
.SS "void DCOPClient::setQtBridgeEnabled (bool b)"
.PP
Specify whether \fBQt\fP objects of the application should be accessible via DCOP. 
.PP
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.0.2 
.RE
.PP

.PP
Definition at line 943 of file dcopclient.cpp.
.SS "\fBQCString\fP DCOPClient::registerAs (const \fBQCString\fP & appId, bool addPID = \fCtrue\fP)"
.PP
Registers at the DCOP server. 
.PP
If the application was already registered, the registration will be re-done with the new appId.
.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

.PP
Definition at line 948 of file dcopclient.cpp.
.PP
References appId(), 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. 
.PP
\fBReturns:\fP
.RS 4
true if registered at the server 
.RE
.PP

.PP
Definition at line 995 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. 
.PP
\fBReturns:\fP
.RS 4
the application id, or QString::null if not registered 
.RE
.PP

.PP
Definition at line 1001 of file dcopclient.cpp.
.PP
Referenced by DCOPClient(), and registerAs().
.SS "int DCOPClient::socket () const"
.PP
Returns the socket fd that is used for communication with the server. 
.PP
\fBReturns:\fP
.RS 4
The socket over which DCOP is communicating with the server. 
.RE
.PP

.PP
Definition at line 1007 of file dcopclient.cpp.
.SS "void DCOPClient::suspend ()"
.PP
Temporarily suspends processing of DCOP events. 
.PP
This can be useful 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

.PP
Definition at line 697 of file dcopclient.cpp.
.SS "void DCOPClient::resume ()"
.PP
Resumes the processing of DCOP events. 
.PP
\fBSee also:\fP
.RS 4
\fBsuspend()\fP. 
.PP
\fBisSuspended()\fP 
.RE
.PP

.PP
Definition at line 703 of file dcopclient.cpp.
.SS "bool DCOPClient::isSuspended () const"
.PP
Returns whether DCOP events are being processed. 
.PP
\fBSee also:\fP
.RS 4
\fBsuspend()\fP 
.PP
\fBresume()\fP. 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 709 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. 
.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. 
.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

.PP
Definition at line 1056 of file dcopclient.cpp.
.PP
References findLocalClient(), isAttached(), normalizeFunctionSignature(), receive(), senderId(), and transactionId().
.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. 
.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. 
.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

.PP
Definition at line 1112 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, int timeout)"
.PP
Performs a synchronous send and receive. 
.PP
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 
.br
\fItimeout\fP timeout for the call in miliseconds, or -1 for no timeout 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP
\fBSince:\fP
.RS 4
3.2
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsend()\fP 
.RE
.PP

.PP
Definition at line 1746 of file dcopclient.cpp.
.PP
References QApplication::eventLoop(), findLocalClient(), isLocalTransactionFinished(), receive(), senderId(), and transactionId().
.PP
Referenced by call(), connectDCOPSignal(), disconnectDCOPSignal(), isApplicationRegistered(), registerAs(), registeredApplications(), remoteFunctions(), remoteInterfaces(), remoteObjects(), setDaemonMode(), and setNotifications().
.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 = \fCfalse\fP)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.PP
Definition at line 1738 of file dcopclient.cpp.
.PP
References call().
.SS "int DCOPClient::callAsync (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, const \fBQCString\fP & remFun, const \fBQByteArray\fP & data, \fBQObject\fP * callBackObj, const char * callBackSlot)"
.PP
Performs a asynchronous send with receive callback. 
.PP
The first four parameters are the same as for send.
.PP
\fCcallBackObj\fP and \fCcallBackSlot\fP specify a call back slot that is called when an answer is received.
.PP
The slot should have the following signature: callBackSlot(int callId, const \fBQCString\fP& replyType, const \fBQByteArray\fP &replyData);
.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
\fIcallBackObj\fP object to call back 
.br
\fIcallBackSlot\fP slot to call back 
.RE
.PP
\fBReturns:\fP
.RS 4
0 on failure, on success a callId > 0 is returned that will be passed as first argument of the result call back
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsend()\fP 
.PP
callback()
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 1790 of file dcopclient.cpp.
.PP
References QCString::append(), and QTimer::singleShot().
.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, int timeout)"
.PP
Searches for an object which matches a criteria. 
.PP
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 
.br
\fItimeout\fP timeout for the call in miliseconds, or -1 for no timeout 
.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
\fBSince:\fP
.RS 4
3.2
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsend()\fP 
.RE
.PP

.PP
Definition at line 1129 of file dcopclient.cpp.
.PP
References DCOPRef::app(), QValueList::append(), QApplication::eventLoop(), find(), findLocalClient(), QCString::isEmpty(), isLocalTransactionFinished(), QCString::length(), registeredApplications(), senderId(), and transactionId().
.PP
Referenced by findObject().
.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 = \fCfalse\fP)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.PP
Definition at line 1121 of file dcopclient.cpp.
.PP
References findObject().
.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. 
.PP
Definition at line 2151 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. 
.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
\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 
.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 2164 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
\fBDeprecated\fP
.RS 4
For backwards compatibility 
.RE
.PP

.PP
Definition at line 2192 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. 
.PP
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

.PP
Definition at line 2199 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
\fBDeprecated\fP
.RS 4
For backwards compatibility 
.RE
.PP

.PP
Definition at line 2226 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. 
.PP
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

.PP
Definition at line 1225 of file dcopclient.cpp.
.SS "DCOPClientTransaction * DCOPClient::beginTransaction ()"
.PP
Delays the reply of the current function call until \fBendTransaction()\fP is called. 
.PP
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

.PP
Definition at line 2067 of file dcopclient.cpp.
.PP
References QCString::append().
.SS "void DCOPClient::endTransaction (DCOPClientTransaction * t, \fBQCString\fP & replyType, \fBQByteArray\fP & replyData)"
.PP
Sends the delayed reply of a function call. 
.PP
\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

.PP
Definition at line 2099 of file dcopclient.cpp.
.PP
References QCString::insert(), and isAttached().
.SS "Q_INT32 DCOPClient::transactionId () const"
.PP
\fBTest\fP whether the current function call is delayed. 
.PP
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

.PP
Definition at line 2090 of file dcopclient.cpp.
.PP
Referenced by call(), findObject(), and send().
.SS "bool DCOPClient::isApplicationRegistered (const \fBQCString\fP & remApp)"
.PP
Checks whether \fCremApp\fP is registered with the DCOP server. 
.PP
\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

.PP
Definition at line 1231 of file dcopclient.cpp.
.PP
References call().
.SS "QCStringList DCOPClient::registeredApplications ()"
.PP
Retrieves the list of all currently registered applications from dcopserver. 
.PP
\fBReturns:\fP
.RS 4
a list of all regietered applications 
.RE
.PP

.PP
Definition at line 1245 of file dcopclient.cpp.
.PP
References call().
.PP
Referenced by findObject().
.SS "QCStringList DCOPClient::remoteObjects (const \fBQCString\fP & remApp, bool * ok = \fC0\fP)"
.PP
Retrieves the list of objects of the remote application \fCremApp\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIremApp\fP he 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

.PP
Definition at line 1257 of file dcopclient.cpp.
.PP
References call().
.SS "QCStringList DCOPClient::remoteInterfaces (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, bool * ok = \fC0\fP)"
.PP
Retrieves the list of interfaces of the remote object \fCremObj\fP of application \fCremApp\fP. 
.PP
\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

.PP
Definition at line 1273 of file dcopclient.cpp.
.PP
References call().
.SS "QCStringList DCOPClient::remoteFunctions (const \fBQCString\fP & remApp, const \fBQCString\fP & remObj, bool * ok = \fC0\fP)"
.PP
Retrieves the list of functions of the remote object \fCremObj\fP of application \fCremApp\fP. 
.PP
\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

.PP
Definition at line 1289 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. 
.PP
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)'

.fi
.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

.PP
Definition at line 1022 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. 
.PP
\fBReturns:\fP
.RS 4
the application id of the last application that send a message to this client 
.RE
.PP

.PP
Definition at line 1050 of file dcopclient.cpp.
.PP
Referenced by call(), findObject(), and send().
.SS "void DCOPClient::setDefaultObject (const \fBQCString\fP & objId)"
.PP
Installs object \fCobjId\fP as application-wide default object. 
.PP
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

.PP
Definition at line 2041 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. 
.PP
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

.PP
Definition at line 2047 of file dcopclient.cpp.
.SS "void DCOPClient::setNotifications (bool enabled)"
.PP
Enables / disables the \fBapplicationRegistered()\fP / \fBapplicationRemoved()\fP signals. 
.PP
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

.PP
Definition at line 1305 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. 
.PP
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

.PP
Definition at line 1317 of file dcopclient.cpp.
.PP
References call().
.SS "\fBDCOPClient\fP * DCOPClient::mainClient ()\fC [static]\fP"
.PP
Returns the application's main dcop client. 
.PP
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 \fBKApplication::dcopClient()\fP. 
.PP
\fBReturns:\fP
.RS 4
the application's main dcop client 
.RE
.PP

.PP
Definition at line 591 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. 
.PP
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 \fBKApplication::dcopClient()\fP. 
.PP
\fBParameters:\fP
.RS 4
\fImainClient\fP the new main dcop client 
.RE
.PP

.PP
Definition at line 596 of file dcopclient.cpp.
.PP
Referenced by DCOPClient(), and ~DCOPClient().
.SS "\fBDCOPClient\fP * DCOPClient::findLocalClient (const \fBQCString\fP & _appId)\fC [static]\fP"
.PP
Look for the given client only in this process. 
.PP
This can be used to check whether a given client (by name) is running in the same process or in another one. 
.PP
Definition at line 98 of file dcopclient.cpp.
.PP
References QAsciiDict::find().
.PP
Referenced by call(), findObject(), and send().
.SS "\fBQCString\fP DCOPClient::dcopServerFile (const \fBQCString\fP & hostname = \fC0\fP)\fC [static]\fP"
.PP
File with information how to reach the dcopserver. 
.PP
\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

.PP
Definition at line 300 of file dcopclient.cpp.
.SS "\fBQCString\fP DCOPClient::dcopServerFileOld (const \fBQCString\fP & hostname = \fC0\fP)\fC [static]\fP"
.PP
\fBDeprecated\fP
.RS 4
For backwards compatibility with \fBKDE\fP 2.x // KDE4 remove 
.RE
.PP

.PP
Definition at line 307 of file dcopclient.cpp.
.SS "\fBQCString\fP DCOPClient::iceauthPath ()\fC [static]\fP"
.PP
Return the path of iceauth or an empty string if not found. 
.PP
Definition at line 223 of file dcopclient.cpp.
.PP
References QCString::isEmpty(), and QCString::isNull().
.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. 
.PP
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. 
.PP
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. 
.PP
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. 
.PP
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. 
.PP
\fBParameters:\fP
.RS 4
\fIsocknum\fP the fd of the socket 
.RE
.PP

.PP
Definition at line 2005 of file dcopclient.cpp.
.PP
References detach().

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