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

« back to all changes in this revision

Viewing changes to include/irc/presence_manager.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_PRESENCE_MANAGER_H
 
2
#define IRC_CLI_PRESENCE_MANAGER_H
 
3
 
 
4
#include <irc/visibility.h>
 
5
 
 
6
#include <messaging/presence_manager.h>
 
7
 
 
8
#include <memory>
 
9
 
 
10
namespace irc
 
11
{
 
12
 
 
13
class Connector;
 
14
 
 
15
class IRC_PUBLIC PresenceManager : public messaging::PresenceManager, public std::enable_shared_from_this<PresenceManager>
 
16
{
 
17
public:
 
18
 
 
19
    static std::shared_ptr<PresenceManager> create(const std::shared_ptr<messaging::PresenceManager::Observer>& observer,
 
20
                                                   Connector *connector);
 
21
 
 
22
    StatusMap get_valid_statuses() override;
 
23
    void set_self_presence(const std::string& status, const std::string& status_message = "") override;
 
24
    void request_presence(const std::shared_ptr<messaging::Recipient>& recipient) override;
 
25
 
 
26
private:
 
27
    /// @brief Messenger constructs a new instance, installing the given observer instance.
 
28
    PresenceManager(const std::shared_ptr<Observer>& observer,
 
29
                    Connector* connector);
 
30
 
 
31
    messaging::Presence create_presence(const std::string& status, const std::string& status_message = "");
 
32
 
 
33
    Connector *connector_;
 
34
    StatusMap statuses_;
 
35
};
 
36
 
 
37
}
 
38
 
 
39
 
 
40
#endif // IRC_CLI_PRESENCE_MANAGER_H