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

contact-messenger.h
1
23 #ifndef _TelepathyQt_contact_messenger_h_HEADER_GUARD_
24 #define _TelepathyQt_contact_messenger_h_HEADER_GUARD_
25
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29
30 #include <TelepathyQt/Constants>
31 #include <TelepathyQt/Message>
32 #include <TelepathyQt/Types>
33
34 namespace Tp
35 {
36
37 class PendingSendMessage;
38 class MessageContentPartList;
39
40 class TP_QT_EXPORT ContactMessenger : public QObject, public RefCounted
41 {
42 Q_OBJECT
43 Q_DISABLE_COPY(ContactMessenger)
44
45 public:
46 static ContactMessengerPtr create(const AccountPtr &account, const ContactPtr &contact);
47 static ContactMessengerPtr create(const AccountPtr &account, const QString &contactIdentifier);
48
49 virtual ~ContactMessenger();
50
51 AccountPtr account() const;
52 QString contactIdentifier() const;
53
54 QList<TextChannelPtr> textChats() const;
55
56 PendingSendMessage *sendMessage(const QString &text,
57 ChannelTextMessageType type = ChannelTextMessageTypeNormal,
58 MessageSendingFlags flags = 0);
59 PendingSendMessage *sendMessage(const MessageContentPartList &parts,
60 MessageSendingFlags flags = 0);
61
62 Q_SIGNALS:
63 void messageSent(const Tp::Message &message, Tp::MessageSendingFlags flags,
64 const QString &sentMessageToken, const Tp::TextChannelPtr &channel);
65 void messageReceived(const Tp::ReceivedMessage &message, const Tp::TextChannelPtr &channel);
66
67 private:
68 TP_QT_NO_EXPORT ContactMessenger(const AccountPtr &account,
69 const QString &contactIdentifier);
70
71 struct Private;
72 friend struct Private;
73 Private *mPriv;
74 };
75
76 } // Tp
77
78 #endif
Tp::ChannelTextMessageTypeNormal
Definition: obj-x86_64-linux-gnu/TelepathyQt/_gen/constants.h:2871
Tp::ChannelTextMessageType
ChannelTextMessageType
Definition: obj-x86_64-linux-gnu/TelepathyQt/_gen/constants.h:2866
QFlags
QObject
Tp::ReceivedMessage
The ReceivedMessage class is a subclass of Message, representing a received message only...
Definition: message.h:97
QString
QList
Tp::RefCounted
The RefCounted class is a base class for shared objects used by SharedPtr.
Definition: shared-ptr.h:42
Tp::ContactMessenger
The ContactMessenger class provides an easy way to send text messages to a contact and also track sen...
Definition: contact-messenger.h:40
Tp::PendingSendMessage
The PendingSendMessage class represents the parameters of and the reply to an asynchronous message se...
Definition: pending-send-message.h:41
Tp::Message
The Message class represents a Telepathy message in a TextChannel.
Definition: message.h:44
Tp::MessageContentPartList
The MessageContentPartList class represents a list of MessageContentPart.
Definition: message-content-part.h:57
Tp
Definition: abstract-adaptor.cpp:31