plugin_state.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #pragma once
  2. #include <notification/notification.h>
  3. #include <gui/gui.h>
  4. #include <dialogs/dialogs.h>
  5. #include "../config/app/config.h"
  6. #include "../ui/totp_scenes_enum.h"
  7. #include "../services/config/config_file_context.h"
  8. #include "../services/idle_timeout/idle_timeout.h"
  9. #include "notification_method.h"
  10. #include "automation_method.h"
  11. #include "automation_kb_layout.h"
  12. #ifdef TOTP_BADBT_AUTOMATION_ENABLED
  13. #include "../workers/bt_type_code/bt_type_code.h"
  14. #endif
  15. #include "crypto_settings.h"
  16. /**
  17. * @brief Application state structure
  18. */
  19. typedef struct {
  20. /**
  21. * @brief Application current scene
  22. */
  23. Scene current_scene;
  24. /**
  25. * @brief Application current scene state
  26. */
  27. void* current_scene_state;
  28. /**
  29. * @brief Reference to the firmware dialogs subsystem
  30. */
  31. DialogsApp* dialogs_app;
  32. /**
  33. * @brief Reference to the firmware GUI subsystem
  34. */
  35. Gui* gui;
  36. /**
  37. * @brief Timezone UTC offset in hours
  38. */
  39. float timezone_offset;
  40. /**
  41. * @brief Config file context
  42. */
  43. ConfigFileContext* config_file_context;
  44. /**
  45. * @brief Notification method
  46. */
  47. NotificationMethod notification_method;
  48. /**
  49. * @brief Automation method
  50. */
  51. AutomationMethod automation_method;
  52. /**
  53. * @brief Automation keyboard layout to be used
  54. */
  55. AutomationKeyboardLayout automation_kb_layout;
  56. /**
  57. * @brief Automation initial delay between "user initiated automation" and "code sending key-press events" events
  58. */
  59. uint16_t automation_initial_delay;
  60. #ifdef TOTP_BADBT_AUTOMATION_ENABLED
  61. /**
  62. * @brief Bad-Bluetooth worker context
  63. */
  64. TotpBtTypeCodeWorkerContext* bt_type_code_worker_context;
  65. #endif
  66. /**
  67. * @brief IDLE timeout context
  68. */
  69. IdleTimeoutContext* idle_timeout_context;
  70. /**
  71. * @brief Font index to be used to draw TOTP token
  72. */
  73. uint8_t active_font_index;
  74. /**
  75. * @brief Application even queue
  76. */
  77. FuriMessageQueue* event_queue;
  78. /**
  79. * @brief Crypto settings
  80. */
  81. CryptoSettings crypto_settings;
  82. } PluginState;