BsGUICommandEvent.h 2.1 KB

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