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

#include <gtkmm/grid.h>
#include <gtkmm/entry.h>
#include <gtkmm/button.h>
#include <functional>

namespace dchat
{
    using LoginHandler = std::function<void(const Glib::ustring &username, const Glib::ustring &password)>;

    class LoginWindow : public Gtk::Grid
    {
    public:
        LoginWindow();

        void setLoginHandler(LoginHandler loginHandler);
    private:
        Gtk::Entry usernameInput;
        Gtk::Entry passwordInput;
        Gtk::Button loginButton;
        std::function<void()> loginHandler;
        LoginHandler loginHandlerUser;
    };
}