Home · All Classes · All Namespaces · Modules · Functions · Files
streamed-media-channel.h
1 
23 #ifndef _TelepathyQt_streamed_media_channel_h_HEADER_GUARD_
24 #define _TelepathyQt_streamed_media_channel_h_HEADER_GUARD_
25 
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29 
30 #include <TelepathyQt/Channel>
31 #include <TelepathyQt/PendingOperation>
32 #include <TelepathyQt/Object>
33 #include <TelepathyQt/SharedPtr>
34 #include <TelepathyQt/Types>
35 
36 namespace Tp
37 {
38 
40 
41 typedef QList<StreamedMediaStreamPtr> StreamedMediaStreams;
42 
43 class TP_QT_EXPORT_DEPRECATED PendingStreamedMediaStreams : public PendingOperation
44 {
45  Q_OBJECT
46  Q_DISABLE_COPY(PendingStreamedMediaStreams)
47 
48 public:
50 
51  StreamedMediaChannelPtr channel() const;
52 
53  StreamedMediaStreams streams() const;
54 
55 private Q_SLOTS:
56  TP_QT_NO_EXPORT void gotStreams(QDBusPendingCallWatcher *op);
57 
58  TP_QT_NO_EXPORT void onStreamRemoved(const Tp::StreamedMediaStreamPtr &stream);
59  TP_QT_NO_EXPORT void onStreamReady(Tp::PendingOperation *op);
60 
61 private:
62  friend class StreamedMediaChannel;
63 
64  TP_QT_NO_EXPORT PendingStreamedMediaStreams(const StreamedMediaChannelPtr &channel,
65  const ContactPtr &contact,
66  const QList<MediaStreamType> &types);
67 
68  struct Private;
69  friend struct Private;
70  Private *mPriv;
71 };
72 
73 class TP_QT_EXPORT_DEPRECATED StreamedMediaStream : public Object, private ReadyObject
74 {
75  Q_OBJECT
76  Q_DISABLE_COPY(StreamedMediaStream)
77 
78 public:
79  enum SendingState {
83  };
84 
86 
87  StreamedMediaChannelPtr channel() const;
88 
89  uint id() const;
90 
91  ContactPtr contact() const;
92 
93  MediaStreamState state() const;
94  MediaStreamType type() const;
95 
96  SendingState localSendingState() const;
97  SendingState remoteSendingState() const;
98 
99  bool sending() const;
100  bool receiving() const;
101 
102  bool localSendingRequested() const;
103  bool remoteSendingRequested() const;
104 
105  MediaStreamDirection direction() const;
106  MediaStreamPendingSend pendingSend() const;
107 
108  PendingOperation *requestSending(bool send);
109  PendingOperation *requestReceiving(bool receive);
110 
111  PendingOperation *requestDirection(MediaStreamDirection direction);
112  PendingOperation *requestDirection(bool send, bool receive);
113 
114  PendingOperation *startDTMFTone(DTMFEvent event);
115  PendingOperation *stopDTMFTone();
116 
117 Q_SIGNALS:
118  void localSendingStateChanged(Tp::StreamedMediaStream::SendingState localSendingState);
119  void remoteSendingStateChanged(Tp::StreamedMediaStream::SendingState remoteSendingState);
120 
121 private Q_SLOTS:
122  TP_QT_NO_EXPORT void gotContact(Tp::PendingOperation *op);
123 
124 private:
126  friend class StreamedMediaChannel;
127 
128  static const Feature FeatureCore;
129 
130  TP_QT_NO_EXPORT StreamedMediaStream(const StreamedMediaChannelPtr &channel, const MediaStreamInfo &info);
131 
132  TP_QT_NO_EXPORT void gotDirection(uint direction, uint pendingSend);
133  TP_QT_NO_EXPORT void gotStreamState(uint state);
134 
135  struct Private;
136  friend struct Private;
137  Private *mPriv;
138 };
139 
140 class TP_QT_EXPORT_DEPRECATED StreamedMediaChannel : public Channel
141 {
142  Q_OBJECT
143  Q_DISABLE_COPY(StreamedMediaChannel)
144  Q_ENUMS(StateChangeReason)
145 
146 public:
147  static const Feature FeatureCore;
148  static const Feature FeatureStreams;
150 
152  StateChangeReasonUnknown = 0,
153  StateChangeReasonUserRequested = 1
154  };
155 
156  static StreamedMediaChannelPtr create(const ConnectionPtr &connection,
157  const QString &objectPath, const QVariantMap &immutableProperties);
158 
159  virtual ~StreamedMediaChannel();
160 
161  bool awaitingLocalAnswer() const;
162  bool awaitingRemoteAnswer() const;
163 
164  PendingOperation *acceptCall();
165  PendingOperation *hangupCall();
166 
167  StreamedMediaStreams streams() const;
168  StreamedMediaStreams streamsForType(MediaStreamType type) const;
169 
170  PendingStreamedMediaStreams *requestStream(const ContactPtr &contact, MediaStreamType type);
171  PendingStreamedMediaStreams *requestStreams(const ContactPtr &contact, QList<MediaStreamType> types);
172 
173  PendingOperation *removeStream(const StreamedMediaStreamPtr &stream);
174  PendingOperation *removeStreams(const StreamedMediaStreams &streams);
175 
176  bool handlerStreamingRequired() const;
177 
178  LocalHoldState localHoldState() const;
179  LocalHoldStateReason localHoldStateReason() const;
180  PendingOperation *requestHold(bool hold);
181 
182 Q_SIGNALS:
183  void streamAdded(const Tp::StreamedMediaStreamPtr &stream);
184  void streamRemoved(const Tp::StreamedMediaStreamPtr &stream);
185  void streamDirectionChanged(const Tp::StreamedMediaStreamPtr &stream,
186  Tp::MediaStreamDirection direction,
187  Tp::MediaStreamPendingSend pendingSend);
188  void streamStateChanged(const Tp::StreamedMediaStreamPtr &stream,
189  Tp::MediaStreamState state);
190  void streamError(const Tp::StreamedMediaStreamPtr &stream,
191  Tp::MediaStreamError errorCode,
192  const QString &errorMessage);
193 
194  void localHoldStateChanged(Tp::LocalHoldState state,
195  Tp::LocalHoldStateReason reason);
196 
197 protected:
198  StreamedMediaChannel(const ConnectionPtr &connection,
199  const QString &objectPath, const QVariantMap &immutableProperties,
200  const Feature &coreFeature = StreamedMediaChannel::FeatureCore);
201 
202 private Q_SLOTS:
203  TP_QT_NO_EXPORT void onStreamReady(Tp::PendingOperation *op);
204 
205  TP_QT_NO_EXPORT void gotStreams(QDBusPendingCallWatcher *);
206  TP_QT_NO_EXPORT void onStreamAdded(uint, uint, uint);
207  TP_QT_NO_EXPORT void onStreamRemoved(uint);
208  TP_QT_NO_EXPORT void onStreamDirectionChanged(uint, uint, uint);
209  TP_QT_NO_EXPORT void onStreamStateChanged(uint streamId, uint streamState);
210  TP_QT_NO_EXPORT void onStreamError(uint, uint, const QString &);
211 
212  TP_QT_NO_EXPORT void gotLocalHoldState(QDBusPendingCallWatcher *);
213  TP_QT_NO_EXPORT void onLocalHoldStateChanged(uint, uint);
214 
215 private:
217 
218  StreamedMediaStreamPtr addStream(const MediaStreamInfo &streamInfo);
219  StreamedMediaStreamPtr lookupStreamById(uint streamId);
220 
221  struct Private;
222  friend struct Private;
223  Private *mPriv;
224 };
225 
226 } // Tp
227 
228 #endif
SendingState
Definition: streamed-media-channel.h:79
MediaStreamType
Definition: build/TelepathyQt/_gen/constants.h:2716
DTMFEvent
Definition: build/TelepathyQt/_gen/constants.h:3121
The StreamedMediaStream class represents a Telepathy streamed media stream.
Definition: streamed-media-channel.h:73
The Object class provides an object with property notification.
Definition: object.h:39
static const Feature FeatureLocalHoldState
Definition: streamed-media-channel.h:149
StateChangeReason
Definition: streamed-media-channel.h:151
The Feature class represents a feature that can be enabled on demand.
Definition: feature.h:41
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
static const Feature FeatureStreams
Definition: streamed-media-channel.h:148
QFlags< MediaStreamPending > MediaStreamPendingSend
Definition: build/TelepathyQt/_gen/constants.h:682
Definition: ready-object.h:42
MediaStreamState
Definition: build/TelepathyQt/_gen/constants.h:2744
The StreamedMediaChannel class represents a Telepathy channel of type StreamedMedia.
Definition: streamed-media-channel.h:140
static const Feature FeatureCore
Definition: streamed-media-channel.h:147
Definition: build/TelepathyQt/_gen/types.h:1979
Class containing the result of an asynchronous streamed media stream creation request.
Definition: streamed-media-channel.h:43
MediaStreamDirection
Definition: build/TelepathyQt/_gen/constants.h:2777
QList< StreamedMediaStreamPtr > StreamedMediaStreams
Definition: streamed-media-channel.h:39
Definition: build/TelepathyQt/_gen/constants.h:4534
Definition: build/TelepathyQt/_gen/constants.h:4544
LocalHoldState
Definition: build/TelepathyQt/_gen/constants.h:3466
Definition: build/TelepathyQt/_gen/constants.h:4539
MediaStreamError
Definition: build/TelepathyQt/_gen/constants.h:3912
SendingState
Definition: build/TelepathyQt/_gen/constants.h:4529
LocalHoldStateReason
Definition: build/TelepathyQt/_gen/constants.h:3516
The Channel class represents a Telepathy channel.
Definition: channel.h:51


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