diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-11-18 21:21:15 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-11-18 21:21:15 +0100 |
commit | 9a134f5699708c76d4abd12da71c9df03830556a (patch) | |
tree | b44367da3f90252d7d9dffd12c71e1160174bd11 /tqdbusdata.h | |
parent | 52933e3b969e8b44f6a94db486cb27ddf5c322d7 (diff) | |
download | dbus-1-tqt-9a134f5699708c76d4abd12da71c9df03830556a.tar.gz dbus-1-tqt-9a134f5699708c76d4abd12da71c9df03830556a.zip |
Add support for data type UnixFD
Diffstat (limited to 'tqdbusdata.h')
-rw-r--r-- | tqdbusdata.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/tqdbusdata.h b/tqdbusdata.h index b3f5927..ae64706 100644 --- a/tqdbusdata.h +++ b/tqdbusdata.h @@ -31,6 +31,7 @@ class TQCString; class TQT_DBusDataList; class TQT_DBusVariant; class TQT_DBusObjectPath; +class TQT_DBusUnixFd; class TQString; template<typename T> class TQValueList; @@ -172,6 +173,13 @@ public: ObjectPath, /** + * Type when encapsulating a D-Bus unix file handle. + * + * @see fromUnixFd(), toUnixFd() + */ + UnixFd, + + /** * Type when encapsulating a list of values. * * The D-Bus type this maps to is called @c array but since the TQt @@ -254,6 +262,7 @@ public: * - #UInt64 * - #String * - #ObjectPath + * - #UnixFd * * All values need to be of the same type. * @@ -266,6 +275,7 @@ public: * @see fromUInt64KeyMap(), toUInt64KeyMap() * @see fromStringKeyMap(), toStringKeyMap() * @see fromObjectPathKeyMap(), toObjectPathKeyMap() + * @see fromUnixFdKeyMap(), toUnixFdKeyMap() */ Map }; @@ -685,6 +695,34 @@ public: TQT_DBusObjectPath toObjectPath(bool* ok = 0) const; /** + * @brief Creates a data object for the given unix file handle @p value + * + * @param value the value to encapsulate + * + * @return a data object of type #UnixFd containing the @p value + * + * @see toUnixFd() + */ + static TQT_DBusData fromUnixFd(const TQT_DBusUnixFd& value); + + /** + * @brief Tries to get the encapsulated unix file handle value + * + * If the data object is not of type #UnixFd this will fail, i.e. + * the parameter @p ok will be set to @c false if present. + * + * @param ok optional pointer to a bool variable to store the + * success information in, i.e. will be set to @c true on success + * and to @c false if the conversion failed (not of type #UnixFd) + * + * @return the encapsulated object path value or an empty and invalid object + * if it fails + * + * @see fromUnixFd() + */ + TQT_DBusUnixFd toUnixFd(bool* ok = 0) const; + + /** * @brief Creates a data object for the given @p list * * \note The list is allowed to be empty but is required to have a valid type @@ -1129,6 +1167,41 @@ public: TQT_DBusDataMap<TQT_DBusObjectPath> toObjectPathKeyMap(bool* ok = 0) const; /** + * @brief Creates a data object for the given @p map + * + * \note The map is allowed to be empty but is required to have a valid + * value type + * + * The resulting data object will have the keyType() set to #UnixFd. + * + * @param map the map to encapsulate + * + * @return a data object of type #Map containing the @p map or + * an #Invalid object if the map's value type is #Invalid + * + * @see toUnixFdhKeyMap() + */ + static TQT_DBusData fromUnixFdKeyMap(const TQT_DBusDataMap<TQT_DBusUnixFd>& map); + + /** + * @brief Tries to get the encapsulated map + * + * If the data object is not of type #Map or if its value type is not + * #UnixFd this will fail, i.e. the parameter @p ok will be set to + * @c false if present. + * + * @param ok optional pointer to a bool variable to store the + * success information in, i.e. will be set to @c true on success + * and to @c false if the conversion failed (not of type #Map or + * value type not #UnixFd) + * + * @return the encapsulated map or an empty and #Invalid map if it fails + * + * @see fromUnixFdKeyMap() + */ + TQT_DBusDataMap<TQT_DBusUnixFd> toUnixFdKeyMap(bool* ok = 0) const; + + /** * @brief Creates the data objects D-Bus signature * * Recursivly builds the D-Bus signature of the data object if it holds a |