24 #include "dbus/dbus.h" 35 #include <tqvaluelist.h> 47 delete (TQString*)
value.pointer;
114 tqFatal(
"TQT_DBusData::Private: unhandled map key type %d(%s)",
189 if (
d->deref())
delete d;
194 if (&other ==
this)
return *
this;
196 if (
d->deref())
delete d;
207 if (&other ==
this)
return true;
209 if (
d == other.
d)
return true;
300 tqFatal(
"TQT_DBusData operator== unhandled map key type %d(%s)",
369 if (ok != 0) *ok =
false;
373 if (ok != 0) *ok =
true;
392 if (ok != 0) *ok =
false;
396 if (ok != 0) *ok =
true;
415 if (ok != 0) *ok =
false;
419 if (ok != 0) *ok =
true;
438 if (ok != 0) *ok =
false;
442 if (ok != 0) *ok =
true;
461 if (ok != 0) *ok =
false;
465 if (ok != 0) *ok =
true;
484 if (ok != 0) *ok =
false;
488 if (ok != 0) *ok =
true;
507 if (ok != 0) *ok =
false;
511 if (ok != 0) *ok =
true;
530 if (ok != 0) *ok =
false;
534 if (ok != 0) *ok =
true;
553 if (ok != 0) *ok =
false;
557 if (ok != 0) *ok =
true;
576 if (ok != 0) *ok =
false;
580 if (ok != 0) *ok =
true;
602 if (ok != 0) *ok =
false;
606 if (ok != 0) *ok =
true;
628 if (ok != 0) *ok =
false;
632 if (ok != 0) *ok =
true;
653 if (ok != 0) *ok =
false;
657 if (ok != 0) *ok =
true;
669 bool internalOk =
false;
674 if (ok != 0) *ok =
false;
687 for (; it != endIt; ++it)
689 if ((*it).d->type ==
Invalid)
return data;
702 if (ok != 0) *ok =
false;
706 if (ok != 0) *ok =
true;
725 if (ok != 0) *ok =
false;
729 if (ok != 0) *ok =
true;
737 variant.
value = *
this;
757 if (ok != 0) *ok =
false;
761 if (ok != 0) *ok =
true;
781 if (ok != 0) *ok =
false;
785 if (ok != 0) *ok =
true;
806 if (ok != 0) *ok =
false;
810 if (ok != 0) *ok =
true;
830 if (ok != 0) *ok =
false;
834 if (ok != 0) *ok =
true;
855 if (ok != 0) *ok =
false;
859 if (ok != 0) *ok =
true;
879 if (ok != 0) *ok =
false;
883 if (ok != 0) *ok =
true;
904 if (ok != 0) *ok =
false;
908 if (ok != 0) *ok =
true;
928 if (ok != 0) *ok =
false;
932 if (ok != 0) *ok =
true;
953 if (ok != 0) *ok =
false;
957 if (ok != 0) *ok =
true;
978 if (ok != 0) *ok =
false;
982 if (ok != 0) *ok =
true;
994 return DBUS_TYPE_BOOLEAN_AS_STRING;
996 return DBUS_TYPE_BYTE_AS_STRING;
998 return DBUS_TYPE_INT16_AS_STRING;
1000 return DBUS_TYPE_UINT16_AS_STRING;
1002 return DBUS_TYPE_INT32_AS_STRING;
1004 return DBUS_TYPE_UINT32_AS_STRING;
1006 return DBUS_TYPE_INT64_AS_STRING;
1008 return DBUS_TYPE_UINT64_AS_STRING;
1010 return DBUS_TYPE_DOUBLE_AS_STRING;
1012 return DBUS_TYPE_STRING_AS_STRING;
1014 return DBUS_TYPE_OBJECT_PATH_AS_STRING;
1018 return DBUS_TYPE_VARIANT_AS_STRING;
1025 template <
typename T>
1036 TQCString signature;
1043 signature = DBUS_TYPE_ARRAY_AS_STRING;
1053 signature += DBUS_STRUCT_BEGIN_CHAR;
1060 for (; it != endIt; ++it)
1062 signature += (*it).buildDBusSignature();
1064 signature += DBUS_STRUCT_END_CHAR;
1069 signature += DBUS_TYPE_ARRAY_AS_STRING;
1070 signature += DBUS_DICT_ENTRY_BEGIN_CHAR;
1077 signature += qDBusSignatureForMapValue<TQ_UINT8>(
1081 signature += qDBusSignatureForMapValue<TQ_INT16>(
1085 signature += qDBusSignatureForMapValue<TQ_UINT16>(
1089 signature += qDBusSignatureForMapValue<TQ_INT32>(
1093 signature += qDBusSignatureForMapValue<TQ_UINT32>(
1097 signature += qDBusSignatureForMapValue<TQ_INT64>(
1101 signature += qDBusSignatureForMapValue<TQ_UINT64>(
1105 signature += qDBusSignatureForMapValue<TQString>(
1109 signature += qDBusSignatureForMapValue<TQT_DBusObjectPath>(
1113 signature += qDBusSignatureForMapValue<TQT_DBusUnixFd>(
1120 signature += DBUS_DICT_ENTRY_END_CHAR;
Type keyType() const
Returns the Type of the key type for maps.
bool hasContainerValueType() const
Checks whether the value type is a data container itself.
const char * typeName() const
Returns the string representation of the object's Type.
static TQT_DBusData fromInt64(TQ_INT64 value)
Creates a data object for the given signed 64-bit integer value.
TQT_DBusVariant toVariant(bool *ok=0) const
Tries to get the encapsulated variant value.
#define DBUS_TYPE_UNIX_FD_AS_STRING
static TQT_DBusData fromUInt64KeyMap(const TQT_DBusDataMap< TQ_UINT64 > &map)
Creates a data object for the given map.
bool operator==(const TQT_DBusData &other) const
Checks if the given other data object is equal to this instance.
TQT_DBusData::Type keyType() const
Returns the key type of the map object.
Data type for representing a D-Bus variant.
union TQT_DBusData::Private::@0 value
static TQT_DBusData fromObjectPath(const TQT_DBusObjectPath &value)
Creates a data object for the given object path value.
static TQT_DBusData fromString(const TQString &value)
Creates a data object for the given string value.
TQT_DBusData & operator=(const TQT_DBusData &other)
Copies a given other data object.
static TQT_DBusData fromByte(TQ_UINT8 value)
Creates a data object for the given byte (unsigned char) value.
TQ_UINT16 toUInt16(bool *ok=0) const
Tries to get the encapsulated unsigned 16-bit integer value.
TQT_DBusData containerItemType() const
Returns a container prototype for the list's element type.
TQT_DBusObjectPath toObjectPath(bool *ok=0) const
Tries to get the encapsulated object path value.
TQT_DBusData::Type type() const
Returns the element type of the list object.
Class for representing D-Bus unix file handles.
bool toBool(bool *ok=0) const
Tries to get the encapsulated boolean value.
static TQT_DBusData fromInt64KeyMap(const TQT_DBusDataMap< TQ_INT64 > &map)
Creates a data object for the given map.
TQT_DBusDataList toList(bool *ok=0) const
Tries to get the encapsulated list.
TQString signature
The D-Bus data signature of the data contained in value.
Class to transport lists of D-Bus data types.
bool hasContainerItemType() const
Checks whether the element type is a data container itself.
TQValueList< TQT_DBusData > toTQValueList(bool *ok=0) const
Tries to get the encapsulated list.
static TQT_DBusData fromStruct(const TQValueList< TQT_DBusData > &memberList)
Creates a data object for the given struct's memberList.
TQValueList< TQT_DBusData > toStruct(bool *ok=0) const
Tries to get the encapsulated struct memberList.
~TQT_DBusData()
Destroys the data object.
static TQT_DBusData fromUInt64(TQ_UINT64 value)
Creates a data object for the given unsigned 64-bit integer value.
static TQT_DBusData fromInt16(TQ_INT16 value)
Creates a data object for the given signed 16-bit integer value.
bool isValid() const
Returns whether the current content is considered a valid unix file handle.
Type type() const
Returns the Type of the data object.
TQ_INT32 toInt32(bool *ok=0) const
Tries to get the encapsulated signed 32-bit integer value.
static TQT_DBusData fromTQValueList(const TQValueList< TQT_DBusData > &list)
Creates a data object for the given list.
static TQT_DBusData fromUnixFd(const TQT_DBusUnixFd &value)
Creates a data object for the given unix file handle value.
TQValueList< TQT_DBusData > toTQValueList() const
Converts the list object into a TQValueList with TQT_DBusData elements.
TQ_INT64 toInt64(bool *ok=0) const
Tries to get the encapsulated signed 64-bit integer value.
static TQT_DBusData fromList(const TQT_DBusDataList &list)
Creates a data object for the given list.
TQT_DBusData::Type valueType() const
Returns the value type of the map object.
double toDouble(bool *ok=0) const
Tries to get the encapsulated double value.
Class for accurately representing D-Bus data types.
static TQT_DBusData fromUInt16(TQ_UINT16 value)
Creates a data object for the given unsigned 16-bit integer value.
static TQT_DBusData fromDouble(double value)
Creates a data object for the given double value.
Class for representing D-Bus object paths.
TQT_DBusData()
Creates an empty, Invalid data object.
bool operator!=(const TQT_DBusData &other) const
Checks if the given other data object is different from this instance.
TQCString buildDBusSignature() const
Creates the data objects D-Bus signature.
static TQT_DBusData fromInt16KeyMap(const TQT_DBusDataMap< TQ_INT16 > &map)
Creates a data object for the given map.
TQT_DBusUnixFd toUnixFd(bool *ok=0) const
Tries to get the encapsulated unix file handle value.
static TQT_DBusData fromUInt16KeyMap(const TQT_DBusDataMap< TQ_UINT16 > &map)
Creates a data object for the given map.
TQT_DBusDataMap< TQ_INT64 > toInt64KeyMap(bool *ok=0) const
Tries to get the encapsulated map.
static TQT_DBusData fromBool(bool value)
Creates a data object for the given boolean value.
TQ_UINT32 toUInt32(bool *ok=0) const
Tries to get the encapsulated unsigned 32-bit integer value.
TQT_DBusData value
The D-Bus data type to transport as a variant.
static TQT_DBusData fromUnixFdKeyMap(const TQT_DBusDataMap< TQT_DBusUnixFd > &map)
Creates a data object for the given map.
static TQT_DBusData fromInt32(TQ_INT32 value)
Creates a data object for the given signed 32-bit integer value.
TQ_UINT8 toByte(bool *ok=0) const
Tries to get the encapsulated byte (unsigned char) value.
TQT_DBusDataMap< TQ_UINT8 > toByteKeyMap(bool *ok=0) const
Tries to get the encapsulated map.
static TQT_DBusData fromStringKeyMap(const TQT_DBusDataMap< TQString > &map)
Creates a data object for the given map.
TQT_DBusDataMap< TQString > toStringKeyMap(bool *ok=0) const
Tries to get the encapsulated map.
TQT_DBusDataMap< TQ_INT32 > toInt32KeyMap(bool *ok=0) const
Tries to get the encapsulated map.
TQT_DBusDataMap< TQ_INT16 > toInt16KeyMap(bool *ok=0) const
Tries to get the encapsulated map.
TQString toString(bool *ok=0) const
Tries to get the encapsulated string value.
TQ_INT16 toInt16(bool *ok=0) const
Tries to get the encapsulated signed 16-bit integer value.
static TQT_DBusData fromUInt32(TQ_UINT32 value)
Creates a data object for the given unsigned 32-bit integer value.
static TQT_DBusData fromInt32KeyMap(const TQT_DBusDataMap< TQ_INT32 > &map)
Creates a data object for the given map.
static TQT_DBusData fromVariant(const TQT_DBusVariant &value)
Creates a data object for the given variant value.
static TQT_DBusData fromUInt32KeyMap(const TQT_DBusDataMap< TQ_UINT32 > &map)
Creates a data object for the given map.
TQT_DBusDataMap< TQT_DBusObjectPath > toObjectPathKeyMap(bool *ok=0) const
Tries to get the encapsulated map.
TQCString qDBusSignatureForMapValue(const TQT_DBusDataMap< T > &map)
Type
Enum for the data types used in D-Bus messages.
TQT_DBusDataMap< TQ_UINT64 > toUInt64KeyMap(bool *ok=0) const
Tries to get the encapsulated map.
TQT_DBusDataMap< TQ_UINT16 > toUInt16KeyMap(bool *ok=0) const
Tries to get the encapsulated map.
TQT_DBusDataMap< TQT_DBusUnixFd > toUnixFdKeyMap(bool *ok=0) const
Tries to get the encapsulated map.
static TQT_DBusData fromObjectPathKeyMap(const TQT_DBusDataMap< TQT_DBusObjectPath > &map)
Creates a data object for the given map.
TQ_UINT64 toUInt64(bool *ok=0) const
Tries to get the encapsulated unsigned 64-bit integer value.
static const char * qDBusTypeForTQT_DBusType(TQT_DBusData::Type type)
Class to transport maps of D-Bus data types.
bool isValid() const
Returns whether the current content is considered a valid object path.
TQT_DBusData containerValueType() const
Returns a container prototype for the map's value type.
TQT_DBusData getAsVariantData()
Creates a variant from this object and returns it as a TQT_DBusData object.
static TQT_DBusData fromByteKeyMap(const TQT_DBusDataMap< TQ_UINT8 > &map)
Creates a data object for the given map.
TQT_DBusDataMap< TQ_UINT32 > toUInt32KeyMap(bool *ok=0) const
Tries to get the encapsulated map.