shapshup_i.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #pragma once
  2. #include <furi.h>
  3. #include <furi_hal.h>
  4. #include <input/input.h>
  5. #include "lib/toolbox/path.h"
  6. #include <notification/notification.h>
  7. #include <notification/notification_messages.h>
  8. #include <string.h>
  9. #include <gui/gui.h>
  10. #include <gui/view_dispatcher.h>
  11. #include <gui/view_stack.h>
  12. #include <gui/scene_manager.h>
  13. #include <gui/modules/text_input.h>
  14. #include <gui/modules/popup.h>
  15. #include <gui/modules/widget.h>
  16. #include <gui/modules/loading.h>
  17. #include <dialogs/dialogs.h>
  18. #include <lib/subghz/protocols/base.h>
  19. #include <lib/subghz/transmitter.h>
  20. #include <lib/subghz/receiver.h>
  21. #include <lib/subghz/environment.h>
  22. #include <notification/notification.h>
  23. #include <notification/notification_messages.h>
  24. #include <lib/toolbox/stream/stream.h>
  25. #include "shapshup.h"
  26. #include "scenes/shapshup_scene.h"
  27. #include "views/shapshup_main_view.h"
  28. #include "helpers/shapshup_files.h"
  29. /**
  30. * @brief max size of text field
  31. *
  32. */
  33. #define SHAPSHUP_TEXT_STORE_SIZE 255
  34. /**
  35. * @brief max size of filename
  36. *
  37. */
  38. #define SHAPSHUP_MAX_LEN_NAME 64
  39. /**
  40. * @brief default directory to show
  41. *
  42. */
  43. #define SHAPSHUP_PATH EXT_PATH("subghz")
  44. /**
  45. * @brief filename extension to show
  46. *
  47. */
  48. #define SHAPSHUP_FILE_EXT ".sub"
  49. /**
  50. * @brief used for DEBUG purpose
  51. *
  52. */
  53. //#define SHAPSHUP_FAST_TRACK false
  54. /**
  55. * @brief view mode
  56. *
  57. */
  58. typedef enum {
  59. ShapShupViewNone,
  60. ShapShupViewMain,
  61. ShapShupViewTextInput,
  62. ShapShupViewDialogEx,
  63. ShapShupViewPopup,
  64. ShapShupViewLoading,
  65. ShapShupViewWidget,
  66. ShapShupViewStack,
  67. } ShapShupView;
  68. /**
  69. * @brief main state of app
  70. *
  71. */
  72. struct ShapShupState {
  73. // GUI elements
  74. NotificationApp* notifications;
  75. Gui* gui;
  76. ViewDispatcher* view_dispatcher;
  77. ViewStack* view_stack;
  78. TextInput* text_input;
  79. Popup* popup;
  80. Widget* widget;
  81. DialogsApp* dialogs;
  82. Loading* loading;
  83. char text_store[SHAPSHUP_MAX_LEN_NAME];
  84. FuriString* file_path;
  85. ShapShupMainView* view_main; /** View main, default view*/
  86. ShapShupView current_view; /** @enum ShapShupView for track enums */
  87. SceneManager* scene_manager; /** Scene manager*/
  88. Storage* storage; /** Storage pointer */
  89. bool kostilya; /** kostilya for fix unability to EXIT this app */
  90. };
  91. /**
  92. * @brief shapshup_show_loading_popup
  93. *
  94. * @param context
  95. * @param show
  96. */
  97. void shapshup_show_loading_popup(void* context, bool show);
  98. /**
  99. * @brief shapshup_text_input_callback
  100. *
  101. * @param context
  102. */
  103. void shapshup_text_input_callback(void* context);
  104. /**
  105. * @brief shapshup_popup_closed_callback
  106. *
  107. * @param context
  108. */
  109. void shapshup_popup_closed_callback(void* context);