00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef TQDBUSUNIXFD_H
00025 #define TQDBUSUNIXFD_H
00026
00027 #include "dbus/dbus.h"
00028 #ifndef QT_H
00029 #include "ntqshared.h"
00030 #endif // QT_H
00031 #include "tqdbusmacros.h"
00032
00033
00034 #ifndef DBUS_TYPE_UNIX_FD
00035 #define DBUS_TYPE_UNIX_FD ((int) 'h')
00036 #endif
00037
00038 #ifndef DBUS_TYPE_UNIX_FD_AS_STRING
00039 #define DBUS_TYPE_UNIX_FD_AS_STRING "h"
00040 #endif
00041
00051 class TQDBUS_EXPORT TQT_DBusUnixFd
00052 {
00053 public:
00057 TQT_DBusUnixFd();
00058
00064 TQT_DBusUnixFd(const TQT_DBusUnixFd& other);
00065
00071 TQT_DBusUnixFd(int other);
00072
00076 virtual ~TQT_DBusUnixFd();
00077
00086 bool isValid() const;
00087
00093 int fileDescriptor() const;
00094
00100 void setFileDescriptor(int fileDescriptor);
00101
00107 void giveFileDescriptor(int fileDescriptor);
00108
00114 TQT_DBusUnixFd &operator=( const TQT_DBusUnixFd &other );
00115
00124 inline bool operator==(const TQT_DBusUnixFd& other) const
00125 {
00126 return (&other == this) || (other.d == d);
00127 }
00128
00137 inline bool operator!=(const TQT_DBusUnixFd& other) const
00138 {
00139 return (&other != this) && (other.d != d);
00140 }
00141
00142
00143 protected:
00144 struct TQT_DBusUnixFdPrivate : public TQShared {
00145 int fd;
00146 } *d;
00147
00148 };
00149
00150 #endif