1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
3 | #pragma once |
4 | |
5 | #include "BsPrerequisites.h" |
6 | |
7 | namespace bs |
8 | { |
9 | /** @addtogroup GUI-Internal |
10 | * @{ |
11 | */ |
12 | |
13 | /** Type of valid command events. */ |
14 | enum class GUICommandEventType |
15 | { |
16 | Redraw, /**< GUI system is forcing the GUI element to redraw itself. */ |
17 | FocusLost, /**< GUI element lost input focus. */ |
18 | FocusGained, /**< GUI element gained input focus. */ |
19 | MoveLeft, /**< Input caret was moved left (for example for navigating an input box). */ |
20 | MoveRight, /**< Input caret was moved right (for example for navigating an input box). */ |
21 | MoveUp, /**< Input caret was moved up (for example for navigating an input box). */ |
22 | MoveDown, /**< Input caret was moved down (for example for navigating an input box). */ |
23 | SelectLeft, /**< Input Selection was moved left (for example for selecting text in an input box). */ |
24 | SelectRight, /**< Input Selection was moved right (for example for selecting text in an input box). */ |
25 | SelectUp, /**< Input Selection was moved up (for example for selecting text in an input box). */ |
26 | SelectDown, /**< Input Selection was moved down (for example for selecting text in an input box). */ |
27 | Escape, /**< Escape key was pressed. */ |
28 | Delete, /**< Delete key was pressed. */ |
29 | Backspace, /**< Backspace key was pressed. */ |
30 | Return, /**< Shift + Enter was pressed. */ |
31 | Confirm /**< Enter key was pressed. */ |
32 | }; |
33 | |
34 | /** |
35 | * Holds data about a GUI command event. Command events are special events with a more specific purpose than general |
36 | * input events. |
37 | */ |
38 | class BS_EXPORT GUICommandEvent |
39 | { |
40 | public: |
41 | GUICommandEvent() = default; |
42 | |
43 | /** Returns type describing what kind of event this is. */ |
44 | GUICommandEventType getType() const { return mType; } |
45 | private: |
46 | friend class GUIManager; |
47 | |
48 | /** Sets type describing what kind of event this is. */ |
49 | void setType(GUICommandEventType type) { mType = type; } |
50 | |
51 | GUICommandEventType mType = GUICommandEventType::Redraw; |
52 | }; |
53 | |
54 | /** @} */ |
55 | } |