infrared_app_event.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. int32_t dummy;
  38. /** Menu selected event type payload. Selected index. */
  39. int32_t menu_index;
  40. /** DialogEx view module event type payload */
  41. DialogExResult dialog_ex_result;
  42. } payload;
  43. /** Type of event */
  44. Type type;
  45. };