Add warning when disabling secure.enable_security (#9943)
[oweals/minetest.git] / src / gui / guiPasswordChange.h
1 /*
2 Part of Minetest
3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4 Copyright (C) 2013 Ciaran Gultnieks <ciaran@ciarang.com>
5
6 Permission to use, copy, modify, and distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #pragma once
20
21 #include "irrlichttypes_extrabloated.h"
22 #include "modalMenu.h"
23 #include <string>
24
25 class Client;
26 class ISimpleTextureSource;
27
28 class GUIPasswordChange : public GUIModalMenu
29 {
30 public:
31         GUIPasswordChange(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id,
32                         IMenuManager *menumgr, Client *client,
33                         ISimpleTextureSource *tsrc);
34         ~GUIPasswordChange();
35
36         void removeChildren();
37         /*
38                 Remove and re-add (or reposition) stuff
39         */
40         void regenerateGui(v2u32 screensize);
41
42         void drawMenu();
43
44         void acceptInput();
45
46         bool processInput();
47
48         bool OnEvent(const SEvent &event);
49 #ifdef __ANDROID__
50         bool getAndroidUIInput();
51 #endif
52
53 protected:
54         std::wstring getLabelByID(s32 id) { return L""; }
55         std::string getNameByID(s32 id);
56
57 private:
58         Client *m_client;
59         std::wstring m_oldpass = L"";
60         std::wstring m_newpass = L"";
61         std::wstring m_newpass_confirm = L"";
62         ISimpleTextureSource *m_tsrc;
63 };