Home · All Classes · All Namespaces · Modules · Functions · Files
simple-observer.h
1 
23 #ifndef _TelepathyQt_simple_observer_h_HEADER_GUARD_
24 #define _TelepathyQt_simple_observer_h_HEADER_GUARD_
25 
26 #include <TelepathyQt/AbstractClientObserver>
27 #include <TelepathyQt/ChannelClassFeatures>
28 #include <TelepathyQt/Types>
29 
30 #include <QObject>
31 
32 namespace Tp
33 {
34 
35 class PendingOperation;
36 
37 class TP_QT_EXPORT SimpleObserver : public QObject, public RefCounted
38 {
39  Q_OBJECT
40  Q_DISABLE_COPY(SimpleObserver)
41 
42 public:
43  static SimpleObserverPtr create(const AccountPtr &account,
44  const ChannelClassSpecList &channelFilter,
45  const QList<ChannelClassFeatures> &extraChannelFeatures =
46  QList<ChannelClassFeatures>());
47  static SimpleObserverPtr create(const AccountPtr &account,
48  const ChannelClassSpecList &channelFilter,
49  const ContactPtr &contact,
50  const QList<ChannelClassFeatures> &extraChannelFeatures =
51  QList<ChannelClassFeatures>());
52  static SimpleObserverPtr create(const AccountPtr &account,
53  const ChannelClassSpecList &channelFilter,
54  const QString &contactIdentifier,
55  const QList<ChannelClassFeatures> &extraChannelFeatures =
56  QList<ChannelClassFeatures>());
57 
58  virtual ~SimpleObserver();
59 
60  AccountPtr account() const;
61  ChannelClassSpecList channelFilter() const;
62  QString contactIdentifier() const;
63  QList<ChannelClassFeatures> extraChannelFeatures() const;
64 
65  QList<ChannelPtr> channels() const;
66 
67 Q_SIGNALS:
68  void newChannels(const QList<Tp::ChannelPtr> &channels);
69  void channelInvalidated(const Tp::ChannelPtr &channel, const QString &errorName,
70  const QString &errorMessage);
71 
72 private Q_SLOTS:
73  TP_QT_NO_EXPORT void onAccountConnectionChanged(const Tp::ConnectionPtr &connection);
74  TP_QT_NO_EXPORT void onAccountConnectionConnected();
75  TP_QT_NO_EXPORT void onContactConstructed(Tp::PendingOperation *op);
76 
77  TP_QT_NO_EXPORT void onNewChannels(const Tp::AccountPtr &channelsAccount,
78  const QList<Tp::ChannelPtr> &channels);
79  TP_QT_NO_EXPORT void onChannelInvalidated(const Tp::AccountPtr &channelAccount,
80  const Tp::ChannelPtr &channel, const QString &errorName, const QString &errorMessage);
81 
82 private:
83  friend class SimpleCallObserver;
84  friend class SimpleTextObserver;
85 
86  TP_QT_NO_EXPORT static SimpleObserverPtr create(const AccountPtr &account,
87  const ChannelClassSpecList &channelFilter,
88  const QString &contactIdentifier,
89  bool requiresNormalization,
90  const QList<ChannelClassFeatures> &extraChannelFeatures);
91 
92  TP_QT_NO_EXPORT SimpleObserver(const AccountPtr &account,
93  const ChannelClassSpecList &channelFilter,
94  const QString &contactIdentifier,
95  bool requiresNormalization,
96  const QList<ChannelClassFeatures> &extraChannelFeatures);
97 
98  struct Private;
99  friend struct Private;
100  Private *mPriv;
101 };
102 
103 } // Tp
104 
105 #endif
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
The SimpleTextObserver class provides an easy way to track sent/received text messages in an account ...
Definition: simple-text-observer.h:38
The RefCounted class is a base class for shared objects used by SharedPtr.
Definition: shared-ptr.h:42
The SimpleObserver class provides an easy way to track channels in an account and can be optionally f...
Definition: simple-observer.h:37
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
The ChannelClassSpecList class represents a list of ChannelClassSpec.
Definition: channel-class-spec.h:249


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