|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.DCOPObject
public class DCOPObject
Provides an interface for receiving DCOP messages. This class provides an interface for receiving DCOP messages. To use it, simply multiply-inherit from DCOPObject and from some other class, and then implement the DCOPObject.process() method. Because this method is pure virtual, you must implement the method. Note that it is usually more convenient to mark a section in the class with "k_dcop:", add your DCOP methods there and let the IDL compiler do the rest. Read the tutorials for more information.
DCOPClient
,
DCOPObjectProxy
Constructor Summary | |
---|---|
|
DCOPObject()
Creates a DCOPObject and calculates the object id using its physical memory address. |
protected |
DCOPObject(java.lang.Class dummy)
|
|
DCOPObject(org.kde.qt.QObject arg1)
Creates a DCOPObject and calculates the object id using QObject.name(). |
|
DCOPObject(java.lang.String objId)
Creates a DCOPObject with object Id objId. |
Method Summary | |
---|---|
DCOPClient |
callingDcopClient()
Returns the DCOPClient responsible for making the call. |
boolean |
connectDCOPSignal(java.lang.String sender,
java.lang.String senderObj,
java.lang.String signal,
java.lang.String slot,
boolean Volatile)
Connects to a DCOP signal. |
boolean |
disconnectDCOPSignal(java.lang.String sender,
java.lang.String senderObj,
java.lang.String signal,
java.lang.String slot)
Disconnects a DCOP signal. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
void |
emitDCOPSignal(java.lang.String signal,
byte[] data)
Emit signal as DCOP signal from this object with data as
arguments |
protected void |
finalize()
Deletes the wrapped C++ instance |
static DCOPObjectInterface |
find(java.lang.String objId)
Try to find a dcop object with the given id. |
java.util.ArrayList |
functions()
Returns the list of functions understood by the object. |
java.util.ArrayList |
functionsDynamic()
This function is of interest when you used an IDL compiler to generate the implementation for functions() but you still want to list some functions dynamically. |
static boolean |
hasObject(java.lang.String objId)
Checks whether an object with the given id is known in this process. |
java.util.ArrayList |
interfaces()
Returns the names of the interfaces, specific ones last. |
java.util.ArrayList |
interfacesDynamic()
This function is of interest when you used an IDL compiler to generate the implementation for interfaces() but you still want to list some interfaces dynamically. |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
static java.lang.String |
objectName(org.kde.qt.QObject arg1)
Creates an object id for the QObject obj. This is done
using the QObject.name() function. |
java.lang.String |
objId()
Returns the object id of the DCOPObject. |
boolean |
process(java.lang.String fun,
byte[] data,
java.lang.StringBuffer replyType,
byte[] replyData)
Dispatches a message. |
boolean |
processDynamic(java.lang.String fun,
byte[] data,
java.lang.StringBuffer replyType,
byte[] replyData)
This function is of interest when you used an IDL compiler to generate the implementation for process() but you still want to dispatch some functions dynamically. |
void |
setCallingDcopClient(DCOPClient arg1)
|
boolean |
setObjId(java.lang.String objId)
Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DCOPObject(java.lang.Class dummy)
public DCOPObject()
public DCOPObject(org.kde.qt.QObject arg1)
obj
- the object to extract the name frompublic DCOPObject(java.lang.String objId)
objId.
objId
- the object id of the DCOP objectMethod Detail |
---|
public java.lang.String objId()
objId
in interface DCOPObjectInterface
public boolean setObjId(java.lang.String objId)
setObjId
in interface DCOPObjectInterface
objId
- the new object idpublic boolean process(java.lang.String fun, byte[] data, java.lang.StringBuffer replyType, byte[] replyData)
process
in interface DCOPObjectInterface
fun
- is the normalized function signature.
Such a signature usually looks like
foobar(String,int). The return type,
qualifiers like "const" etc. are not part of
the signature.data
- the received datareplyType
- write the reply type in this stringreplyData
- write the reply data in this array
fun
except "functions()" and
"interfaces()".DCOPClient.normalizeFunctionSignature(java.lang.String)
,
functions()
,
DCOPClient.process(java.lang.String, byte[], java.lang.StringBuffer, byte[])
public boolean processDynamic(java.lang.String fun, byte[] data, java.lang.StringBuffer replyType, byte[] replyData)
processDynamic
in interface DCOPObjectInterface
fun
- is the normalized function signature.
Such a signature usually looks like
foobar(String,int). The return type,
qualifiers like "const" etc. are not part of
the signature.data
- the received datareplyType
- write the reply type in this stringreplyData
- write the reply data in this array
process(java.lang.String, byte[], java.lang.StringBuffer, byte[])
,
DCOPClient.normalizeFunctionSignature(java.lang.String)
,
functions()
,
DCOPClient.process(java.lang.String, byte[], java.lang.StringBuffer, byte[])
public java.util.ArrayList functionsDynamic()
functionsDynamic
in interface DCOPObjectInterface
functions()
public java.util.ArrayList interfacesDynamic()
interfacesDynamic
in interface DCOPObjectInterface
interfaces()
public java.util.ArrayList interfaces()
interfaces
in interface DCOPObjectInterface
functions()
public java.util.ArrayList functions()
functions
in interface DCOPObjectInterface
interfaces()
,
process(java.lang.String, byte[], java.lang.StringBuffer, byte[])
,
processDynamic(java.lang.String, byte[], java.lang.StringBuffer, byte[])
,
DCOPClient.normalizeFunctionSignature(java.lang.String)
public void emitDCOPSignal(java.lang.String signal, byte[] data)
signal
as DCOP signal from this object with data
as
arguments
emitDCOPSignal
in interface DCOPObjectInterface
signal
- the signal to emitdata
- the data to sendpublic boolean connectDCOPSignal(java.lang.String sender, java.lang.String senderObj, java.lang.String signal, java.lang.String slot, boolean Volatile)
connectDCOPSignal
in interface DCOPObjectInterface
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.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.
public boolean disconnectDCOPSignal(java.lang.String sender, java.lang.String senderObj, java.lang.String signal, java.lang.String slot)
sender
& signal
are empty. In this
case all connections related to this object in the current client
are disconnected. (Both connections from as well as to this object!)
disconnectDCOPSignal
in interface DCOPObjectInterface
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.
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.
public DCOPClient callingDcopClient()
callingDcopClient
in interface DCOPObjectInterface
public void setCallingDcopClient(DCOPClient arg1)
setCallingDcopClient
in interface DCOPObjectInterface
public static boolean hasObject(java.lang.String objId)
objId
is
known in this process. This query does not ask proxies.public static DCOPObjectInterface find(java.lang.String objId)
objId
- the object id to search
objId.
public static java.lang.String objectName(org.kde.qt.QObject arg1)
obj.
This is done
using the QObject.name() function.
obj
- the object whose name will be used
protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |