00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TelepathyQt4_Prototype_StreamedMediaChannel_H_
00023 #define TelepathyQt4_Prototype_StreamedMediaChannel_H_
00024
00025 #include <TelepathyQt4/Client/Connection>
00026 #include <TelepathyQt4/Client/Channel>
00027
00028 #include <QObject>
00029 #include <QVariantMap>
00030 #include <QPointer>
00031
00032 #ifdef DEPRECATED_ENABLED__
00033 #define ATTRIBUTE_DEPRECATED __attribute__((deprecated))
00034 #else
00035 #define ATTRIBUTE_DEPRECATED
00036 #endif
00037
00038
00039 namespace TpPrototype {
00040
00041 class StreamedMediaChannelPrivate;
00042 class Contact;
00043 class Account;
00044
00095 class StreamedMediaChannel : public QObject
00096 {
00097 Q_OBJECT
00098 public:
00103 bool isValid() const;
00104
00109 ~StreamedMediaChannel();
00110
00116 bool acceptIncomingStream();
00117
00123 bool rejectIncomingStream();
00124
00132 bool requestChannel( QList<Telepathy::MediaStreamType> types );
00133
00134 bool requestStreams( TpPrototype::Contact* contact, QList<Telepathy::MediaStreamType> types );
00135
00142 bool addContactsToGroup( QList<QPointer<TpPrototype::Contact> > contacts );
00143
00149 bool removeContactsFromGroup( QList<QPointer<TpPrototype::Contact> > contacts );
00150
00157 QList<QPointer<TpPrototype::Contact> > localPendingContacts();
00158
00164 QList<QPointer<TpPrototype::Contact> > members();
00165
00171 bool removeStreams( const QList<uint>& streamIds );
00172
00201 Telepathy::MediaStreamInfoList requestStreams( QList<Telepathy::MediaStreamType> types );
00202
00223 Telepathy::MediaStreamInfoList listStreams();
00224
00225 signals:
00235 void signalIncomingChannel( TpPrototype::Contact* contact );
00236
00244 void signalStreamAdded( TpPrototype::StreamedMediaChannel* channel, uint streamId, Telepathy::MediaStreamType streamType );
00245
00252 void signalStreamRemoved( TpPrototype::StreamedMediaChannel* channel, uint streamId );
00253
00262 void signalContactAdded( TpPrototype::StreamedMediaChannel* channel, TpPrototype::Contact* addedContact );
00263
00273 void signalContactRemoved( TpPrototype::StreamedMediaChannel* channel, TpPrototype::Contact* removedContact );
00274
00280 void signalStreamStateChanged( TpPrototype::StreamedMediaChannel* channel, uint streamID, Telepathy::MediaStreamState streamState );
00281
00292 void signalStreamDirectionChanged( TpPrototype::StreamedMediaChannel* channel, uint streamID, uint streamDirection, uint pendingFlags );
00293
00301 void signalStreamError( TpPrototype::StreamedMediaChannel* channel, uint streamID, uint errorCode, const QString& message );
00302
00307 void signalLocalInvitationAccepted( TpPrototype::StreamedMediaChannel* channel );
00308
00309
00310 public slots:
00316 void slotSetOutputVolume( uint streamId, uint volume );
00317
00324 void slotMuteInput( uint streamId, bool muteState );
00325
00332 void slotMuteOutput( uint streamId, bool muteState );
00333
00340 void slotSetOutputWindow( uint streamId, uint windowId );
00341
00348 void slotAddPreviewWindow( uint windowId );
00349
00356 void slotRemovePreviewWindow( uint windowId );
00357
00363 void slotShutDown();
00364
00365 protected:
00370 StreamedMediaChannel( Contact* contact, Telepathy::Client::ConnectionInterface* connectionInterface , QObject* parent = NULL );
00371
00376 void requestStreamedMediaChannel( uint handle );
00377
00381 void openStreamedMediaChannel( uint handle, uint handleType, const QString& channelPath, const QString& channelType );
00382
00384 void connectSignals();
00385
00387 bool addMembers( QList<uint> handles );
00388
00390 bool removeMembers( QList<uint> handles );
00391
00392 protected slots:
00396 void slotStreamAdded(uint streamID, uint contactHandle, uint streamType);
00397
00401 void slotStreamDirectionChanged(uint streamID, uint streamDirection, uint pendingFlags);
00402
00406 void slotStreamError(uint streamID, uint errorCode, const QString& message);
00407
00411 void slotStreamRemoved(uint streamID);
00412
00416 void slotStreamStateChanged(uint streamID, uint streamState);
00417
00421 void slotMembersChanged(const QString& message,
00422 const Telepathy::UIntList& added,
00423 const Telepathy::UIntList& removed,
00424 const Telepathy::UIntList& localPending,
00425 const Telepathy::UIntList& remotePending,
00426 uint actor,
00427 uint reason);
00428 private:
00429 StreamedMediaChannelPrivate * const d;
00430 friend class ContactManager;
00431 friend class Contact;
00432 };
00433
00434 }
00435
00436 #endif // Header guard