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

simple-text-observer.h
1
23 #ifndef _TelepathyQt_simple_text_observer_h_HEADER_GUARD_
24 #define _TelepathyQt_simple_text_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 Message;
35 class PendingOperation;
36 class ReceivedMessage;
37
38 class TP_QT_EXPORT SimpleTextObserver : public QObject, public RefCounted
39 {
40 Q_OBJECT
41 Q_DISABLE_COPY(SimpleTextObserver)
42
43 public:
44 static SimpleTextObserverPtr create(const AccountPtr &account);
45 static SimpleTextObserverPtr create(const AccountPtr &account,
46 const ContactPtr &contact);
47 static SimpleTextObserverPtr create(const AccountPtr &account,
48 const QString &contactIdentifier);
49
50 virtual ~SimpleTextObserver();
51
52 AccountPtr account() const;
53 QString contactIdentifier() const;
54
55 QList<TextChannelPtr> textChats() const;
56
57 Q_SIGNALS:
58 void messageSent(const Tp::Message &message, Tp::MessageSendingFlags flags,
59 const QString &sentMessageToken, const Tp::TextChannelPtr &channel);
60 void messageReceived(const Tp::ReceivedMessage &message, const Tp::TextChannelPtr &channel);
61
62 private Q_SLOTS:
63 TP_QT_NO_EXPORT void onNewChannels(const QList<Tp::ChannelPtr> &channels);
64 TP_QT_NO_EXPORT void onChannelInvalidated(const Tp::ChannelPtr &channel);
65
66 private:
67 TP_QT_NO_EXPORT static SimpleTextObserverPtr create(const AccountPtr &account,
68 const QString &contactIdentifier, bool requiresNormalization);
69
70 TP_QT_NO_EXPORT SimpleTextObserver(const AccountPtr &account,
71 const QString &contactIdentifier, bool requiresNormalization);
72
73 struct Private;
74 friend struct Private;
75 Private *mPriv;
76 };
77
78 } // Tp
79
80 #endif
Tp::SimpleTextObserver
The SimpleTextObserver class provides an easy way to track sent/received text messages in an account ...
Definition: simple-text-observer.h:38
Tp
Definition: abstract-adaptor.cpp:31
Tp::ReceivedMessage
The ReceivedMessage class is a subclass of Message, representing a received message only...
Definition: message.h:97
QFlags
QObject
Tp::Message
The Message class represents a Telepathy message in a TextChannel.
Definition: message.h:44
QString
QList
Tp::RefCounted
The RefCounted class is a base class for shared objects used by SharedPtr.
Definition: shared-ptr.h:42