Home · All Classes · All Namespaces · Modules · Functions · Files
simple-call-observer.h
1 
23 #ifndef _TelepathyQt_simple_call_observer_h_HEADER_GUARD_
24 #define _TelepathyQt_simple_call_observer_h_HEADER_GUARD_
25 
26 #include <TelepathyQt/Constants>
27 #include <TelepathyQt/Types>
28 
29 #include <QObject>
30 
31 namespace Tp
32 {
33 
34 class PendingOperation;
35 
36 class TP_QT_EXPORT SimpleCallObserver : public QObject,
37  public RefCounted
38 {
39  Q_OBJECT
40  Q_DISABLE_COPY(SimpleCallObserver)
41  Q_FLAGS(CallDirection CallDirections)
42 
43 public:
45  CallDirectionIncoming = 0x01,
46  CallDirectionOutgoing = 0x02,
47  CallDirectionBoth = CallDirectionIncoming | CallDirectionOutgoing
48  };
49  Q_DECLARE_FLAGS(CallDirections, CallDirection)
50 
51  static SimpleCallObserverPtr create(const AccountPtr &account,
52  CallDirection direction = CallDirectionBoth);
53  static SimpleCallObserverPtr create(const AccountPtr &account,
54  const ContactPtr &contact,
55  CallDirection direction = CallDirectionBoth);
56  static SimpleCallObserverPtr create(const AccountPtr &account,
57  const QString &contactIdentifier,
58  CallDirection direction = CallDirectionBoth);
59 
60  virtual ~SimpleCallObserver();
61 
62  AccountPtr account() const;
63  QString contactIdentifier() const;
64  CallDirection direction() const;
65 
66  QList<CallChannelPtr> calls() const;
67  TP_QT_DEPRECATED QList<StreamedMediaChannelPtr> streamedMediaCalls() const;
68 
69 Q_SIGNALS:
70  void callStarted(const Tp::CallChannelPtr &channel);
71  void callEnded(const Tp::CallChannelPtr &channel,
72  const QString &errorName, const QString &errorMessage);
73 
74  void streamedMediaCallStarted(const Tp::StreamedMediaChannelPtr &channel);
75  void streamedMediaCallEnded(const Tp::StreamedMediaChannelPtr &channel,
76  const QString &errorName, const QString &errorMessage);
77 
78 private Q_SLOTS:
79  TP_QT_NO_EXPORT void onNewChannels(const QList<Tp::ChannelPtr> &channels);
80  TP_QT_NO_EXPORT void onChannelInvalidated(const Tp::ChannelPtr &channel,
81  const QString &errorName, const QString &errorMessage);
82 
83 private:
84  TP_QT_NO_EXPORT static SimpleCallObserverPtr create(
85  const AccountPtr &account,
86  const QString &contactIdentifier, bool requiresNormalization,
87  CallDirection direction);
88 
89  TP_QT_NO_EXPORT SimpleCallObserver(const AccountPtr &account,
90  const QString &contactIdentifier, bool requiresNormalization,
91  CallDirection direction);
92 
93  struct Private;
94  friend struct Private;
95  Private *mPriv;
96 };
97 
98 } // Tp
99 
100 #endif
CallDirection
Definition: simple-call-observer.h:44
The RefCounted class is a base class for shared objects used by SharedPtr.
Definition: shared-ptr.h:42
The SimpleCallObserver class provides an easy way to track calls in an account and can be optionally ...
Definition: simple-call-observer.h:36
Definition: abstract-adaptor.cpp:31


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