DBus-1-TQt  1.0
tqdbusdata.h
Go to the documentation of this file.
1 /* qdbusdata.h DBUS data transport type
2  *
3  * Copyright (C) 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 TQDBUSDATA_H
25 #define TQDBUSDATA_H
26 
27 #include "tqdbusmacros.h"
28 #include <tqglobal.h>
29 
30 class TQCString;
31 class TQT_DBusDataList;
32 class TQT_DBusVariant;
33 class TQT_DBusObjectPath;
34 class TQT_DBusUnixFd;
35 class TQString;
36 
37 template<typename T> class TQValueList;
38 template<typename T> class TQT_DBusDataMap;
39 
59 {
60 public:
73  enum Type
74  {
84  Invalid = 0,
85 
92 
99 
106 
113 
120 
127 
134 
141 
148 
157 
174 
181 
197 
237 
246 
280  Map
281  };
282 
286  TQT_DBusData();
287 
296  TQT_DBusData(const TQT_DBusData& other);
297 
304  ~TQT_DBusData();
305 
316  TQT_DBusData& operator=(const TQT_DBusData& other);
317 
329  bool operator==(const TQT_DBusData& other) const;
330 
340  bool operator!=(const TQT_DBusData& other) const;
341 
349  inline bool isValid() const { return type() != TQT_DBusData::Invalid; }
350 
359  Type type() const;
360 
375  Type keyType() const;
376 
385  inline const char* typeName() const { return typeName(type()); }
386 
397  static const char* typeName(Type type);
398 
408  static TQT_DBusData fromBool(bool value);
409 
424  bool toBool(bool* ok = 0) const;
425 
435  static TQT_DBusData fromByte(TQ_UINT8 value);
436 
451  TQ_UINT8 toByte(bool* ok = 0) const;
452 
462  static TQT_DBusData fromInt16(TQ_INT16 value);
463 
478  TQ_INT16 toInt16(bool* ok = 0) const;
479 
489  static TQT_DBusData fromUInt16(TQ_UINT16 value);
490 
505  TQ_UINT16 toUInt16(bool* ok = 0) const;
506 
516  static TQT_DBusData fromInt32(TQ_INT32 value);
517 
532  TQ_INT32 toInt32(bool* ok = 0) const;
533 
543  static TQT_DBusData fromUInt32(TQ_UINT32 value);
544 
559  TQ_UINT32 toUInt32(bool* ok = 0) const;
560 
570  static TQT_DBusData fromInt64(TQ_INT64 value);
571 
586  TQ_INT64 toInt64(bool* ok = 0) const;
587 
597  static TQT_DBusData fromUInt64(TQ_UINT64 value);
598 
613  TQ_UINT64 toUInt64(bool* ok = 0) const;
614 
624  static TQT_DBusData fromDouble(double value);
625 
640  double toDouble(bool* ok = 0) const;
641 
651  static TQT_DBusData fromString(const TQString& value);
652 
667  TQString toString(bool* ok = 0) const;
668 
678  static TQT_DBusData fromObjectPath(const TQT_DBusObjectPath& value);
679 
695  TQT_DBusObjectPath toObjectPath(bool* ok = 0) const;
696 
706  static TQT_DBusData fromUnixFd(const TQT_DBusUnixFd& value);
707 
723  TQT_DBusUnixFd toUnixFd(bool* ok = 0) const;
724 
743  static TQT_DBusData fromList(const TQT_DBusDataList& list);
744 
759  TQT_DBusDataList toList(bool* ok = 0) const;
760 
779  static TQT_DBusData fromTQValueList(const TQValueList<TQT_DBusData>& list);
780 
794  TQValueList<TQT_DBusData> toTQValueList(bool* ok = 0) const;
795 
807  static TQT_DBusData fromStruct(const TQValueList<TQT_DBusData>& memberList);
808 
825  TQValueList<TQT_DBusData> toStruct(bool* ok = 0) const;
826 
836  static TQT_DBusData fromVariant(const TQT_DBusVariant& value);
837 
852  TQT_DBusVariant toVariant(bool* ok = 0) const;
853 
859  TQT_DBusData getAsVariantData();
860 
876  static TQT_DBusData fromByteKeyMap(const TQT_DBusDataMap<TQ_UINT8>& map);
877 
894  TQT_DBusDataMap<TQ_UINT8> toByteKeyMap(bool* ok = 0) const;
895 
911  static TQT_DBusData fromInt16KeyMap(const TQT_DBusDataMap<TQ_INT16>& map);
912 
929  TQT_DBusDataMap<TQ_INT16> toInt16KeyMap(bool* ok = 0) const;
930 
946  static TQT_DBusData fromUInt16KeyMap(const TQT_DBusDataMap<TQ_UINT16>& map);
947 
964  TQT_DBusDataMap<TQ_UINT16> toUInt16KeyMap(bool* ok = 0) const;
965 
981  static TQT_DBusData fromInt32KeyMap(const TQT_DBusDataMap<TQ_INT32>& map);
982 
999  TQT_DBusDataMap<TQ_INT32> toInt32KeyMap(bool* ok = 0) const;
1000 
1016  static TQT_DBusData fromUInt32KeyMap(const TQT_DBusDataMap<TQ_UINT32>& map);
1017 
1034  TQT_DBusDataMap<TQ_UINT32> toUInt32KeyMap(bool* ok = 0) const;
1035 
1051  static TQT_DBusData fromInt64KeyMap(const TQT_DBusDataMap<TQ_INT64>& map);
1052 
1069  TQT_DBusDataMap<TQ_INT64> toInt64KeyMap(bool* ok = 0) const;
1070 
1086  static TQT_DBusData fromUInt64KeyMap(const TQT_DBusDataMap<TQ_UINT64>& map);
1087 
1104  TQT_DBusDataMap<TQ_UINT64> toUInt64KeyMap(bool* ok = 0) const;
1105 
1121  static TQT_DBusData fromStringKeyMap(const TQT_DBusDataMap<TQString>& map);
1122 
1139  TQT_DBusDataMap<TQString> toStringKeyMap(bool* ok = 0) const;
1140 
1156  static TQT_DBusData fromObjectPathKeyMap(const TQT_DBusDataMap<TQT_DBusObjectPath>& map);
1157 
1174  TQT_DBusDataMap<TQT_DBusObjectPath> toObjectPathKeyMap(bool* ok = 0) const;
1175 
1191  static TQT_DBusData fromUnixFdKeyMap(const TQT_DBusDataMap<TQT_DBusUnixFd>& map);
1192 
1209  TQT_DBusDataMap<TQT_DBusUnixFd> toUnixFdKeyMap(bool* ok = 0) const;
1210 
1223  TQCString buildDBusSignature() const;
1224 
1225 private:
1226  class Private;
1227  Private* d;
1228 };
1229 
1230 #endif
const char * typeName() const
Returns the string representation of the object&#39;s Type.
Definition: tqdbusdata.h:385
Data type for representing a D-Bus variant.
Definition: tqdbusvariant.h:56
Class for representing D-Bus unix file handles.
Definition: tqdbusunixfd.h:51
Class to transport lists of D-Bus data types.
#define TQDBUS_EXPORT
Definition: tqdbusmacros.h:29
bool isValid() const
Checks whether the data object contains a valid content.
Definition: tqdbusdata.h:349
Class for accurately representing D-Bus data types.
Definition: tqdbusdata.h:58
Class for representing D-Bus object paths.
Private * d
Definition: tqdbusdata.h:1226
Type
Enum for the data types used in D-Bus messages.
Definition: tqdbusdata.h:73
Class to transport maps of D-Bus data types.
Definition: tqdbusdata.h:38