~phablet-team/mfw-plugin-irc/trunk

« back to all changes in this revision

Viewing changes to include/irc/group_chat.h

  • Committer: Tiago Salem Herrmann
  • Date: 2016-12-16 18:58:01 UTC
  • Revision ID: tiago.herrmann@canonical.com-20161216185801-voyowdbxqafk7wrv
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef IRC_CLI_GROUP_CHAT_H
 
2
#define IRC_CLI_GROUP_CHAT_H
 
3
 
 
4
#include <irc/visibility.h>
 
5
 
 
6
#include <irc/chat.h>
 
7
 
 
8
#include <libircclient.h>
 
9
 
 
10
namespace messaging
 
11
{
 
12
class Group;
 
13
class Interface;
 
14
}
 
15
 
 
16
namespace irc
 
17
{
 
18
 
 
19
// Handy fw declarations
 
20
class GroupManager;
 
21
 
 
22
class IRC_PUBLIC GroupChat
 
23
        : public Chat
 
24
{
 
25
public:
 
26
 
 
27
    /// @brief Creates a new instance translating the given recipient to a user.
 
28
    static std::shared_ptr<GroupChat> create(const std::shared_ptr<messaging::Group> &group,
 
29
                                             const std::shared_ptr<messaging::Chat::Observer>& observer, irc_session_t *session);
 
30
 
 
31
    /// @brief send_message enqueues the given message for delivery.
 
32
    /// @returns a numeric identifier referencing back to the delivery request.
 
33
    /// @throws std::runtime_error in case of issues.
 
34
    std::string send_message(const messaging::Message& message) override;
 
35
    void mark_message_as_read(const std::string& message_token) override;
 
36
    void start_typing() override;
 
37
    void end_typing() override;
 
38
 
 
39
    void mark_message_as_delivered(const std::string& message_token);
 
40
    std::string id();
 
41
 
 
42
private:
 
43
    /// @brief Creates a new instance translating the given recipient to a user.
 
44
    GroupChat(const std::shared_ptr<messaging::Group> &group,
 
45
              const std::shared_ptr<messaging::Chat::Observer>& observer, irc_session_t *session);
 
46
 
 
47
    irc_session_t *irc_session;
 
48
    std::string channel_id;
 
49
 
 
50
};
 
51
 
 
52
}
 
53
 
 
54
#endif // IRC_CLI_GROUP_CHAT_H