3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "irrlichttypes_extrabloated.h"
23 #include "util/string.h"
30 // A GUIModalMenu calls these when this class is passed as a parameter
31 virtual void createdMenu(gui::IGUIElement *menu) = 0;
32 virtual void deletingMenu(gui::IGUIElement *menu) = 0;
35 // Remember to drop() the menu after creating, so that it can
36 // remove itself when it wants to.
38 class GUIModalMenu : public gui::IGUIElement
41 GUIModalMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id,
42 IMenuManager *menumgr);
43 virtual ~GUIModalMenu();
45 void allowFocusRemoval(bool allow);
46 bool canTakeFocus(gui::IGUIElement *e);
49 void removeChildren();
51 virtual void regenerateGui(v2u32 screensize) = 0;
52 virtual void drawMenu() = 0;
53 virtual bool preprocessEvent(const SEvent& event);
54 virtual bool OnEvent(const SEvent& event) { return false; };
55 virtual bool pausesGame() { return false; } // Used for pause menu
57 virtual bool getAndroidUIInput() { return false; }
58 bool hasAndroidUIInput();
62 virtual std::wstring getLabelByID(s32 id) = 0;
63 virtual std::string getNameByID(s32 id) = 0;
66 v2s32 m_old_pointer; // Mouse position after previous mouse event
67 v2u32 m_screensize_old;
71 std::string m_jni_field_name;
73 #ifdef HAVE_TOUCHSCREENGUI
74 bool m_touchscreen_visible = true;
77 IMenuManager *m_menumgr;
78 // This might be necessary to expose to the implementation if it
79 // wants to launch other menus
80 bool m_allow_focus_removal = false;