• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • dcop
 

dcop

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
DCOPClient Class Reference

#include <dcopclient.h>

Inherits TQObject.

Public Slots

void processSocketData (int socknum)
 

Signals

void applicationRegistered (const TQCString &appId)
 
void applicationRemoved (const TQCString &appId)
 
void attachFailed (const TQString &msg)
 
void blockUserInput (bool block)
 
void callBack (int, const TQCString &, const TQByteArray &)
 

Public Member Functions

 DCOPClient ()
 
virtual ~DCOPClient ()
 
bool attach ()
 
void bindToApp ()
 
bool detach ()
 
bool isAttached () const
 
bool isAttachedToForeignServer () const
 
bool acceptCalls () const
 
void setAcceptCalls (bool b)
 
bool qtBridgeEnabled ()
 
void setQtBridgeEnabled (bool b)
 
TQCString registerAs (const TQCString &appId, bool addPID=true)
 
bool isRegistered () const
 
TQCString appId () const
 
int socket () const
 
void suspend ()
 
void resume ()
 
bool isSuspended () const
 
bool send (const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data)
 
bool send (const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQString &data)
 
bool call (const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData, bool useEventLoop, int timeout, bool forceRemote)
 
bool call (const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData, bool useEventLoop, int timeout)
 
bool call (const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData, bool useEventLoop=false)
 
int callAsync (const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQObject *callBackObj, const char *callBackSlot)
 
bool findObject (const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQCString &foundApp, TQCString &foundObj, bool useEventLoop, int timeout)
 
bool findObject (const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQCString &foundApp, TQCString &foundObj, bool useEventLoop=false)
 
void emitDCOPSignal (const TQCString &object, const TQCString &signal, const TQByteArray &data)
 
void emitDCOPSignal (const TQCString &signal, const TQByteArray &data)
 
bool connectDCOPSignal (const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &receiverObj, const TQCString &slot, bool Volatile)
 
bool connectDCOPSignal (const TQCString &sender, const TQCString &signal, const TQCString &receiverObj, const TQCString &slot, bool Volatile) TDE_DEPRECATED
 
bool disconnectDCOPSignal (const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &receiverObj, const TQCString &slot)
 
bool disconnectDCOPSignal (const TQCString &sender, const TQCString &signal, const TQCString &receiverObj, const TQCString &slot) TDE_DEPRECATED
 
virtual bool process (const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData)
 
DCOPClientTransaction * beginTransaction ()
 
void endTransaction (DCOPClientTransaction *t, TQCString &replyType, TQByteArray &replyData)
 
TQ_INT32 transactionId () const
 
bool isApplicationRegistered (const TQCString &remApp)
 
QCStringList registeredApplications ()
 
QCStringList remoteObjects (const TQCString &remApp, bool *ok=0)
 
QCStringList remoteInterfaces (const TQCString &remApp, const TQCString &remObj, bool *ok=0)
 
QCStringList remoteFunctions (const TQCString &remApp, const TQCString &remObj, bool *ok=0)
 
bool receive (const TQCString &app, const TQCString &obj, const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData)
 
bool find (const TQCString &app, const TQCString &obj, const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData)
 
TQCString senderId () const
 
void setDefaultObject (const TQCString &objId)
 
TQCString defaultObject () const
 
void setNotifications (bool enabled)
 
void setDaemonMode (bool daemonMode)
 
void setPriorityCall (bool)
 
void handleAsyncReply (ReplyStruct *replyStruct)
 

Static Public Member Functions

static void setServerAddress (const TQCString &addr)
 
static TQCString normalizeFunctionSignature (const TQCString &fun)
 
static DCOPClient * mainClient ()
 
static void setMainClient (DCOPClient *mainClient)
 
static DCOPClient * findLocalClient (const TQCString &_appId)
 
static void emergencyClose ()
 
static const char * postMortemSender ()
 
static const char * postMortemObject ()
 
static const char * postMortemFunction ()
 
static TQCString dcopServerFile (const TQCString &hostname=0)
 
static TQCString dcopServerFileOld (const TQCString &hostname=0) TDE_DEPRECATED
 
static TQCString iceauthPath ()
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Related Functions

(Note that these are not member functions.)

Bool dcop_attach (void)
 
char * dcop_register (const char *app_name, Bool add_pid)
 
Bool dcop_detach (void)
 
Bool dcop_register_callback (const char *object_id, dcop_callback_t callback)
 
Bool dcop_send_signal (const char *receiving_app, const char *object, const char *function, char *data, int data_length)
 
Bool dcop_call (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)
 

Detailed Description

Inter-process communication and remote procedure calls for KDE applications.

This class provides IPC and RPC for KDE applications. Usually you will not have to instantiate one yourself because TDEApplication contains a method to return a pointer to a DCOPClient object which can be used for your whole application.

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 attach() and registerAs() for more information.

Data to be sent should be serialized into a TQDataStream which was initialized with the TQByteArray that you actually intend to send the data in. An example of how you might do this:

TQByteArray data;
TQDataStream arg(data, IO_WriteOnly);
arg << TQString("This is text I am serializing");
client->send("someApp", "someObject", "someFunction(TQString)", data);
DCOPClient::send
bool send(const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data)
Sends a data block to the server.
Definition: dcopclient.cpp:1089
See also
TDEApplication::dcopClient()
Author
Preston Brown pbrow.nosp@m.n@kd.nosp@m.e.org, Matthias Ettrich ettri.nosp@m.ch@k.nosp@m.de.or.nosp@m.g

Definition at line 68 of file dcopclient.h.

Constructor & Destructor Documentation

◆ DCOPClient()

DCOPClient::DCOPClient ( )

Constructs a new DCOP client, but does not attach to any server.


Definition at line 610 of file dcopclient.cpp.

◆ ~DCOPClient()

DCOPClient::~DCOPClient ( )
virtual

Cleans up any open connections and dynamic data.

Definition at line 635 of file dcopclient.cpp.

Member Function Documentation

◆ acceptCalls()

bool DCOPClient::acceptCalls ( ) const

Returns whether the client handles incoming calls.

Returns
true if the client accepts calls

Definition at line 962 of file dcopclient.cpp.

◆ appId()

TQCString DCOPClient::appId ( ) const

Returns the current app id or a null string if the application hasn't yet been registered.

Returns
the application id, or TQString::null if not registered

Definition at line 1036 of file dcopclient.cpp.

◆ applicationRegistered

void DCOPClient::applicationRegistered ( const TQCString &  appId)
signal

Indicates that the application appId has been registered with the server we are attached to.

You need to call setNotifications() first, to tell the DCOP server that you want to get these events.

Parameters
appIdthe id of the new application

◆ applicationRemoved

void DCOPClient::applicationRemoved ( const TQCString &  appId)
signal

Indicates that the formerly registered application appId has been removed.

You need to call setNotifications() first, to tell the DCOP server that you want to get these events.

Parameters
appIdthe id of the removed application

◆ attach()

bool DCOPClient::attach ( )

Attaches to the DCOP server.

If the connection was already attached, the connection will be re-established with the current server address.

Naturally, only attached application can use DCOP services.

If a TQApplication object exists then client registers itself as TQApplication::name() + "-" + <pid>. If no TQApplication object exists the client registers itself as "anonymous".

If you want to register differently, you should use registerAs() instead.

Returns
true if attaching was successful.

Definition at line 679 of file dcopclient.cpp.

◆ attachFailed

void DCOPClient::attachFailed ( const TQString &  msg)
signal

Indicates that the process of establishing DCOP communications failed in some manner.

Usually attached to a dialog box or some other visual aid.

Parameters
msgthe message tha contains further information

◆ beginTransaction()

DCOPClientTransaction * DCOPClient::beginTransaction ( )

Delays the reply of the current function call until endTransaction() is called.

This allows a server to queue requests.

Note: Should be called from inside process() only!

See also
endTransaction()

Definition at line 2099 of file dcopclient.cpp.

◆ bindToApp()

void DCOPClient::bindToApp ( )

Definition at line 687 of file dcopclient.cpp.

◆ blockUserInput

void DCOPClient::blockUserInput ( bool  block)
signal

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.

In KDE, the TDEApplication 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.

Parameters
blocktrue to block user input, false otherwise

◆ call() [1/3]

bool DCOPClient::call ( const TQCString &  remApp,
const TQCString &  remObj,
const TQCString &  remFun,
const TQByteArray &  data,
TQCString &  replyType,
TQByteArray &  replyData,
bool  useEventLoop,
int  timeout 
)
Deprecated:

Definition at line 1778 of file dcopclient.cpp.

◆ call() [2/3]

bool DCOPClient::call ( const TQCString &  remApp,
const TQCString &  remObj,
const TQCString &  remFun,
const TQByteArray &  data,
TQCString &  replyType,
TQByteArray &  replyData,
bool  useEventLoop,
int  timeout,
bool  forceRemote 
)

Performs a synchronous send and receive.

The parameters are the same as for send, with the exception of another TQByteArray being provided for results to be (optionally) returned in.

A call blocks the application until the process receives the answer.

If useEventLoop 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.

Parameters
remAppthe remote application's id
remObjthe remote object id
remFunthe remote function id
datathe data to send
replyTypethe type of the reply will be written here
replyDatathe data of the reply will be written here
useEventLoopif true the event loop will be started when the call blocks too long
timeouttimeout for the call in miliseconds, or -1 for no timeout
forceRemoteif set do not allow calls within the current application to bypass the remote call mechanism
Returns
true if successful, false otherwise
Since
3.2
See also
send()

Definition at line 1786 of file dcopclient.cpp.

◆ call() [3/3]

bool DCOPClient::call ( const TQCString &  remApp,
const TQCString &  remObj,
const TQCString &  remFun,
const TQByteArray &  data,
TQCString &  replyType,
TQByteArray &  replyData,
bool  useEventLoop = false 
)
Deprecated:

Definition at line 1770 of file dcopclient.cpp.

◆ callAsync()

int DCOPClient::callAsync ( const TQCString &  remApp,
const TQCString &  remObj,
const TQCString &  remFun,
const TQByteArray &  data,
TQObject *  callBackObj,
const char *  callBackSlot 
)

Performs a asynchronous send with receive callback.

The first four parameters are the same as for send.

callBackObj and callBackSlot specify a call back slot that is called when an answer is received.

The slot should have the following signature: callBackSlot(int callId, const TQCString& replyType, const TQByteArray &replyData);

Parameters
remAppthe remote application's id
remObjthe remote object id
remFunthe remote function id
datathe data to send
callBackObjobject to call back
callBackSlotslot to call back
Returns
0 on failure, on success a callId > 0 is returned that will be passed as first argument of the result call back
See also
send()
callback()
Since
3.2

Definition at line 1830 of file dcopclient.cpp.

◆ connectDCOPSignal() [1/2]

bool DCOPClient::connectDCOPSignal ( const TQCString &  sender,
const TQCString &  senderObj,
const TQCString &  signal,
const TQCString &  receiverObj,
const TQCString &  slot,
bool  Volatile 
)

Connects to a DCOP signal.

Parameters
senderthe name of the client that emits the signal. When empty the signal will be passed from any client.
senderObjthe name of the sending object that emits the signal.
signalthe name of the signal. The arguments should match with slot.
receiverObjThe name of the object to call
slotThe name of the slot to call. Its arguments should match with signal.
VolatileIf true, the connection will not be reestablished when sender unregisters and reregisters with DCOP. In this case the sender must be registered when the connection is made. If false, the connection will be reestablished when sender reregisters. In this case the connection can be made even if sender is not registered at that time.
Returns
false if a connection could not be established. This will be the case when
  • Volatile is true and sender does not exist.
  • signal and slot do not have matching arguments.

Definition at line 2192 of file dcopclient.cpp.

◆ connectDCOPSignal() [2/2]

bool DCOPClient::connectDCOPSignal ( const TQCString &  sender,
const TQCString &  signal,
const TQCString &  receiverObj,
const TQCString &  slot,
bool  Volatile 
)
Deprecated:
For backwards compatibility

Definition at line 2220 of file dcopclient.cpp.

◆ dcopServerFile()

TQCString DCOPClient::dcopServerFile ( const TQCString &  hostname = 0)
static

File with information how to reach the dcopserver.

Parameters
hostnameHostname to use, if empty current hostname of the system is used.
Returns
Filename that contains information how to contact the DCOPserver.

Definition at line 316 of file dcopclient.cpp.

◆ dcopServerFileOld()

TQCString DCOPClient::dcopServerFileOld ( const TQCString &  hostname = 0)
static
Deprecated:
For backwards compatibility with KDE 2.x // KDE4 remove

Definition at line 323 of file dcopclient.cpp.

◆ defaultObject()

TQCString DCOPClient::defaultObject ( ) const

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.

Returns
the id of the new default object

Definition at line 2079 of file dcopclient.cpp.

◆ detach()

bool DCOPClient::detach ( )

Detaches from the DCOP server.

Returns
true if successful, false otherwise

Definition at line 926 of file dcopclient.cpp.

◆ disconnectDCOPSignal() [1/2]

bool DCOPClient::disconnectDCOPSignal ( const TQCString &  sender,
const TQCString &  senderObj,
const TQCString &  signal,
const TQCString &  receiverObj,
const TQCString &  slot 
)

Disconnects a DCOP signal.

A special case is when both sender & signal are empty. In this case all connections related to receiverObj in the current client are disconnected. (Both connections from as well as to this object!)

Parameters
senderthe name of the client that emits the signal.
senderObjthe name of the object that emits the signal. If empty all objects will be disconnected.
signalthe name of the signal. The arguments should match with slot.
receiverObjThe name of the object the signal is connected to. If empty all objects will be disconnected.
slotThe name of the slot the signal is connected to. If empty all slots will be disconnected.
Returns
false if no connection(s) where removed.

Definition at line 2227 of file dcopclient.cpp.

◆ disconnectDCOPSignal() [2/2]

bool DCOPClient::disconnectDCOPSignal ( const TQCString &  sender,
const TQCString &  signal,
const TQCString &  receiverObj,
const TQCString &  slot 
)
Deprecated:
For backwards compatibility

Definition at line 2254 of file dcopclient.cpp.

◆ emergencyClose()

void DCOPClient::emergencyClose ( )
static

Definition at line 2283 of file dcopclient.cpp.

◆ emitDCOPSignal() [1/2]

void DCOPClient::emitDCOPSignal ( const TQCString &  object,
const TQCString &  signal,
const TQByteArray &  data 
)

Emits signal as DCOP signal from object object with data as arguments.

Definition at line 2179 of file dcopclient.cpp.

◆ emitDCOPSignal() [2/2]

void DCOPClient::emitDCOPSignal ( const TQCString &  signal,
const TQByteArray &  data 
)

Definition at line 2186 of file dcopclient.cpp.

◆ endTransaction()

void DCOPClient::endTransaction ( DCOPClientTransaction *  t,
TQCString &  replyType,
TQByteArray &  replyData 
)

Sends the delayed reply of a function call.

Parameters
tthe transaction as received from beginTransaction()
replyTypewrite the reply type in this string
replyDatawrite the reply data in this array
See also
beginTransaction()

Definition at line 2129 of file dcopclient.cpp.

◆ find()

bool DCOPClient::find ( const TQCString &  app,
const TQCString &  obj,
const TQCString &  fun,
const TQByteArray &  data,
TQCString &  replyType,
TQByteArray &  replyData 
)

Definition at line 1723 of file dcopclient.cpp.

◆ findLocalClient()

DCOPClient * DCOPClient::findLocalClient ( const TQCString &  _appId)
static

Look for the given client only in this process.

This can be used to check whether a given client (by name) is running in the same process or in another one.

Definition at line 99 of file dcopclient.cpp.

◆ findObject() [1/2]

bool DCOPClient::findObject ( const TQCString &  remApp,
const TQCString &  remObj,
const TQCString &  remFun,
const TQByteArray &  data,
TQCString &  foundApp,
TQCString &  foundObj,
bool  useEventLoop,
int  timeout 
)

Searches for an object which matches a criteria.

findObject calls remFun in the applications and objects identified by remApp and remObj until remFun returns true. The name of the application and object that returned true are returned in foundApp and foundObj respectively.

If remFun is empty a default function is called in the object which always returns true.

A findObject blocks the application until the process receives the answer.

If useEventLoop 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.

Parameters
remAppThe remote application id.
remObjThe name of the remote object.
remFunThe remote function in the specified object to call. This function should return a bool and is used as criteria.
dataThe data to provide to the remote function.
foundAppThe remote application id that matched the criteria.
foundObjThe remote object that matched the criteria.
useEventLoopif true the event loop will be started when the call blocks too long
timeouttimeout for the call in miliseconds, or -1 for no timeout
Returns
true is returned when an object was found for which remFun returned true. If no such object is the function returns false.
Since
3.2
See also
send()

Definition at line 1160 of file dcopclient.cpp.

◆ findObject() [2/2]

bool DCOPClient::findObject ( const TQCString &  remApp,
const TQCString &  remObj,
const TQCString &  remFun,
const TQByteArray &  data,
TQCString &  foundApp,
TQCString &  foundObj,
bool  useEventLoop = false 
)
Deprecated:

Definition at line 1152 of file dcopclient.cpp.

◆ handleAsyncReply()

void DCOPClient::handleAsyncReply ( ReplyStruct *  replyStruct)

Definition at line 333 of file dcopclient.cpp.

◆ iceauthPath()

TQCString DCOPClient::iceauthPath ( )
static

Return the path of iceauth or an empty string if not found.

Definition at line 214 of file dcopclient.cpp.

◆ isApplicationRegistered()

bool DCOPClient::isApplicationRegistered ( const TQCString &  remApp)

Checks whether remApp is registered with the DCOP server.

Parameters
remAppthe id of the remote application
Returns
true if the remote application is registered, otherwise false.

Definition at line 1262 of file dcopclient.cpp.

◆ isAttached()

bool DCOPClient::isAttached ( ) const

Returns whether or not the client is attached to the server.

Returns
true if attached, false if not

Definition at line 949 of file dcopclient.cpp.

◆ isAttachedToForeignServer()

bool DCOPClient::isAttachedToForeignServer ( ) const

Returns whether the client is attached to a server owned by another user.

Returns
true if attached to a foreign server, false if not

Definition at line 957 of file dcopclient.cpp.

◆ isRegistered()

bool DCOPClient::isRegistered ( ) const

Returns whether or not the client is registered at the server.

Returns
true if registered at the server

Definition at line 1030 of file dcopclient.cpp.

◆ isSuspended()

bool DCOPClient::isSuspended ( ) const

Returns whether DCOP events are being processed.

See also
suspend()
resume().
Since
3.1

Definition at line 721 of file dcopclient.cpp.

◆ mainClient()

DCOPClient * DCOPClient::mainClient ( )
static

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 KDE applications, the main client usually is the same as TDEApplication::dcopClient().

Returns
the application's main dcop client

Definition at line 599 of file dcopclient.cpp.

◆ normalizeFunctionSignature()

TQCString DCOPClient::normalizeFunctionSignature ( const TQCString &  fun)
static

Normalizes the function signature fun.

A normalized signature doesn't contain any unnecessary whitespace anymore. The remaining whitespace consists of single blanks only (0x20).

Example for a normalized signature:

"someFunction(TQString,int)"

When using send() or call(), normalization is done automatically for you.

Parameters
funthe function signature to normalize
Returns
the normalized function

Definition at line 1055 of file dcopclient.cpp.

◆ postMortemFunction()

const char * DCOPClient::postMortemFunction ( )
static

Definition at line 2322 of file dcopclient.cpp.

◆ postMortemObject()

const char * DCOPClient::postMortemObject ( )
static

Definition at line 2315 of file dcopclient.cpp.

◆ postMortemSender()

const char * DCOPClient::postMortemSender ( )
static

Definition at line 2305 of file dcopclient.cpp.

◆ process()

bool DCOPClient::process ( const TQCString &  fun,
const TQByteArray &  data,
TQCString &  replyType,
TQByteArray &  replyData 
)
virtual

Reimplement this function to handle app-wide function calls unassociated w/an object.

Note that fun is normalized. See normalizeFunctionSignature().

If you do not want to reimplement this function for whatever reason, you can also use a default object or a DCOPObjectProxy.

Parameters
funthe normalized function signature
datathe received data
replyTypewrite the reply type in this string
replyDatawrite the reply data in this array
Returns
true if successful, false otherwise
See also
setDefaultObject()

Definition at line 1256 of file dcopclient.cpp.

◆ processSocketData

void DCOPClient::processSocketData ( int  socknum)
slot

Process data from the socket.

Parameters
socknumthe fd of the socket

Definition at line 2037 of file dcopclient.cpp.

◆ qtBridgeEnabled()

bool DCOPClient::qtBridgeEnabled ( )

Returns whether the DCOP - Qt bridge is enabled.

By default the DCOP - Qt bridge is enabled.

Returns
true if Qt objects are accessible over DCOP
Since
3.0.2

Definition at line 973 of file dcopclient.cpp.

◆ receive()

bool DCOPClient::receive ( const TQCString &  app,
const TQCString &  obj,
const TQCString &  fun,
const TQByteArray &  data,
TQCString &  replyType,
TQByteArray &  replyData 
)

Definition at line 1595 of file dcopclient.cpp.

◆ registerAs()

TQCString DCOPClient::registerAs ( const TQCString &  appId,
bool  addPID = true 
)

Registers at the DCOP server.

If the application was already registered, the registration will be re-done with the new appId.

appId is a unique 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 addPID is true, the PID of the current process will be added to id.

Registration is necessary if you want to allow other clients to talk to you. They can do so using your appId as first parameter for send() or call(). If you just want to talk to other clients, you do not need to register at the server. In that case attach() is enough. It will implicitly register you as "anonymous".

Parameters
appIdthe id of the application
addPIDtrue to add the process id
Returns
The actual appId used for the registration or a null string if the registration wasn't successful.

Definition at line 983 of file dcopclient.cpp.

◆ registeredApplications()

QCStringList DCOPClient::registeredApplications ( )

Retrieves the list of all currently registered applications from dcopserver.

Returns
a list of all regietered applications

Definition at line 1276 of file dcopclient.cpp.

◆ remoteFunctions()

QCStringList DCOPClient::remoteFunctions ( const TQCString &  remApp,
const TQCString &  remObj,
bool *  ok = 0 
)

Retrieves the list of functions of the remote object remObj of application remApp.

Parameters
remAppthe id of the application
remObjthe id of the object
okif not null, the function sets ok to true if successful and false if an error occurred
Returns
the list of function ids

Definition at line 1320 of file dcopclient.cpp.

◆ remoteInterfaces()

QCStringList DCOPClient::remoteInterfaces ( const TQCString &  remApp,
const TQCString &  remObj,
bool *  ok = 0 
)

Retrieves the list of interfaces of the remote object remObj of application remApp.

Parameters
remAppthe id of the application
remObjthe id of the object
okif not null, the function sets ok to true if successful and false if an error occurred
Returns
the list of interfaces

Definition at line 1304 of file dcopclient.cpp.

◆ remoteObjects()

QCStringList DCOPClient::remoteObjects ( const TQCString &  remApp,
bool *  ok = 0 
)

Retrieves the list of objects of the remote application remApp.

Parameters
remApphe id of the application
okif not null, the function sets ok to true if successful and false if an error occurred
Returns
the list of object ids

Definition at line 1288 of file dcopclient.cpp.

◆ resume()

void DCOPClient::resume ( )

Resumes the processing of DCOP events.

See also
suspend().
isSuspended()

Definition at line 711 of file dcopclient.cpp.

◆ send() [1/2]

bool DCOPClient::send ( const TQCString &  remApp,
const TQCString &  remObj,
const TQCString &  remFun,
const TQByteArray &  data 
)

Sends a data block to the server.

Parameters
remAppThe remote application id.
remObjThe name of the remote object.
remFunThe remote function in the specified object to call.
dataThe data to provide to the remote function.
Returns
Whether or not the server was able to accept the send.

Definition at line 1089 of file dcopclient.cpp.

◆ send() [2/2]

bool DCOPClient::send ( const TQCString &  remApp,
const TQCString &  remObj,
const TQCString &  remFun,
const TQString &  data 
)

This function acts exactly the same as the above, but the data parameter can be specified as a TQString for convenience.

Parameters
remAppThe remote application id.
remObjThe name of the remote object.
remFunThe remote function in the specified object to call.
dataThe data to provide to the remote function.
Returns
Whether or not the server was able to accept the send.

Definition at line 1143 of file dcopclient.cpp.

◆ senderId()

TQCString DCOPClient::senderId ( ) const

Returns the appId of the last application that talked to us.

Returns
the application id of the last application that send a message to this client

Definition at line 1083 of file dcopclient.cpp.

◆ setAcceptCalls()

void DCOPClient::setAcceptCalls ( bool  b)

Specify whether the client should accept incoming calls.

By default clients accept incoming calls, but not when connected to a foreign server.

Parameters
btrue to accept calls, false to reject them

Definition at line 967 of file dcopclient.cpp.

◆ setDaemonMode()

void DCOPClient::setDaemonMode ( bool  daemonMode)

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 KDE termination signal after 10 seconds.

Parameters
daemonModetrue to enable daemon mode, false to disable

Definition at line 1348 of file dcopclient.cpp.

◆ setDefaultObject()

void DCOPClient::setDefaultObject ( const TQCString &  objId)

Installs object objId as application-wide default object.

All app-wide messages that have not been processed by the dcopclient will be send further to objId.

Parameters
objIdthe id of the new default object

Definition at line 2073 of file dcopclient.cpp.

◆ setMainClient()

void DCOPClient::setMainClient ( DCOPClient *  mainClient)
static

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 KDE applications, the main client usually is the same as TDEApplication::dcopClient().

Parameters
mainClientthe new main dcop client

Definition at line 604 of file dcopclient.cpp.

◆ setNotifications()

void DCOPClient::setNotifications ( bool  enabled)

Enables / disables the applicationRegistered() / applicationRemoved() signals.

Note that a counter is maintained about how often this method was called. If this method is called twice with enabled set to true, notifications will be enabled until it was called with enabled set to false as often.

They are disabled by default.

Parameters
enabledtrue to enable notifications, false to disable

Definition at line 1336 of file dcopclient.cpp.

◆ setPriorityCall()

void DCOPClient::setPriorityCall ( bool  b)

Definition at line 2261 of file dcopclient.cpp.

◆ setQtBridgeEnabled()

void DCOPClient::setQtBridgeEnabled ( bool  b)

Specify whether Qt objects of the application should be accessible via DCOP.

By default the DCOP - Qt bridge is enabled.

Parameters
btrue to make Qt objects accessible over DCOP
Since
3.0.2

Definition at line 978 of file dcopclient.cpp.

◆ setServerAddress()

void DCOPClient::setServerAddress ( const TQCString &  addr)
static

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.

Parameters
addrthe new address of the server

Definition at line 671 of file dcopclient.cpp.

◆ socket()

int DCOPClient::socket ( ) const

Returns the socket fd that is used for communication with the server.

Returns
The socket over which DCOP is communicating with the server.

Definition at line 1042 of file dcopclient.cpp.

◆ suspend()

void DCOPClient::suspend ( )

Temporarily suspends processing of DCOP events.

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.

Be aware that not responding to DCOP requests may cause other programs that want to communicate with your application, to hang.

See also
resume()
isSuspended()

Definition at line 701 of file dcopclient.cpp.

◆ transactionId()

TQ_INT32 DCOPClient::transactionId ( ) const

Test whether the current function call is delayed.

Note: Should be called from inside process() only!

Returns
The ID of the current transaction or 0 if no transaction is going on.
See also
process()
beginTransaction()

Definition at line 2120 of file dcopclient.cpp.

◆ virtual_hook()

void DCOPClient::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 2329 of file dcopclient.cpp.


The documentation for this class was generated from the following files:
  • dcopclient.h
  • dcopc.h
  • dcopclient.cpp

dcop

Skip menu "dcop"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

dcop

Skip menu "dcop"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for dcop by doxygen 1.9.4
This website is maintained by Timothy Pearson.