DBus-1-TQt 1.0
Loading...
Searching...
No Matches
tqdbusproxy.h
Go to the documentation of this file.
1/* qdbusproxy.h DBUS Object proxy
2 *
3 * Copyright (C) 2005-2007 Kevin Krammer <kevin.krammer@gmx.at>
4 *
5 * Licensed under the Academic Free License version 2.1
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20 * USA.
21 *
22 */
23
24#ifndef TQDBUSPROXY_H
25#define TQDBUSPROXY_H
26
206
211
212#include <tqobject.h>
213
214#include "tqdbusmacros.h"
215
217class TQT_DBusData;
218class TQT_DBusError;
219class TQT_DBusMessage;
220
221template <class T> class TQValueList;
222
237class TQDBUS_EXPORT TQT_DBusProxy : public TQObject
238{
239 TQ_OBJECT
240
241public:
251 TQT_DBusProxy(TQObject* parent = 0, const char* name = 0);
252
268 TQT_DBusProxy(const TQT_DBusConnection& connection, TQObject* parent = 0,
269 const char* name = 0);
270
285 TQT_DBusProxy(const TQString& service, const TQString& path,
286 const TQString& interface, const TQT_DBusConnection& connection,
287 TQObject* parent = 0, const char* name = 0);
288
292 virtual ~TQT_DBusProxy();
293
315
321 const TQT_DBusConnection& connection() const;
322
339 void setService(const TQString& service);
340
348 TQString service() const;
349
367 void setPath(const TQString& path);
368
376 TQString path() const;
377
395 void setInterface(const TQString& interface);
396
404 TQString interface() const;
405
424 bool canSend() const;
425
445 bool send(const TQString& method, const TQValueList<TQT_DBusData>& params) const;
446
467 TQT_DBusMessage sendWithReply(const TQString& method,
468 const TQValueList<TQT_DBusData>& params, TQT_DBusError* error = 0) const;
469
499 int sendWithAsyncReply(const TQString& method, const TQValueList<TQT_DBusData>& params);
500
510 TQT_DBusError lastError() const;
511
512signals:
523 void dbusSignal(const TQT_DBusMessage& message);
524
539 void asyncReply(int callID, const TQT_DBusMessage& message);
540
541protected slots:
561 virtual void handleDBusSignal(const TQT_DBusMessage& message);
562
573 virtual void handleAsyncReply(const TQT_DBusMessage& message);
574
575private:
576 class Private;
578
579private:
582};
583
584#endif
585
Provides access to a specific D-Bus bus.
Class for accurately representing D-Bus data types.
Definition tqdbusdata.h:59
Class for transporting D-Bus errors.
Definition tqdbuserror.h:41
A message converts and transports data over D-Bus.
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.
Private * d
TQT_DBusProxy & operator=(const TQT_DBusProxy &)
bool canSend() const
Returns whether the proxy can be used to send method calls.
TQT_DBusMessage sendWithReply(const TQString &method, const TQValueList< TQT_DBusData > &params, 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.
TQT_DBusProxy(const TQT_DBusProxy &)
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 > &params)
Sends a method call to the peer object but does not wait for an answer.
bool send(const TQString &method, const TQValueList< TQT_DBusData > &params) 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.
#define TQDBUS_EXPORT