Add warning when disabling secure.enable_security (#9943)
[oweals/minetest.git] / src / gui / guiConfirmRegistration.h
1 /*
2 Minetest
3 Copyright (C) 2018 srifqi, Muhammad Rifqi Priyo Susanto
4                 <muhammadrifqipriyosusanto@gmail.com>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #pragma once
22
23 #include "irrlichttypes_extrabloated.h"
24 #include "modalMenu.h"
25 #include <string>
26
27 class Client;
28 class ISimpleTextureSource;
29
30 class GUIConfirmRegistration : public GUIModalMenu
31 {
32 public:
33         GUIConfirmRegistration(gui::IGUIEnvironment *env, gui::IGUIElement *parent,
34                         s32 id, IMenuManager *menumgr, Client *client,
35                         const std::string &playername, const std::string &password,
36                         bool *aborted, ISimpleTextureSource *tsrc);
37         ~GUIConfirmRegistration();
38
39         void removeChildren();
40         /*
41                 Remove and re-add (or reposition) stuff
42         */
43         void regenerateGui(v2u32 screensize);
44
45         void drawMenu();
46
47         void closeMenu(bool goNext);
48
49         void acceptInput();
50
51         bool processInput();
52
53         bool OnEvent(const SEvent &event);
54 #ifdef __ANDROID__
55         bool getAndroidUIInput();
56 #endif
57
58 private:
59         std::wstring getLabelByID(s32 id) { return L""; }
60         std::string getNameByID(s32 id) { return "password"; }
61
62         Client *m_client = nullptr;
63         const std::string &m_playername;
64         const std::string &m_password;
65         bool *m_aborted = nullptr;
66         std::wstring m_pass_confirm = L"";
67         ISimpleTextureSource *m_tsrc;
68 };