DBus-1-TQt
1.0
|
#include <tqdbusobject.h>
Public Member Functions | |
virtual | ~TQT_DBusObjectBase () |
Protected Member Functions | |
virtual bool | handleMethodCall (const TQT_DBusMessage &message)=0 |
bool | delegateMethodCall (const TQT_DBusMessage &message, TQT_DBusObjectBase *delegate) |
Friends | |
class | TQT_DBusConnectionPrivate |
Base interface for D-Bus service objects.
In order to register a service object with the TQT_DBusConnection it needs to implement the interface specified by this class.
The connection will forward all method calls that have a path equivalent to the path the service object was registered with to the object's handleMethodCall() method. See TQT_DBusConnection::registerObject()
If for some reason, e.g. the call is not meant for this interface, or the method is unknown, the implementation can just return false
and the connection will handle the rest.
See section Providing services over D-Bus for documentation on how to use TQT_DBusObjectBase
Definition at line 302 of file tqdbusobject.h.
|
inlinevirtual |
|
inlineprotected |
Delegate a method call to another object.
When a service object is built as a collection of separated interface class instances, i.e. each interface of the object is implemented in its own TQT_DBusObjectBase subclass and the main object just wanst to pass on the method calls to the respective interface implementations, it can do so by calling this base class method.
Since it is a method of the base class, it can call the otherwise protected handleMethodCall() of the interface implementor.
See Service interfaces for an example.
message | the method call to delegate |
delegate | the object which should handle the call instead |
true
if the message can be handled independent if handling resulted in an error. In this case implementations should an error reply. Returns false
only if interface or method are unknown Definition at line 365 of file tqdbusobject.h.
References handleMethodCall().
|
protectedpure virtual |
Method call entry point.
This method has to be implemented to handle method calls sent to the service object. An object implementation can handle all its interfaces in one class or again forward the method call to interface implementators.
If for some reason, e.g. the call is not meant for this interface, or the method is unknown, the implementation can just return false
and the connection will handle the rest.
If an error occurs during the method call, e.g. the number of parameters or their types are not what would be expected, the service object should reply with a TQT_DBusMessage of type TQT_DBusMessage::ErrorMessage which in turn should include the D-Bus error describing the problem. See TQT_DBusConnection::send() for sending reply messages.
See TQT_DBusMessage::methodError() and TQT_DBusMessage::methodReply() on how to create suitable reply messages for the given method call.
message | the method call to handle |
true
if the message can be handled independent if handling resulted in an error. In this case implementations should an error reply. Returns false
only if interface or method are unknown
|
friend |
Definition at line 304 of file tqdbusobject.h.