infrared_app_event.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @file infrared_app_event.h
  3. * Infrared: Scene events description
  4. */
  5. #pragma once
  6. #include <infrared.h>
  7. #include <gui/modules/dialog_ex.h>
  8. /** Infrared events class */
  9. class InfraredAppEvent {
  10. public:
  11. /** Type of event enum */
  12. enum class Type : uint8_t {
  13. /** Tick event come after no other events came in 100 ms */
  14. Tick,
  15. /** Exit application event */
  16. Exit,
  17. /** Back event */
  18. Back,
  19. /** Menu selected event type. Provided with payload value. */
  20. MenuSelected,
  21. /** Button press event. Need for continuous signal sending. */
  22. MenuSelectedPress,
  23. /** Button release event. Need for continuous signal sending. */
  24. MenuSelectedRelease,
  25. /** Events from DialogEx view module */
  26. DialogExSelected,
  27. /** Infrared signal received event */
  28. InfraredMessageReceived,
  29. /** Text edit done event */
  30. TextEditDone,
  31. /** Popup timer finished event */
  32. PopupTimer,
  33. /** Button panel pressed event */
  34. ButtonPanelPressed,
  35. };
  36. union {
  37. /** Menu selected event type payload. Selected index. */
  38. int32_t menu_index;
  39. /** DialogEx view module event type payload */
  40. DialogExResult dialog_ex_result;
  41. } payload;
  42. /** Type of event */
  43. Type type;
  44. };