flip_store.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #ifndef FLIP_STORE_E_H
  2. #define FLIP_STORE_E_H
  3. #include <flipper_http/flipper_http.h>
  4. #include <easy_flipper/easy_flipper.h>
  5. #include <furi.h>
  6. #include <furi_hal.h>
  7. #include <gui/gui.h>
  8. #include <gui/view.h>
  9. #include <gui/modules/submenu.h>
  10. #include <gui/view_dispatcher.h>
  11. #include <notification/notification.h>
  12. #include <dialogs/dialogs.h>
  13. #include <jsmn/jsmn.h>
  14. #include <flip_store_icons.h>
  15. #define TAG "FlipStore"
  16. // define the list of categories
  17. extern char* categories[];
  18. // Define the submenu items for our FlipStore application
  19. typedef enum {
  20. FlipStoreSubmenuIndexMain, // Click to start downloading the selected app
  21. FlipStoreSubmenuIndexAbout,
  22. FlipStoreSubmenuIndexSettings,
  23. FlipStoreSubmenuIndexAppList,
  24. //
  25. FlipStoreSubmenuIndexAppListBluetooth,
  26. FlipStoreSubmenuIndexAppListGames,
  27. FlipStoreSubmenuIndexAppListGPIO,
  28. FlipStoreSubmenuIndexAppListInfrared,
  29. FlipStoreSubmenuIndexAppListiButton,
  30. FlipStoreSubmenuIndexAppListMedia,
  31. FlipStoreSubmenuIndexAppListNFC,
  32. FlipStoreSubmenuIndexAppListRFID,
  33. FlipStoreSubmenuIndexAppListSubGHz,
  34. FlipStoreSubmenuIndexAppListTools,
  35. FlipStoreSubmenuIndexAppListUSB,
  36. //
  37. FlipStoreSubmenuIndexStartAppList
  38. } FlipStoreSubmenuIndex;
  39. // Define a single view for our FlipStore application
  40. typedef enum {
  41. FlipStoreViewMain, // The main screen
  42. FlipStoreViewSubmenu, // The submenu
  43. FlipStoreViewAbout, // The about screen
  44. FlipStoreViewSettings, // The settings screen
  45. FlipStoreViewTextInputSSID, // The text input screen for SSID
  46. FlipStoreViewTextInputPass, // The text input screen for password
  47. //
  48. FlipStoreViewPopup, // The popup screen
  49. //
  50. FlipStoreViewAppList, // The app list screen
  51. FlipStoreViewAppInfo, // The app info screen (widget) of the selected app
  52. FlipStoreViewAppDownload, // The app download screen (widget) of the selected app
  53. FlipStoreViewAppDelete, // The app delete screen (DialogEx) of the selected app
  54. //
  55. FlipStoreViewAppListBluetooth, // the app list screen for Bluetooth
  56. FlipStoreViewAppListGames, // the app list screen for Games
  57. FlipStoreViewAppListGPIO, // the app list screen for GPIO
  58. FlipStoreViewAppListInfrared, // the app list screen for Infrared
  59. FlipStoreViewAppListiButton, // the app list screen for iButton
  60. FlipStoreViewAppListMedia, // the app list screen for Media
  61. FlipStoreViewAppListNFC, // the app list screen for NFC
  62. FlipStoreViewAppListRFID, // the app list screen for RFID
  63. FlipStoreViewAppListSubGHz, // the app list screen for Sub-GHz
  64. FlipStoreViewAppListTools, // the app list screen for Tools
  65. FlipStoreViewAppListUSB, // the app list screen for USB
  66. } FlipStoreView;
  67. // Each screen will have its own view
  68. typedef struct {
  69. ViewDispatcher* view_dispatcher; // Switches between our views
  70. View* view_main; // The main screen for downloading apps
  71. View* view_app_info; // The app info screen (view) of the selected app
  72. Submenu* submenu; // The submenu (main)
  73. //
  74. Submenu* submenu_app_list; // The submenu (app list) for the selected category
  75. //
  76. Submenu* submenu_app_list_bluetooth; // The submenu (app list) for Bluetooth
  77. Submenu* submenu_app_list_games; // The submenu (app list) for Games
  78. Submenu* submenu_app_list_gpio; // The submenu (app list) for GPIO
  79. Submenu* submenu_app_list_infrared; // The submenu (app list) for Infrared
  80. Submenu* submenu_app_list_ibutton; // The submenu (app list) for iButton
  81. Submenu* submenu_app_list_media; // The submenu (app list) for Media
  82. Submenu* submenu_app_list_nfc; // The submenu (app list) for NFC
  83. Submenu* submenu_app_list_rfid; // The submenu (app list) for RFID
  84. Submenu* submenu_app_list_subghz; // The submenu (app list) for Sub-GHz
  85. Submenu* submenu_app_list_tools; // The submenu (app list) for Tools
  86. Submenu* submenu_app_list_usb; // The submenu (app list) for USB
  87. //
  88. Widget* widget; // The widget
  89. Popup* popup; // The popup
  90. DialogEx* dialog_delete; // The dialog for deleting an app
  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. TextInput* uart_text_input_ssid; // The text input
  95. TextInput* uart_text_input_pass; // The text input
  96. char* uart_text_input_buffer_ssid; // Buffer for the text input
  97. char* uart_text_input_temp_buffer_ssid; // Temporary buffer for the text input
  98. uint32_t uart_text_input_buffer_size_ssid; // Size of the text input buffer
  99. char* uart_text_input_buffer_pass; // Buffer for the text input
  100. char* uart_text_input_temp_buffer_pass; // Temporary buffer for the text input
  101. uint32_t uart_text_input_buffer_size_pass; // Size of the text input buffer
  102. } FlipStoreApp;
  103. void flip_store_app_free(FlipStoreApp* app);
  104. #endif // FLIP_STORE_E_H