|
DBus-1-TQt
1.0
|
00001 /* qdbusmessage.h TQT_DBusMessage object 00002 * 00003 * Copyright (C) 2005 Harald Fernengel <harry@kdevelop.org> 00004 * Copyright (C) 2005-2007 Kevin Krammer <kevin.krammer@gmx.at> 00005 * 00006 * Licensed under the Academic Free License version 2.1 00007 * 00008 * This program is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00021 * USA. 00022 * 00023 */ 00024 00025 #ifndef TQDBUSMESSAGE_H 00026 #define TQDBUSMESSAGE_H 00027 00028 #include "tqdbusmacros.h" 00029 #include "tqdbusdata.h" 00030 00031 #include <tqvaluelist.h> 00032 00033 #include <limits.h> 00034 00035 class TQT_DBusError; 00036 class TQT_DBusMessagePrivate; 00037 struct DBusMessage; 00038 00115 class TQDBUS_EXPORT TQT_DBusMessage: public TQValueList<TQT_DBusData> 00116 { 00117 friend class TQT_DBusConnection; 00118 public: 00125 enum 00126 { 00130 DefaultTimeout = -1, 00131 00135 NoTimeout = INT_MAX 00136 }; 00137 00151 enum MessageType 00152 { 00157 InvalidMessage, 00158 00164 MethodCallMessage, 00165 00171 ReplyMessage, 00172 00178 ErrorMessage, 00179 00185 SignalMessage 00186 }; 00187 00196 TQT_DBusMessage(); 00197 00198 00207 TQT_DBusMessage(const TQT_DBusMessage &other); 00208 00215 ~TQT_DBusMessage(); 00216 00231 TQT_DBusMessage &operator=(const TQT_DBusMessage &other); 00232 00249 static TQT_DBusMessage signal(const TQString &path, const TQString &interface, 00250 const TQString &member); 00251 00272 static TQT_DBusMessage methodCall(const TQString &service, const TQString &path, 00273 const TQString &interface, const TQString &method); 00274 00290 static TQT_DBusMessage methodReply(const TQT_DBusMessage &other); 00291 00308 static TQT_DBusMessage methodError(const TQT_DBusMessage &other, const TQT_DBusError& error); 00309 00327 TQString path() const; 00328 00346 TQString interface() const; 00347 00365 TQString member() const; 00366 00385 TQString sender() const; 00386 00398 TQT_DBusError error() const; 00399 00405 MessageType type() const; 00406 00414 int timeout() const; 00415 00436 void setTimeout(int ms); 00437 00452 int serialNumber() const; 00453 00475 int replySerialNumber() const; 00476 00477 //protected: 00490 DBusMessage *toDBusMessage() const; 00491 00507 static TQT_DBusMessage fromDBusMessage(DBusMessage *dmsg); 00508 00509 private: 00510 TQT_DBusMessagePrivate *d; 00511 }; 00512 00513 #endif 00514