00001
00022 #ifndef _TelepathyQt4_outgoing_stream_tube_channel_h_HEADER_GUARD_
00023 #define _TelepathyQt4_outgoing_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/StreamTubeChannel>
00030 #include <TelepathyQt4/PendingOperation>
00031
00032 class QHostAddress;
00033 class QTcpServer;
00034 class QLocalServer;
00035
00036 namespace Tp
00037 {
00038
00039 class TELEPATHY_QT4_EXPORT OutgoingStreamTubeChannel : public StreamTubeChannel
00040 {
00041 Q_OBJECT
00042 Q_DISABLE_COPY(OutgoingStreamTubeChannel)
00043
00044 public:
00045 static const Feature FeatureCore;
00046
00047 static OutgoingStreamTubeChannelPtr create(const ConnectionPtr &connection,
00048 const QString &objectPath, const QVariantMap &immutableProperties);
00049
00050 virtual ~OutgoingStreamTubeChannel();
00051
00052 PendingOperation *offerTcpSocket(const QHostAddress &address, quint16 port, const QVariantMap ¶meters);
00053 PendingOperation *offerTcpSocket(const QTcpServer *server, const QVariantMap ¶meters);
00054
00055 PendingOperation *offerUnixSocket(const QString &socketAddress, const QVariantMap ¶meters,
00056 bool requireCredentials = false);
00057 PendingOperation *offerUnixSocket(const QLocalServer *server, const QVariantMap ¶meters,
00058 bool requireCredentials = false);
00059
00060 QHash<uint, Tp::ContactPtr> contactsForConnections() const;
00061
00062 QHash<QPair<QHostAddress,quint16>, uint> connectionsForSourceAddresses() const;
00063 QHash<uchar, uint> connectionsForCredentials() const;
00064
00065 protected:
00066 OutgoingStreamTubeChannel(const ConnectionPtr &connection, const QString &objectPath,
00067 const QVariantMap &immutableProperties,
00068 const Feature &coreFeature = OutgoingStreamTubeChannel::FeatureCore);
00069
00070 private Q_SLOTS:
00071 TELEPATHY_QT4_NO_EXPORT void onNewRemoteConnection(uint contactId,
00072 const QDBusVariant ¶meter, uint connectionId);
00073 TELEPATHY_QT4_NO_EXPORT void onContactsRetrieved(const QUuid &uuid,
00074 const QList<Tp::ContactPtr> &contacts);
00075 TELEPATHY_QT4_NO_EXPORT void onConnectionClosed(uint connectionId, const QString &errorName,
00076 const QString &errorMessage);
00077
00078 private:
00079 struct Private;
00080 friend struct PendingOpenTube;
00081 friend struct Private;
00082 Private *mPriv;
00083 };
00084
00085 }
00086
00087 #endif