00001
00023 #ifndef _TelepathyQt4_simple_call_observer_h_HEADER_GUARD_
00024 #define _TelepathyQt4_simple_call_observer_h_HEADER_GUARD_
00025
00026 #include <TelepathyQt4/Constants>
00027 #include <TelepathyQt4/Types>
00028
00029 #include <QObject>
00030
00031 namespace Tp
00032 {
00033
00034 class PendingOperation;
00035
00036 class TELEPATHY_QT4_EXPORT SimpleCallObserver : public QObject,
00037 public RefCounted
00038 {
00039 Q_OBJECT
00040 Q_DISABLE_COPY(SimpleCallObserver)
00041 Q_FLAGS(CallDirection CallDirections)
00042
00043 public:
00044 enum CallDirection {
00045 CallDirectionIncoming = 0x01,
00046 CallDirectionOutgoing = 0x02,
00047 CallDirectionBoth = CallDirectionIncoming | CallDirectionOutgoing
00048 };
00049 Q_DECLARE_FLAGS(CallDirections, CallDirection)
00050
00051 static SimpleCallObserverPtr create(const AccountPtr &account,
00052 CallDirection direction = CallDirectionBoth);
00053 static SimpleCallObserverPtr create(const AccountPtr &account,
00054 const ContactPtr &contact,
00055 CallDirection direction = CallDirectionBoth);
00056 static SimpleCallObserverPtr create(const AccountPtr &account,
00057 const QString &contactIdentifier,
00058 CallDirection direction = CallDirectionBoth);
00059
00060 virtual ~SimpleCallObserver();
00061
00062 AccountPtr account() const;
00063 QString contactIdentifier() const;
00064 CallDirection direction() const;
00065
00066 QList<StreamedMediaChannelPtr> streamedMediaCalls() const;
00067
00068 Q_SIGNALS:
00069 void streamedMediaCallStarted(const Tp::StreamedMediaChannelPtr &channel);
00070 void streamedMediaCallEnded(const Tp::StreamedMediaChannelPtr &channel,
00071 const QString &errorName, const QString &errorMessage);
00072
00073 private Q_SLOTS:
00074 TELEPATHY_QT4_NO_EXPORT void onNewChannels(const QList<Tp::ChannelPtr> &channels);
00075 TELEPATHY_QT4_NO_EXPORT void onChannelInvalidated(const Tp::ChannelPtr &channel,
00076 const QString &errorName, const QString &errorMessage);
00077
00078 private:
00079 TELEPATHY_QT4_NO_EXPORT static SimpleCallObserverPtr create(
00080 const AccountPtr &account,
00081 const QString &contactIdentifier, bool requiresNormalization,
00082 CallDirection direction);
00083
00084 TELEPATHY_QT4_NO_EXPORT SimpleCallObserver(const AccountPtr &account,
00085 const QString &contactIdentifier, bool requiresNormalization,
00086 CallDirection direction);
00087
00088 struct Private;
00089 friend struct Private;
00090 Private *mPriv;
00091 };
00092
00093 }
00094
00095 #endif