flip_store.h 4.1 KB

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