Home · All Classes · All Namespaces · Modules · Functions · Files
outgoing-stream-tube-channel.h
1 
22 #ifndef _TelepathyQt_outgoing_stream_tube_channel_h_HEADER_GUARD_
23 #define _TelepathyQt_outgoing_stream_tube_channel_h_HEADER_GUARD_
24 
25 #ifndef IN_TP_QT_HEADER
26 #error IN_TP_QT_HEADER
27 #endif
28 
29 #include <TelepathyQt/StreamTubeChannel>
30 #include <TelepathyQt/PendingOperation>
31 
32 class QHostAddress;
33 class QTcpServer;
34 class QLocalServer;
35 
36 namespace Tp
37 {
38 
39 class TP_QT_EXPORT OutgoingStreamTubeChannel : public StreamTubeChannel
40 {
41  Q_OBJECT
42  Q_DISABLE_COPY(OutgoingStreamTubeChannel)
43 
44 public:
45  static const Feature FeatureCore;
46 
47  static OutgoingStreamTubeChannelPtr create(const ConnectionPtr &connection,
48  const QString &objectPath, const QVariantMap &immutableProperties);
49 
50  virtual ~OutgoingStreamTubeChannel();
51 
52  PendingOperation *offerTcpSocket(const QHostAddress &address, quint16 port,
53  const QVariantMap &parameters = QVariantMap());
54  PendingOperation *offerTcpSocket(const QTcpServer *server,
55  const QVariantMap &parameters = QVariantMap());
56 
57  PendingOperation *offerUnixSocket(const QString &socketAddress,
58  const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false);
59  PendingOperation *offerUnixSocket(const QLocalServer *server,
60  const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false);
61 
62  QHash<uint, Tp::ContactPtr> contactsForConnections() const;
63 
64  QHash<QPair<QHostAddress,quint16>, uint> connectionsForSourceAddresses() const;
65  QHash<uchar, uint> connectionsForCredentials() const;
66 
67 protected:
68  OutgoingStreamTubeChannel(const ConnectionPtr &connection, const QString &objectPath,
69  const QVariantMap &immutableProperties,
70  const Feature &coreFeature = OutgoingStreamTubeChannel::FeatureCore);
71 
72 private Q_SLOTS:
73  TP_QT_NO_EXPORT void onNewRemoteConnection(uint contactId,
74  const QDBusVariant &parameter, uint connectionId);
75  TP_QT_NO_EXPORT void onContactsRetrieved(const QUuid &uuid,
76  const QList<Tp::ContactPtr> &contacts);
77  TP_QT_NO_EXPORT void onConnectionClosed(uint connectionId,
78  const QString &errorName, const QString &errorMessage);
79 
80 private:
81  struct Private;
82  friend struct PendingOpenTube;
83  friend struct Private;
84  Private *mPriv;
85 };
86 
87 }
88 
89 #endif
The StreamTubeChannel class represents a Telepathy channel of type StreamTube.
Definition: stream-tube-channel.h:36
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
static const Feature FeatureCore
Definition: outgoing-stream-tube-channel.h:45
Definition: abstract-adaptor.cpp:31
The Feature class represents a feature that can be enabled on demand.
Definition: feature.h:41
The OutgoingStreamTubeChannel class represents an outgoing Telepathy channel of type StreamTube...
Definition: outgoing-stream-tube-channel.h:39


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.7