flip_store.h 5.1 KB

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