Update clean-workspaces.sh after SpiderMonkey's upgrade to 78.6.0 and 91.13.1.
[0ad.git] / source / gui / SGUIMessage.h
blobc23fb5a23be6ad89a743fa9bf0ec0e09ab185990
1 /* Copyright (C) 2020 Wildfire Games.
2 * This file is part of 0 A.D.
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef INCLUDED_SGUIMESSAGE
19 #define INCLUDED_SGUIMESSAGE
21 #include "ps/CStr.h"
23 /**
24 * Message types.
25 * @see SGUIMessage
27 enum EGUIMessageType
29 GUIM_MOUSE_OVER,
30 GUIM_MOUSE_ENTER,
31 GUIM_MOUSE_LEAVE,
32 GUIM_MOUSE_PRESS_LEFT,
33 GUIM_MOUSE_PRESS_LEFT_ITEM,
34 GUIM_MOUSE_PRESS_RIGHT,
35 GUIM_MOUSE_DOWN_LEFT,
36 GUIM_MOUSE_DOWN_RIGHT,
37 GUIM_MOUSE_DBLCLICK_LEFT,
38 GUIM_MOUSE_DBLCLICK_LEFT_ITEM, // Triggered when doubleclicking on a list item
39 GUIM_MOUSE_DBLCLICK_RIGHT,
40 GUIM_MOUSE_RELEASE_LEFT,
41 GUIM_MOUSE_RELEASE_RIGHT,
42 GUIM_MOUSE_WHEEL_UP,
43 GUIM_MOUSE_WHEEL_DOWN,
44 GUIM_SETTINGS_UPDATED, // SGUIMessage.m_Value = name of setting
45 GUIM_PRESSED,
46 GUIM_KEYDOWN,
47 GUIM_RELEASED,
48 GUIM_DOUBLE_PRESSED,
49 GUIM_MOUSE_MOTION,
50 GUIM_LOAD, // Called after all objects were added to the GUI.
51 GUIM_GOT_FOCUS,
52 GUIM_LOST_FOCUS,
53 GUIM_PRESSED_MOUSE_RIGHT,
54 GUIM_PRESSED_MOUSE_RIGHT_DISABLED,
55 GUIM_DOUBLE_PRESSED_MOUSE_RIGHT,
56 GUIM_PRESSED_MOUSE_RELEASE,
57 GUIM_PRESSED_MOUSE_RELEASE_RIGHT,
58 GUIM_TAB, // Used by CInput
59 GUIM_TEXTEDIT
62 /**
63 * Message send to IGUIObject::HandleMessage() in order
64 * to give life to Objects manually with
65 * a derived HandleMessage().
67 struct SGUIMessage
69 // This should be passed as a const reference or pointer.
70 NONCOPYABLE(SGUIMessage);
72 SGUIMessage(EGUIMessageType _type) : type(_type), skipped(false) {}
73 SGUIMessage(EGUIMessageType _type, const CStr& _value) : type(_type), value(_value), skipped(false) {}
75 /**
76 * This method can be used to allow other event handlers to process this GUI event,
77 * by default an event is not skipped (only the first handler will process it).
79 * @param skip true to allow further event handling, false to prevent it
81 void Skip(bool skip = true) { skipped = skip; }
83 /**
84 * Describes what the message regards
86 EGUIMessageType type;
88 /**
89 * Optional data
91 CStr value;
93 /**
94 * Flag that specifies if object skipped handling the event
96 bool skipped;
99 #endif // INCLUDED_SGUIMESSAGE