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

dcop

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
DCOPObject Class Reference

#include <dcopobject.h>

Inheritance diagram for DCOPObject:
Test

Public Member Functions

 DCOPObject ()
 
 DCOPObject (TQObject *obj)
 
 DCOPObject (const TQCString &objId)
 
virtual ~DCOPObject ()
 
TQCString objId () const
 
bool setObjId (const TQCString &objId)
 
virtual bool process (const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData)
 
virtual bool processDynamic (const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData)
 
virtual QCStringList functionsDynamic ()
 
virtual QCStringList interfacesDynamic ()
 
virtual QCStringList interfaces ()
 
virtual QCStringList functions ()
 
void emitDCOPSignal (const TQCString &signal, const TQByteArray &data)
 
bool connectDCOPSignal (const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &slot, bool Volatile)
 
bool disconnectDCOPSignal (const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &slot)
 
DCOPClient * callingDcopClient ()
 
void setCallingDcopClient (DCOPClient *)
 

Static Public Member Functions

static bool hasObject (const TQCString &objId)
 
static DCOPObject * find (const TQCString &objId)
 
static TQPtrList< DCOPObject > match (const TQCString &partialId)
 
static TQCString objectName (TQObject *obj)
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Detailed Description

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.

See also
DCOPClient
DCOPObjectProxy
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 67 of file dcopobject.h.

Constructor & Destructor Documentation

◆ DCOPObject() [1/3]

DCOPObject::DCOPObject ( )

Creates a DCOPObject and calculates the object id using its physical memory address.

Definition at line 47 of file dcopobject.cpp.

◆ DCOPObject() [2/3]

DCOPObject::DCOPObject ( TQObject *  obj)

Creates a DCOPObject and calculates the object id using TQObject::name().

Parameters
objthe object to extract the name from

Definition at line 54 of file dcopobject.cpp.

◆ DCOPObject() [3/3]

DCOPObject::DCOPObject ( const TQCString &  objId)

Creates a DCOPObject with object Id objId.

Parameters
objIdthe object id of the DCOP object

Definition at line 69 of file dcopobject.cpp.

◆ ~DCOPObject()

DCOPObject::~DCOPObject ( )
virtual

Destroys the DCOPObject and removes it from the map of known objects.

Definition at line 78 of file dcopobject.cpp.

Member Function Documentation

◆ callingDcopClient()

DCOPClient * DCOPObject::callingDcopClient ( )

Returns the DCOPClient responsible for making the call.

Only call this function while you are handling a DCOP call.

Returns
the DCOPClient responsible for making the call. This information is only guaranteed to be correct when entering your DCOP function.
Since
3.1

Definition at line 88 of file dcopobject.cpp.

◆ connectDCOPSignal()

bool DCOPObject::connectDCOPSignal ( const TQCString &  sender,
const TQCString &  senderObj,
const TQCString &  signal,
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.
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 220 of file dcopobject.cpp.

◆ disconnectDCOPSignal()

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

Disconnects a DCOP signal.

A special case is when both 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!)

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. 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 234 of file dcopobject.cpp.

◆ emitDCOPSignal()

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

Emit signal as DCOP signal from this object with data as arguments.

Parameters
signalthe signal to emit
datathe data to send

Definition at line 213 of file dcopobject.cpp.

◆ find()

DCOPObject * DCOPObject::find ( const TQCString &  objId)
static

Try to find a dcop object with the given id.

This function does not query the DCOPObjectProxy.

Parameters
objIdthe object id to search
Returns
the DCOPObject for the id objId.

Definition at line 125 of file dcopobject.cpp.

◆ functions()

QCStringList DCOPObject::functions ( )
virtual

Returns the list of functions understood by the object.

It gets reimplemented by the IDL compiler. If you don't use the IDL compiler, consider implementing this function manually if you want your object to be easily scriptable.

Rationale: functions() allows an interpreter to do client-side type-casting properly.

Note to implementators: remember to call the baseclasses implementation.

Returns
a list of functions
See also
interfaces()
process()
processDynamic()
DCOPClient::normalizeFunctionSignature()

Definition at line 205 of file dcopobject.cpp.

◆ functionsDynamic()

QCStringList DCOPObject::functionsDynamic ( )
virtual

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.

Dynamically means that the methods may appear and vanish during runtime.

Returns
A list of the additional functions, default is an empty list.
See also
functions(),

Definition at line 193 of file dcopobject.cpp.

◆ hasObject()

bool DCOPObject::hasObject ( const TQCString &  objId)
static

Checks whether an object with the given id is known in this process.

Returns
true if an object with the questionable objId is known in this process. This query does not ask proxies.

DCOPObjectProxy

Definition at line 117 of file dcopobject.cpp.

◆ interfaces()

QCStringList DCOPObject::interfaces ( )
virtual

Returns the names of the interfaces, specific ones last.

The functions gets reimplemented by the IDL compiler. If you don't use the IDL compiler, consider implementing this function manually if you want your object to be easily explorable.

Returns
a list of interfaces
See also
functions()

Definition at line 198 of file dcopobject.cpp.

◆ interfacesDynamic()

QCStringList DCOPObject::interfacesDynamic ( )
virtual

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.

Dynamically means that they may appear and vanish during runtime.

Returns
A list of the additional interfaces, default is an empty list.
See also
interfaces(),

Definition at line 187 of file dcopobject.cpp.

◆ match()

TQPtrList< DCOPObject > DCOPObject::match ( const TQCString &  partialId)
static

Tries to find an object using a partial object id.

This function is used for multicasting a DCOP message to several objects inside a single process.

Parameters
partialIdthe partial object id to search for
Returns
a list of DCOPObjects beginning with the string contained in partialId.

Definition at line 135 of file dcopobject.cpp.

◆ objectName()

TQCString DCOPObject::objectName ( TQObject *  obj)
static

Creates an object id for the TQObject obj.

This is done using the TQObject::name() function.

Parameters
objthe object whose name will be used
Returns
the created object id

Definition at line 146 of file dcopobject.cpp.

◆ objId()

TQCString DCOPObject::objId ( ) const

Returns the object id of the DCOPObject.

Returns
the object's id

Definition at line 112 of file dcopobject.cpp.

◆ process()

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

Dispatches a message.

Usually you want to use an IDL compiler to automatically generate an implementation for this function.

If this function returns false, then processDynamic() is called.

Note to implementators: remember to call the baseclasses implementation. It handles the functions "functions()" and "interfaces()" which return the lists of supported functions and interfaces, respectively.

Parameters
funis the normalized function signature. Such a signature usually looks like foobar(TQString,int). The return type, qualifiers like "const" etc. are not part of the signature.
datathe received data
replyTypewrite the reply type in this string
replyDatawrite the reply data in this array
Returns
true if successful, false otherwise. The default implementation returns false for all fun except "functions()" and "interfaces()".
See also
DCOPClient::normalizeFunctionSignature()
functions()
DCOPClient::process()

Reimplemented in TDEUniqueApplication.

Definition at line 166 of file dcopobject.cpp.

◆ processDynamic()

bool DCOPObject::processDynamic ( const TQCString &  fun,
const TQByteArray &  data,
TQCString &  replyType,
TQByteArray &  replyData 
)
virtual

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.

Dynamically means that methods may appear and vanish during runtime.

Parameters
funis the normalized function signature. Such a signature usually looks like foobar(TQString,int). The return type, qualifiers like "const" etc. are not part of the signature.
datathe received data
replyTypewrite the reply type in this string
replyDatawrite the reply data in this array
Returns
true if successful, false otherwise. The default implementation returns always false.
See also
process()
DCOPClient::normalizeFunctionSignature()
functions(),
DCOPClient::process()

Definition at line 183 of file dcopobject.cpp.

◆ setCallingDcopClient()

void DCOPObject::setCallingDcopClient ( DCOPClient *  client)

Definition at line 93 of file dcopobject.cpp.

◆ setObjId()

bool DCOPObject::setObjId ( const TQCString &  objId)

Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected.

Parameters
objIdthe new object id

Definition at line 98 of file dcopobject.cpp.

◆ virtual_hook()

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

Definition at line 279 of file dcopobject.cpp.


The documentation for this class was generated from the following files:
  • dcopobject.h
  • dcopobject.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.