flip_library_e.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef FLIP_LIBRARY_E_H
  2. #define FLIP_LIBRARY_E_H
  3. #include <flipper_http.h>
  4. #include <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.h>
  14. #define TAG "FlipLibrary"
  15. // Define the submenu items for our FlipLibrary application
  16. typedef enum {
  17. FlipLibrarySubmenuIndexRandomFacts, // Click to run the random facts
  18. FlipLibrarySubmenuIndexDictionary, // click to view the dictionary variable item list
  19. FlipLibrarySubmenuIndexAbout, // Click to view the about screen
  20. FlipLibrarySubmenuIndexSettings, // Click to view the WiFi settings
  21. //
  22. FlipLibrarySubmenuIndexRandomFactsCats, // Click to view the random facts (cats)
  23. FlipLibrarySubmenuIndexRandomFactsDogs, // Click to view the random facts (dogs)
  24. FlipLibrarySubmenuIndexRandomFactsQuotes, // Click to view the random facts (quotes)
  25. FlipLibrarySubmenuIndexRandomFactsAll, // Click to view the random facts (all)
  26. } FlipLibrarySubmenuIndex;
  27. // Define a single view for our FlipLibrary application
  28. typedef enum {
  29. FlipLibraryViewRandomFacts = 7, // The random facts main screen
  30. FlipLibraryViewRandomFactsRun = 8, // The random facts widget that displays the random fact
  31. FlipLibraryViewSubmenuMain = 9, // The submenu screen
  32. FlipLibraryViewAbout = 10, // The about screen
  33. FlipLibraryViewSettings = 11, // The settings screen
  34. FlipLibraryViewTextInputSSID = 12, // The text input screen (SSID)
  35. FlipLibraryViewTextInputPassword = 13, // The text input screen (password)
  36. FlipLibraryViewDictionary = 14, // The dictionary submenu screen
  37. //
  38. FlipLibraryViewDictionaryTextInput = 15,
  39. FlipLibraryViewDictionaryRun = 16,
  40. //
  41. FlipLibraryViewRandomFactsCats = 17,
  42. FlipLibraryViewRandomFactsDogs = 18,
  43. FlipLibraryViewRandomFactsQuotes = 19,
  44. FlipLibraryViewRandomFactsAll = 20,
  45. //
  46. FlipLibraryViewRandomFactWidget = 21, // The text box that displays the random fact
  47. FlipLibraryViewDictionaryWidget = 22, // The text box that displays the dictionary
  48. } FlipLibraryView;
  49. // Each screen will have its own view
  50. typedef struct {
  51. ViewDispatcher* view_dispatcher; // Switches between our views
  52. View* view_random_facts; // The main screen that displays the random fact
  53. View* view_dictionary; // The dictionary screen
  54. Submenu* submenu_main; // The submenu for the main screen
  55. Submenu* submenu_random_facts; // The submenu for the random facts screen
  56. Widget* widget; // The widget
  57. VariableItemList* variable_item_list_wifi; // The variable item list (WiFi settings)
  58. VariableItem* variable_item_ssid; // The variable item (SSID)
  59. VariableItem* variable_item_password; // The variable item (password)
  60. TextInput* uart_text_input_ssid; // The text input for the SSID
  61. TextInput* uart_text_input_password; // The text input for the password
  62. TextInput* uart_text_input_dictionary; // The text input for the dictionary
  63. //
  64. Widget* widget_random_fact; // The text box that displays the random fact
  65. Widget* widget_dictionary; // The text box that displays the dictionary
  66. char* uart_text_input_buffer_ssid; // Buffer for the text input (SSID)
  67. char* uart_text_input_temp_buffer_ssid; // Temporary buffer for the text input (SSID)
  68. uint32_t uart_text_input_buffer_size_ssid; // Size of the text input buffer (SSID)
  69. char* uart_text_input_buffer_password; // Buffer for the text input (password)
  70. char* uart_text_input_temp_buffer_password; // Temporary buffer for the text input (password)
  71. uint32_t uart_text_input_buffer_size_password; // Size of the text input buffer (password)
  72. char* uart_text_input_buffer_dictionary; // Buffer for the text input (dictionary)
  73. char* uart_text_input_temp_buffer_dictionary; // Temporary buffer for the text input (dictionary)
  74. uint32_t uart_text_input_buffer_size_dictionary; // Size of the text input buffer (dictionary)
  75. } FlipLibraryApp;
  76. #endif // FLIP_LIBRARY_E_H