plugin_state.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. /**
  66. * @brief Bad-Bluetooth profile index.
  67. */
  68. uint8_t bt_type_code_worker_profile_index;
  69. #endif
  70. /**
  71. * @brief IDLE timeout context
  72. */
  73. IdleTimeoutContext* idle_timeout_context;
  74. /**
  75. * @brief Font index to be used to draw TOTP token
  76. */
  77. uint8_t active_font_index;
  78. /**
  79. * @brief Application even queue
  80. */
  81. FuriMessageQueue* event_queue;
  82. /**
  83. * @brief Crypto settings
  84. */
  85. CryptoSettings crypto_settings;
  86. /**
  87. * @brief Indicates the amount of groups to split the token into in UI. 0 if no grouping is needed.
  88. */
  89. uint8_t split_token_into_groups;
  90. } PluginState;