flip_store.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #ifndef FLIP_STORE_E_H
  2. #define FLIP_STORE_E_H
  3. #include <text_input/uart_text_input.h>
  4. #include <flipper_http/flipper_http.h>
  5. #include <easy_flipper/easy_flipper.h>
  6. #include <furi.h>
  7. #include <furi_hal.h>
  8. #include <gui/gui.h>
  9. #include <gui/view.h>
  10. #include <gui/modules/submenu.h>
  11. #include <gui/view_dispatcher.h>
  12. #include <notification/notification.h>
  13. #include <dialogs/dialogs.h>
  14. #include <jsmn/jsmn.h>
  15. #include <jsmn/jsmn_furi.h>
  16. #include <flip_store_icons.h>
  17. #define TAG "FlipStore"
  18. #define VERSION_TAG "FlipStore v0.8"
  19. #define FIRMWARE_COUNT 3
  20. #define FIRMWARE_LINKS 3
  21. // Define the submenu items for our FlipStore application
  22. typedef enum
  23. {
  24. FlipStoreSubmenuIndexMain, // Click to start downloading the selected app
  25. FlipStoreSubmenuIndexAbout,
  26. FlipStoreSubmenuIndexSettings,
  27. //
  28. FlipStoreSubmenuIndexOptions, // Click to view the options
  29. //
  30. FlipStoreSubmenuIndexAppList, // Click to view the app list
  31. FlipStoreSubmenuIndexFirmwares, // Click to view the ESP32 firmwares
  32. FlipStoreSubmenuIndexVGMFirmwares, // Click to view the VGM firmwares
  33. //
  34. FlipStoreSubmenuIndexAppListBluetooth,
  35. FlipStoreSubmenuIndexAppListGames,
  36. FlipStoreSubmenuIndexAppListGPIO,
  37. FlipStoreSubmenuIndexAppListInfrared,
  38. FlipStoreSubmenuIndexAppListiButton,
  39. FlipStoreSubmenuIndexAppListMedia,
  40. FlipStoreSubmenuIndexAppListNFC,
  41. FlipStoreSubmenuIndexAppListRFID,
  42. FlipStoreSubmenuIndexAppListSubGHz,
  43. FlipStoreSubmenuIndexAppListTools,
  44. FlipStoreSubmenuIndexAppListUSB,
  45. //
  46. FlipStoreSubmenuIndexStartFirmwares,
  47. //
  48. FlipStoreSubmenuIndexStartAppList = 100,
  49. } FlipStoreSubmenuIndex;
  50. // Define a single view for our FlipStore application
  51. typedef enum
  52. {
  53. //
  54. FlipStoreViewSubmenu, // The submenu
  55. FlipStoreViewSubmenuOptions, // The submenu options
  56. //
  57. FlipStoreViewAbout, // The about screen
  58. FlipStoreViewSettings, // The settings screen
  59. FlipStoreViewTextInput, // The text input screen
  60. //
  61. FlipStoreViewAppList, // The app list screen
  62. FlipStoreViewFirmwares, // The firmwares screen (submenu)
  63. FlipStoreViewVGMFirmwares, // The VGM firmwares screen (submenu)
  64. FlipStoreViewFirmwareDialog, // The firmware view (DialogEx) of the selected firmware
  65. //
  66. FlipStoreViewAppInfo, // The app info screen (widget) of the selected app
  67. FlipStoreViewAppDownload, // The app download screen (widget) of the selected app
  68. FlipStoreViewAppDelete, // The app delete screen (DialogEx) of the selected app
  69. //
  70. FlipStoreViewAppListCategory, // the app list screen for each category
  71. //
  72. //
  73. FlipStoreViewWidgetResult, // The text box that displays the random fact
  74. FlipStoreViewLoader, // The loader screen retrieves data from the internet
  75. } FlipStoreView;
  76. // Each screen will have its own view
  77. typedef struct
  78. {
  79. View *view_loader;
  80. Widget *widget_result;
  81. //
  82. ViewDispatcher *view_dispatcher; // Switches between our views
  83. View *view_app_info; // The app info screen (view) of the selected app
  84. //
  85. DialogEx *dialog_firmware; // The dialog for installing a firmware
  86. //
  87. Submenu *submenu_main; // The submenu (main)
  88. //
  89. Submenu *submenu_options; // The submenu (options)
  90. Submenu *submenu_app_list; // The submenu (app list) for the selected category
  91. Submenu *submenu_firmwares; // The submenu (firmwares)
  92. Submenu *submenu_vgm_firmwares; // The submenu (VGM firmwares)
  93. Submenu *submenu_app_list_category; // The submenu (app list) for each category
  94. Widget *widget_about; // The widget
  95. VariableItemList *variable_item_list; // The variable item list (settngs)
  96. VariableItem *variable_item_ssid; // The variable item
  97. VariableItem *variable_item_pass; // The variable item
  98. //
  99. UART_TextInput *uart_text_input; // The text input
  100. char *uart_text_input_buffer; // Buffer for the text input
  101. char *uart_text_input_temp_buffer; // Temporary buffer for the text input
  102. uint32_t uart_text_input_buffer_size; // Size of the text input buffer
  103. } FlipStoreApp;
  104. void flip_store_app_free(FlipStoreApp *app);
  105. #endif // FLIP_STORE_E_H