aboutsummaryrefslogtreecommitdiff
path: root/include/RoomNotificationsWindow.hpp
blob: e4e29f5b497a40d7f865f7af8cd86707a44616e2 (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
#pragma once

#include <dchat/Room.hpp>
#include <gtkmm/stack.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/liststore.h>
#include <unordered_map>

namespace dchat
{
    class ChatWindow;

    class RoomNotificationsWindow : public Gtk::Stack
    {
    public:
        RoomNotificationsWindow(ChatWindow *chatWindow);

        void addInviteRequest(const InviteUserRequest &request);
    private:
        class RoomNotifications : public Gtk::ScrolledWindow
        {
        public:
            Glib::RefPtr<Gtk::ListStore> listStore;
            Gtk::TreeModelColumn<Glib::ustring> userPublicKeyColumn;
            Gtk::TreeModelColumn<Glib::ustring> messageColumn;
            Gtk::TreeModel::ColumnRecord columns;
            std::unordered_map<std::string, InviteUserRequest> inviteRequests;
        };
        
        RoomNotifications* createRoomNotifications();

        std::unordered_map<Room*, RoomNotifications*> roomNotificationsMap;

        ChatWindow *chatWindow;
    };
}