summaryrefslogtreecommitdiff
path: root/windows/profile/userinfopane.hpp
blob: 90a4d556cde3dd13c79b26adaa19dd3d56edba8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include <gtkmm.h>
#include "discord/objects.hpp"

class ConnectionItem : public Gtk::EventBox {
public:
    ConnectionItem(const ConnectionData &connection);

private:
    Gtk::Overlay m_overlay;
    Gtk::Box m_box;
    Gtk::Label m_name;
    Gtk::Image *m_image = nullptr;
    Gtk::Image *m_check = nullptr;
};

class ConnectionsContainer : public Gtk::Grid {
public:
    ConnectionsContainer();
    void SetConnections(const std::vector<ConnectionData> &connections);
};

class NotesContainer : public Gtk::Box {
public:
    NotesContainer();
    void SetNote(const std::string &note);

private:
    void UpdateNote();
    bool OnNoteKeyPress(GdkEventKey *event);

    Gtk::Label m_label;
    Gtk::TextView m_note;

    typedef sigc::signal<void, Glib::ustring> type_signal_update_note;
    type_signal_update_note m_signal_update_note;

public:
    type_signal_update_note signal_update_note();
};

class BioContainer : public Gtk::Box {
public:
    BioContainer();
    void SetBio(const std::string &bio);

private:
    Gtk::Label m_label;
    Gtk::Label m_bio;
};

class ProfileUserInfoPane : public Gtk::Box {
public:
    ProfileUserInfoPane(Snowflake ID);
    void SetProfile(const UserProfileData &data);

    Snowflake UserID;

private:
    Gtk::Label m_created;

    BioContainer m_bio;
    NotesContainer m_note;
    ConnectionsContainer m_conns;
};