|
DBus-1-TQt
1.0
|
00001 /* qdbusproxy.h DBUS Object proxy 00002 * 00003 * Copyright (C) 2005-2007 Kevin Krammer <kevin.krammer@gmx.at> 00004 * 00005 * Licensed under the Academic Free License version 2.1 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00020 * USA. 00021 * 00022 */ 00023 00024 #ifndef TQDBUSPROXY_H 00025 #define TQDBUSPROXY_H 00026 00212 #include <tqobject.h> 00213 00214 #include "tqdbusmacros.h" 00215 00216 class TQT_DBusConnection; 00217 class TQT_DBusData; 00218 class TQT_DBusError; 00219 class TQT_DBusMessage; 00220 00221 template <class T> class TQValueList; 00222 00237 class TQDBUS_EXPORT TQT_DBusProxy : public TQObject 00238 { 00239 Q_OBJECT 00240 00241 public: 00251 TQT_DBusProxy(TQObject* parent = 0, const char* name = 0); 00252 00268 TQT_DBusProxy(const TQT_DBusConnection& connection, TQObject* parent = 0, 00269 const char* name = 0); 00270 00285 TQT_DBusProxy(const TQString& service, const TQString& path, 00286 const TQString& interface, const TQT_DBusConnection& connection, 00287 TQObject* parent = 0, const char* name = 0); 00288 00292 virtual ~TQT_DBusProxy(); 00293 00314 bool setConnection(const TQT_DBusConnection& connection); 00315 00321 const TQT_DBusConnection& connection() const; 00322 00339 void setService(const TQString& service); 00340 00348 TQString service() const; 00349 00367 void setPath(const TQString& path); 00368 00376 TQString path() const; 00377 00395 void setInterface(const TQString& interface); 00396 00404 TQString interface() const; 00405 00424 bool canSend() const; 00425 00445 bool send(const TQString& method, const TQValueList<TQT_DBusData>& params) const; 00446 00467 TQT_DBusMessage sendWithReply(const TQString& method, 00468 const TQValueList<TQT_DBusData>& params, TQT_DBusError* error = 0) const; 00469 00499 int sendWithAsyncReply(const TQString& method, const TQValueList<TQT_DBusData>& params); 00500 00510 TQT_DBusError lastError() const; 00511 00512 signals: 00523 void dbusSignal(const TQT_DBusMessage& message); 00524 00539 void asyncReply(int callID, const TQT_DBusMessage& message); 00540 00541 protected slots: 00561 virtual void handleDBusSignal(const TQT_DBusMessage& message); 00562 00573 virtual void handleAsyncReply(const TQT_DBusMessage& message); 00574 00575 private: 00576 class Private; 00577 Private* d; 00578 00579 private: 00580 TQT_DBusProxy(const TQT_DBusProxy&); 00581 TQT_DBusProxy& operator=(const TQT_DBusProxy&); 00582 }; 00583 00584 #endif 00585