52 : TQObject(parent, (name ? name :
"TQT_DBusProxy")),
58 TQObject* parent,
const char* name)
59 : TQObject(parent, (name ? name :
"TQT_DBusProxy")),
67 TQObject* parent,
const char* name)
68 : TQObject(parent, (name ? name :
"TQT_DBusProxy")),
133 return d->canSend &&
d->connection.isConnected();
138 if (!
d->canSend || method.isEmpty() || !
d->connection.isConnected())
142 d->interface, method);
145 return d->connection.send(message);
152 if (!
d->canSend || method.isEmpty() || !
d->connection.isConnected())
156 d->interface, method);
169 if (!
d->canSend || method.isEmpty() || !
d->connection.isConnected())
173 d->interface, method);
176 return d->connection.sendWithAsyncReply(message,
this,
187 if (!
d->path.isEmpty() &&
d->path != message.
path())
193 if (
d->service.startsWith(
":") &&
d->service != message.
sender())
196 if (!
d->interface.isEmpty() &&
d->interface != message.
interface())
204 d->error = message.
error();
209#include "tqdbusproxy.moc"
Provides access to a specific D-Bus bus.
Class for transporting D-Bus errors.
A message converts and transports data over D-Bus.
static TQT_DBusMessage methodCall(const TQString &service, const TQString &path, const TQString &interface, const TQString &method)
Creates a message for sending a D-Bus method call.
TQT_DBusError error() const
Returns the error of an error message.
TQString interface() const
Returns the message's interface name.
TQString sender() const
Returns the name of the message sender.
int replySerialNumber() const
Returns the message's reply serial number.
TQString path() const
Returns the message's object path.
TQT_DBusConnection connection
virtual ~TQT_DBusProxy()
Destroys the proxy instance.
void setService(const TQString &service)
Sets the peer's service name.
virtual void handleDBusSignal(const TQT_DBusMessage &message)
Handles D-Bus signals received on the proxy's connection.
void dbusSignal(const TQT_DBusMessage &message)
Signal emitted for D-Bus signals from the peer.
bool canSend() const
Returns whether the proxy can be used to send method calls.
TQT_DBusMessage sendWithReply(const TQString &method, const TQValueList< TQT_DBusData > ¶ms, TQT_DBusError *error=0) const
Sends a method call to the peer object and waits for the reply.
TQString interface() const
Returns the name of the peer interface.
void setInterface(const TQString &interface)
Sets the name of the peer interface.
void setPath(const TQString &path)
Sets the peer's object path.
TQString service() const
Returns the peer's service name.
bool setConnection(const TQT_DBusConnection &connection)
Sets the D-Bus connection to work on.
int sendWithAsyncReply(const TQString &method, const TQValueList< TQT_DBusData > ¶ms)
Sends a method call to the peer object but does not wait for an answer.
bool send(const TQString &method, const TQValueList< TQT_DBusData > ¶ms) const
Sends a method call to the peer object.
virtual void handleAsyncReply(const TQT_DBusMessage &message)
Handles replies to asynchronous method calls.
TQString path() const
Returns the peer's object path.
TQT_DBusProxy(TQObject *parent=0, const char *name=0)
Creates a proxy without binding it to a service or connection.
const TQT_DBusConnection & connection() const
Returns the currently used D-Bus connection.
void asyncReply(int callID, const TQT_DBusMessage &message)
Signal emitted for received replies to asynchronous method calls.
TQT_DBusError lastError() const
Returns the last error seen by the proxy.