flip_store.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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,
  31. FlipStoreSubmenuIndexFirmwares,
  32. //
  33. FlipStoreSubmenuIndexAppListBluetooth,
  34. FlipStoreSubmenuIndexAppListGames,
  35. FlipStoreSubmenuIndexAppListGPIO,
  36. FlipStoreSubmenuIndexAppListInfrared,
  37. FlipStoreSubmenuIndexAppListiButton,
  38. FlipStoreSubmenuIndexAppListMedia,
  39. FlipStoreSubmenuIndexAppListNFC,
  40. FlipStoreSubmenuIndexAppListRFID,
  41. FlipStoreSubmenuIndexAppListSubGHz,
  42. FlipStoreSubmenuIndexAppListTools,
  43. FlipStoreSubmenuIndexAppListUSB,
  44. //
  45. FlipStoreSubmenuIndexStartFirmwares,
  46. //
  47. FlipStoreSubmenuIndexStartAppList = 100,
  48. } FlipStoreSubmenuIndex;
  49. // Define a single view for our FlipStore application
  50. typedef enum
  51. {
  52. //
  53. FlipStoreViewSubmenu, // The submenu
  54. FlipStoreViewSubmenuOptions, // The submenu options
  55. //
  56. FlipStoreViewAbout, // The about screen
  57. FlipStoreViewSettings, // The settings screen
  58. FlipStoreViewTextInput, // The text input screen
  59. //
  60. FlipStoreViewAppList, // The app list screen
  61. FlipStoreViewFirmwares, // The firmwares screen (submenu)
  62. FlipStoreViewFirmwareDialog, // The firmware view (DialogEx) of the selected firmware
  63. //
  64. FlipStoreViewAppInfo, // The app info screen (widget) of the selected app
  65. FlipStoreViewAppDownload, // The app download screen (widget) of the selected app
  66. FlipStoreViewAppDelete, // The app delete screen (DialogEx) of the selected app
  67. //
  68. FlipStoreViewAppListCategory, // the app list screen for each category
  69. //
  70. //
  71. FlipStoreViewWidgetResult, // The text box that displays the random fact
  72. FlipStoreViewLoader, // The loader screen retrieves data from the internet
  73. } FlipStoreView;
  74. // Each screen will have its own view
  75. typedef struct
  76. {
  77. View *view_loader;
  78. Widget *widget_result;
  79. //
  80. ViewDispatcher *view_dispatcher; // Switches between our views
  81. View *view_app_info; // The app info screen (view) of the selected app
  82. //
  83. DialogEx *dialog_firmware; // The dialog for installing a firmware
  84. //
  85. Submenu *submenu_main; // The submenu (main)
  86. //
  87. Submenu *submenu_options; // The submenu (options)
  88. Submenu *submenu_app_list; // The submenu (app list) for the selected category
  89. Submenu *submenu_firmwares; // The submenu (firmwares)
  90. Submenu *submenu_app_list_category; // The submenu (app list) for each category
  91. Widget *widget_about; // The widget
  92. VariableItemList *variable_item_list; // The variable item list (settngs)
  93. VariableItem *variable_item_ssid; // The variable item
  94. VariableItem *variable_item_pass; // The variable item
  95. //
  96. UART_TextInput *uart_text_input; // The text input
  97. char *uart_text_input_buffer; // Buffer for the text input
  98. char *uart_text_input_temp_buffer; // Temporary buffer for the text input
  99. uint32_t uart_text_input_buffer_size; // Size of the text input buffer
  100. } FlipStoreApp;
  101. void flip_store_app_free(FlipStoreApp *app);
  102. #endif // FLIP_STORE_E_H