| Home · All Classes · All Namespaces · Modules · Functions · Files

stream-tube-channel.h

    00001
    00022 #ifndef _TelepathyQt4_stream_tube_channel_h_HEADER_GUARD_
    00023 #define _TelepathyQt4_stream_tube_channel_h_HEADER_GUARD_
    00024
    00025 #ifndef IN_TELEPATHY_QT4_HEADER
    00026 #error IN_TELEPATHY_QT4_HEADER
    00027 #endif
    00028
    00029 #include <TelepathyQt4/TubeChannel>
    00030
    00031 class QHostAddress;
    00032
    00033 namespace Tp
    00034 {
    00035
    00036 class TELEPATHY_QT4_EXPORT StreamTubeChannel : public TubeChannel
    00037 {
    00038     Q_OBJECT
    00039     Q_DISABLE_COPY(StreamTubeChannel)
    00040
    00041 public:
    00042     static const Feature FeatureCore;
    00043     // FIXME (API/ABI break) Remove FeatureStreamTube in favour of FeatureCore
    00044     static const Feature FeatureStreamTube;
    00045     static const Feature FeatureConnectionMonitoring;
    00046
    00047     static StreamTubeChannelPtr create(const ConnectionPtr &connection,
    00048             const QString &objectPath, const QVariantMap &immutableProperties);
    00049
    00050     virtual ~StreamTubeChannel();
    00051
    00052     QString service() const;
    00053
    00054     bool supportsIPv4SocketsOnLocalhost() const;
    00055     bool supportsIPv4SocketsWithSpecifiedAddress() const;
    00056
    00057     bool supportsIPv6SocketsOnLocalhost() const;
    00058     bool supportsIPv6SocketsWithSpecifiedAddress() const;
    00059
    00060     bool supportsUnixSocketsOnLocalhost() const;
    00061     bool supportsUnixSocketsWithCredentials() const;
    00062
    00063     bool supportsAbstractUnixSocketsOnLocalhost() const;
    00064     bool supportsAbstractUnixSocketsWithCredentials() const;
    00065
    00066     // API/ABI break TODO: return QSet<uint> instead
    00067     UIntList connections() const;
    00068
    00069     SocketAddressType addressType() const;
    00070
    00071     QPair< QHostAddress, quint16 > ipAddress() const;
    00072     QString localAddress() const;
    00073
    00074 Q_SIGNALS:
    00075     void newConnection(uint connectionId);
    00076     void connectionClosed(uint connectionId, const QString &errorName,
    00077             const QString &errorMessage);
    00078
    00079 protected:
    00080     StreamTubeChannel(const ConnectionPtr &connection, const QString &objectPath,
    00081             const QVariantMap &immutableProperties,
    00082             const Feature &coreFeature = StreamTubeChannel::FeatureCore);
    00083
    00084     TELEPATHY_QT4_DEPRECATED void setBaseTubeType(uint type);
    00085     TELEPATHY_QT4_DEPRECATED void setConnections(UIntList connections); // -> {add,remove}Connection
    00086     void addConnection(uint connection);
    00087     void removeConnection(uint connection, const QString &error, const QString &message);
    00088     void setAddressType(SocketAddressType type);
    00089     SocketAccessControl accessControl() const;
    00090     void setAccessControl(SocketAccessControl accessControl);
    00091     void setIpAddress(const QPair<QHostAddress, quint16> &address);
    00092     void setLocalAddress(const QString &address);
    00093     bool isDroppingConnections() const;
    00094
    00095 private Q_SLOTS:
    00096     TELEPATHY_QT4_NO_EXPORT void gotStreamTubeProperties(Tp::PendingOperation *op);
    00097     TELEPATHY_QT4_NO_EXPORT void onConnectionClosed(uint, const QString &, const QString &);
    00098     TELEPATHY_QT4_NO_EXPORT void dropConnections();
    00099
    00100 private:
    00101     struct Private;
    00102     friend struct Private;
    00103     Private *mPriv;
    00104 };
    00105
    00106 }
    00107
    00108 #endif