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

simple-call-observer.h

    00001
    00023 #ifndef _TelepathyQt_simple_call_observer_h_HEADER_GUARD_
    00024 #define _TelepathyQt_simple_call_observer_h_HEADER_GUARD_
    00025
    00026 #include <TelepathyQt/Constants>
    00027 #include <TelepathyQt/Types>
    00028
    00029 #include <QObject>
    00030
    00031 namespace Tp
    00032 {
    00033
    00034 class PendingOperation;
    00035
    00036 class TP_QT_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<CallChannelPtr> calls() const;
    00067     TP_QT_DEPRECATED QList<StreamedMediaChannelPtr> streamedMediaCalls() const;
    00068
    00069 Q_SIGNALS:
    00070     void callStarted(const Tp::CallChannelPtr &channel);
    00071     void callEnded(const Tp::CallChannelPtr &channel,
    00072             const QString &errorName, const QString &errorMessage);
    00073
    00074     void streamedMediaCallStarted(const Tp::StreamedMediaChannelPtr &channel);
    00075     void streamedMediaCallEnded(const Tp::StreamedMediaChannelPtr &channel,
    00076             const QString &errorName, const QString &errorMessage);
    00077
    00078 private Q_SLOTS:
    00079     TP_QT_NO_EXPORT void onNewChannels(const QList<Tp::ChannelPtr> &channels);
    00080     TP_QT_NO_EXPORT void onChannelInvalidated(const Tp::ChannelPtr &channel,
    00081             const QString &errorName, const QString &errorMessage);
    00082
    00083 private:
    00084     TP_QT_NO_EXPORT static SimpleCallObserverPtr create(
    00085             const AccountPtr &account,
    00086             const QString &contactIdentifier, bool requiresNormalization,
    00087             CallDirection direction);
    00088
    00089     TP_QT_NO_EXPORT SimpleCallObserver(const AccountPtr &account,
    00090             const QString &contactIdentifier, bool requiresNormalization,
    00091             CallDirection direction);
    00092
    00093     struct Private;
    00094     friend struct Private;
    00095     Private *mPriv;
    00096 };
    00097
    00098 } // Tp
    00099
    00100 #endif