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

incoming-stream-tube-channel.h

00001 
00022 #ifndef _TelepathyQt4_incoming_stream_tube_channel_h_HEADER_GUARD_
00023 #define _TelepathyQt4_incoming_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 
00031 #include <QtNetwork/QHostAddress>
00032 
00033 class QIODevice;
00034 
00035 namespace Tp
00036 {
00037 
00038 class PendingStreamTubeConnection;
00039 
00040 class TELEPATHY_QT4_EXPORT IncomingStreamTubeChannel : public StreamTubeChannel
00041 {
00042     Q_OBJECT
00043     Q_DISABLE_COPY(IncomingStreamTubeChannel)
00044 
00045 public:
00046     static IncomingStreamTubeChannelPtr create(const ConnectionPtr &connection,
00047             const QString &objectPath, const QVariantMap &immutableProperties);
00048 
00049     virtual ~IncomingStreamTubeChannel();
00050 
00051     PendingStreamTubeConnection *acceptTubeAsTcpSocket();
00052     PendingStreamTubeConnection *acceptTubeAsTcpSocket(const QHostAddress &allowedAddress,
00053             quint16 allowedPort);
00054     PendingStreamTubeConnection *acceptTubeAsUnixSocket(bool requireCredentials = false);
00055 
00056     QPair<QHostAddress, quint16> ipAddress() const;
00057     QString localAddress() const;
00058 
00059 protected:
00060     IncomingStreamTubeChannel(const ConnectionPtr &connection,
00061             const QString &objectPath,
00062             const QVariantMap &immutableProperties,
00063             const Feature &coreFeature = StreamTubeChannel::FeatureStreamTube);
00064 
00065 private Q_SLOTS:
00066     TELEPATHY_QT4_NO_EXPORT void onAcceptTubeFinished(Tp::PendingOperation *op);
00067     TELEPATHY_QT4_NO_EXPORT void onNewLocalConnection(uint connectionId);
00068 
00069 private:
00070     struct Private;
00071     friend class PendingStreamTubeConnection;
00072     friend struct Private;
00073     Private *mPriv;
00074 };
00075 
00076 }
00077 
00078 #endif


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.5.12