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

#include "DynamicImage.hpp"
#include <dchat/types.hpp>
#include <gtkmm/grid.h>
#include <gtkmm/label.h>
#include <gtkmm/textview.h>

namespace dchat
{
    void applyRichText(Gtk::TextView *textView, const Glib::ustring &text);

    class ChatMessage : public Gtk::Grid
    {
    public:
        ChatMessage(const Glib::ustring &username, const Glib::ustring &text, uint32_t timestampSeconds);

        void appendText(const Glib::ustring &text);

        DynamicImage avatar;
        Gtk::Label username;
        uint32_t timestampSeconds;
    private:
        Gtk::TextView text;
    };
}