org.kde.koala
public class DCOPClient extends QObject
byte[] data; QDataStream arg(data, IO_WriteOnly); arg << String("This is text I am serializing"); client.send("someApp", "someObject", "someFunction(String)", data);See DCOPClientSignals for signals emitted by DCOPClient
See Also: KApplication
UNKNOWN: Inter-process communication and remote procedure calls for KDE applications.
Constructor Summary | |
---|---|
protected | DCOPClient(Class dummy) |
DCOPClient()
Constructs a new DCOP client, but does not attach to any server. |
Method Summary | |
---|---|
boolean | acceptCalls()
Returns whether the client handles incoming calls. |
String | appId()
Returns the current app id or a null string if the application
hasn't yet been registered. |
boolean | attach()
Attaches to the DCOP server.
|
void | bindToApp()
Internal function for KUniqueApplication to register the DCOPClient
with the application in case the application didn't exist at the
time the DCOPClient was created. |
boolean | call(String remApp, String remObj, String remFun, byte[] data, StringBuffer replyType, byte[] replyData, boolean useEventLoop, int timeout)
Performs a synchronous send and receive.
|
int | callAsync(String remApp, String remObj, String remFun, byte[] data, QObject callBackObj, String callBackSlot)
Performs a asynchronous send with receive callback.
|
String | className() |
boolean | connectDCOPSignal(String sender, String senderObj, String signal, String receiverObj, String slot, boolean Volatile)
Connects to a DCOP signal. |
static String | dcopServerFile(String hostname)
File with information how to reach the dcopserver. |
static String | dcopServerFile() |
String | defaultObject()
Returns the current default object or an empty string if no object is
installed as default object.
|
boolean | detach()
Detaches from the DCOP server. |
boolean | disconnectDCOPSignal(String sender, String senderObj, String signal, String receiverObj, String slot)
Disconnects a DCOP signal.
|
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
static void | emergencyClose() |
void | emitDCOPSignal(String object, String signal, byte[] data)
Emits signal as DCOP signal from object object with data as
arguments. |
void | emitDCOPSignal(String signal, byte[] data) |
protected void | finalize() Deletes the wrapped C++ instance |
boolean | find(String app, String arg2, String fun, byte[] data, StringBuffer replyType, byte[] replyData)
Receives a DCOPFind message from the server. |
static DCOPClient | findLocalClient(String _appId)
Look for the given client only in this process. |
boolean | findObject(String remApp, String remObj, String remFun, byte[] data, StringBuffer foundApp, StringBuffer foundObj, boolean 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. |
static String | iceauthPath()
Return the path of iceauth or an empty string if not found. |
boolean | isApplicationRegistered(String remApp)
Checks whether remApp is registered with the DCOP server. |
boolean | isAttached()
Returns whether or not the client is attached to the server. |
boolean | isAttachedToForeignServer()
Returns whether the client is attached to a server owned by
another user. |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
boolean | isRegistered()
Returns whether or not the client is registered at the server. |
boolean | isSuspended()
Returns whether DCOP events are being processed. |
static DCOPClient | mainClient()
Returns the application's main dcop client. |
QMetaObject | metaObject() |
static String | normalizeFunctionSignature(String fun)
Normalizes the function signature fun.
A normalized signature doesn't contain any unnecessary whitespace
anymore. |
static String | postMortemFunction() |
static String | postMortemObject() |
static String | postMortemSender()
Provides information about the last DCOP call for debugging purposes. |
boolean | process(String fun, byte[] data, StringBuffer replyType, byte[] replyData)
Reimplement this function to handle app-wide function calls unassociated w/an object.
|
protected void | processSocketData(int socknum)
Process data from the socket. |
boolean | qtBridgeEnabled()
Returns whether the DCOP - Qt bridge is enabled.
|
boolean | receive(String app, String arg2, String fun, byte[] data, StringBuffer replyType, byte[] replyData)
Receives a DCOPSend or DCOPCall message from the server. |
String | registerAs(String appId, boolean addPID)
Registers at the DCOP server.
|
String | registerAs(String appId) |
ArrayList | registeredApplications()
Retrieves the list of all currently registered applications
from dcopserver. |
ArrayList | remoteFunctions(String remApp, String remObj, boolean[] ok)
Retrieves the list of functions of the remote object remObj
of application remApp |
ArrayList | remoteFunctions(String remApp, String remObj) |
ArrayList | remoteInterfaces(String remApp, String remObj, boolean[] ok)
Retrieves the list of interfaces of the remote object remObj
of application remApp. |
ArrayList | remoteInterfaces(String remApp, String remObj) |
ArrayList | remoteObjects(String remApp, boolean[] ok)
Retrieves the list of objects of the remote application remApp. |
ArrayList | remoteObjects(String remApp) |
void | resume()
Resumes the processing of DCOP events. |
boolean | send(String remApp, String remObj, String remFun, byte[] data)
Sends a data block to the server. |
boolean | send(String remApp, String remObj, String remFun, String data)
This function acts exactly the same as the above, but the data
parameter can be specified as a String for convenience. |
String | senderId()
Returns the appId of the last application that talked to us. |
void | setAcceptCalls(boolean b)
Specify whether the client should accept incoming calls.
|
void | setDaemonMode(boolean daemonMode)
Tells the dcopserver to treat the client as daemon client, not
as regular client.
|
void | setDefaultObject(String objId)
Installs object objId as application-wide default object.
|
static void | setMainClient(DCOPClient mainClient)
Sets the application's main dcop client. |
void | setNotifications(boolean enabled)
Enables / disables the applicationRegistered() /
applicationRemoved() signals.
|
void | setPriorityCall(boolean arg1)
Switch to priority call mode. |
void | setQtBridgeEnabled(boolean b)
Specify whether Qt objects of the application should be accessible
via DCOP.
|
static void | setServerAddress(String addr)
Sets the address of a server to use upon attaching.
|
int | socket()
Returns the socket fd that is used for communication with the server. |
void | suspend()
Temporarily suspends processing of DCOP events.
|
int | transactionId()
Test whether the current function call is delayed.
|
Returns: true if the client accepts calls
UNKNOWN: Returns whether the client handles incoming calls.
Returns: the application id, or null if not registered
UNKNOWN: Returns the current app id or a null string if the application hasn't yet been registered.
Returns: true if attaching was successful.
UNKNOWN: Attaches to the DCOP server.
UNKNOWN:
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: remApp the remote application's id remObj the remote object id remFun the remote function id data the data to send replyType the type of the reply will be written here replyData the data of the reply will be written here useEventLoop if true the event loop will be started when the call blocks too long timeout timeout for the call in miliseconds, or -1 for no timeout
Returns: true if successful, false otherwise
See Also: DCOPClient
UNKNOWN: Performs a synchronous send and receive.
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, String replyType,
const byte[] &replyData);Parameters: remApp the remote application's id remObj the remote object id remFun the remote function id data the data to send callBackObj object to call back callBackSlot slot 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: DCOPClient DCOPClient
UNKNOWN: Performs a asynchronous send with receive callback.
Parameters: sender the name of the client that emits the signal. When empty
the signal will be passed from any client. senderObj the name of the sending object that emits the signal. signal the name of the signal. The arguments should match with slot. receiverObj The name of the object to call slot The name of the slot to call. Its arguments should match with signal. Volatile If 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.
Volatile
is true and sender
does not exist.
signal
and slot
do not have matching arguments.
UNKNOWN: Connects to a DCOP signal.
Parameters: hostname Hostname to use, if empty current hostname of the system is used.
Returns: Filename that contains information how to contact the DCOPserver.
UNKNOWN: File with information how to reach the dcopserver.
Returns: the id of the new default object
UNKNOWN: Returns the current default object or an empty string if no object is installed as default object.
Returns: true if successful, false otherwise
UNKNOWN: Detaches from the DCOP server.
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: sender the name of the client that emits the signal. senderObj the name of the object that emits the signal. If empty all objects will be disconnected. signal the name of the signal. The arguments should match with slot. receiverObj The name of the object the signal is connected to. If empty all objects will be disconnected. slot The name of the slot the signal is connected to. If empty all slots will be disconnected.
Returns: false if no connection(s) where removed.
UNKNOWN: Disconnects a DCOP signal.
UNKNOWN:
signal
as DCOP signal from object object
with data
as
arguments.UNKNOWN: Emits signal
as DCOP signal from object object
with data
as arguments.
DCOPFind
message from the server.Parameters: app The application the message was intended for. Should be equal to our appId that we passed when the DCOPClient was created. obj The name of the object to pass the data on to. fun The name of the function in the object to call. data The arguments for the function. replyType write the reply type in this string replyData write the reply data in this array
UNKNOWN:
UNKNOWN: Look for the given client only in this process.
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: remApp The remote application id. remObj The name of the remote object. remFun The remote function in the specified object to call. This function should return a boolean and is used as criteria. data The data to provide to the remote function. foundApp The remote application id that matched the criteria. foundObj The remote object that matched the criteria. useEventLoop if true the event loop will be started when the call blocks too long timeout timeout 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.
See Also: DCOPClient
UNKNOWN: Searches for an object which matches a criteria.
UNKNOWN: Return the path of iceauth or an empty string if not found.
remApp
is registered with the DCOP server.Parameters: remApp the id of the remote application
Returns: true if the remote application is registered, otherwise false.
UNKNOWN: Checks whether remApp
is registered with the DCOP server.
Returns: true if attached, false if not
UNKNOWN: Returns whether or not the client is attached to the server.
Returns: true if attached to a foreign server, false if not
UNKNOWN: Returns whether the client is attached to a server owned by another user.
Returns: true if registered at the server
UNKNOWN: Returns whether or not the client is registered at the server.
See Also: DCOPClient #
UNKNOWN: Returns whether DCOP events are being processed.
Returns: the application's main dcop client
UNKNOWN: Returns the application's main dcop client.
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(String,int)"When using send() or call(), normalization is done automatically for you.
Parameters: fun the function signature to normalize
Returns: the normalized function
UNKNOWN: Normalizes the function signature fun.
UNKNOWN: @short @internal
UNKNOWN: @short @internal
UNKNOWN:
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: fun the normalized function signature data the received data replyType write the reply type in this string replyData write the reply data in this array
Returns: true if successful, false otherwise
See Also: DCOPClient
UNKNOWN: Reimplement this function to handle app-wide function calls unassociated w/an object.
Parameters: socknum the fd of the socket
UNKNOWN: Process data from the socket.
Returns: true if Qt objects are accessible over DCOP
UNKNOWN: Returns whether the DCOP - Qt bridge is enabled.
Parameters: app The application the message was intended for. Should be equal to our appId that we passed when the DCOPClient was created. obj The name of the object to pass the data on to. fun The name of the function in the object to call. data The arguments for the function. replyType write the reply type in this string replyData write the reply data in this array
Returns: true if successful, false otherwise
UNKNOWN:
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: appId the id of the application addPID true to add the process id
Returns: The actual appId
used for the registration or a null string
if the registration wasn't successful.
UNKNOWN: Registers at the DCOP server.
Returns: a list of all regietered applications
UNKNOWN: Retrieves the list of all currently registered applications from dcopserver.
remObj
of application remApp
Parameters: remApp the id of the application remObj the id of the object ok if not null, the function sets ok
to true if successful
and false if an error occurred
Returns: the list of function ids
UNKNOWN: Retrieves the list of functions of the remote object remObj
of application remApp
remObj
of application remApp.
Parameters: remApp the id of the application remObj the id of the object ok if not null, the function sets ok
to true if successful
and false if an error occurred
Returns: the list of interfaces
UNKNOWN: Retrieves the list of interfaces of the remote object remObj
of application remApp.
remApp.
Parameters: remApp he id of the application ok if not null, the function sets ok
to true if successful
and false if an error occurred
Returns: the list of object ids
UNKNOWN: Retrieves the list of objects of the remote application remApp.
See Also: #
DCOPClient
UNKNOWN: Resumes the processing of DCOP events.
Parameters: remApp The remote application id. remObj The name of the remote object. remFun The remote function in the specified object to call. data The data to provide to the remote function.
Returns: Whether or not the server was able to accept the send.
UNKNOWN: Sends a data block to the server.
Parameters: remApp The remote application id. remObj The name of the remote object. remFun The remote function in the specified object to call. data The data to provide to the remote function.
Returns: Whether or not the server was able to accept the send.
UNKNOWN: This function acts exactly the same as the above, but the data parameter can be specified as a String for convenience.
Returns: the application id of the last application that send a message to this client
UNKNOWN: Returns the appId of the last application that talked to us.
Parameters: b true to accept calls, false to reject them
UNKNOWN: Specify whether the client should accept incoming calls.
Parameters: daemonMode true to enable daemon mode, false to disable
UNKNOWN: Tells the dcopserver to treat the client as daemon client, not as regular client.
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: objId the id of the new default object
UNKNOWN: Installs object objId
as application-wide default object.
Parameters: mainClient the new main dcop client
UNKNOWN: Sets the application's main dcop client.
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: enabled true to enable notifications, false to disable
UNKNOWN: Enables / disables the applicationRegistered() / applicationRemoved() signals.
UNKNOWN:
Parameters: b true to make Qt objects accessible over DCOP
UNKNOWN: Specify whether Qt objects of the application should be accessible via DCOP.
Parameters: addr the new address of the server
UNKNOWN: Sets the address of a server to use upon attaching.
Returns: The socket over which DCOP is communicating with the server.
UNKNOWN: Returns the socket fd that is used for communication with the server.
See Also: DCOPClient DCOPClient
UNKNOWN: Temporarily suspends processing of DCOP events.
Returns: The ID of the current transaction or 0 if no transaction is going on.
See Also: DCOPClient DCOPClient
UNKNOWN: Test whether the current function call is delayed.