web_crawler_e.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Define the submenu items for our WebCrawler application
  2. typedef enum
  3. {
  4. WebCrawlerSubmenuIndexRun, // The main screen
  5. WebCrawlerSubmenuIndexAbout, // The about screen
  6. WebCrawlerSubmenuIndexSetPath // The configuration screen
  7. } WebCrawlerSubmenuIndex;
  8. // Define views for our WebCrawler application
  9. typedef enum
  10. {
  11. WebCrawlerViewMain, // The main screen
  12. WebCrawlerViewSubmenu, // The menu when the app starts
  13. WebCrawlerViewAbout, // The about screen
  14. WebCrawlerViewConfigure, // The configuration screen
  15. WebCrawlerViewTextInput, // Text input screen for Path
  16. WebCrawlerViewTextInputSSID, // Text input screen for SSID
  17. WebCrawlerViewTextInputPassword, // Text input screen for Password
  18. } WebCrawlerView;
  19. // Define a separate model for the main view
  20. typedef struct
  21. {
  22. char path[128]; // Store the entered website path
  23. char ssid[128]; // Store the entered SSID
  24. char password[128]; // Store the entered password
  25. } WebCrawlerMainModel;
  26. // Define the application structure
  27. typedef struct
  28. {
  29. ViewDispatcher *view_dispatcher; // Switches between our views
  30. View *view_main; // The main screen that displays the main content
  31. Submenu *submenu; // The application submenu
  32. Widget *widget_about; // The about screen
  33. TextInput *text_input_path; // Text input screen for Path
  34. TextInput *text_input_ssid; // Text input screen for SSID
  35. TextInput *text_input_password; // Text input screen for Password
  36. VariableItemList *variable_item_list_config; // The configuration screen
  37. char *path; // The path to the website
  38. char *ssid; // The SSID of the WiFi network
  39. char *password; // The password of the WiFi network
  40. VariableItem *path_item; // Reference to the path configuration item
  41. VariableItem *ssid_item; // Reference to the SSID configuration item
  42. VariableItem *password_item; // Reference to the password configuration item
  43. char *temp_buffer_path; // Temporary buffer for text input (Path)
  44. uint32_t temp_buffer_size_path; // Size of the temporary buffer
  45. char *temp_buffer_ssid; // Temporary buffer for text input (SSID)
  46. uint32_t temp_buffer_size_ssid; // Size of the temporary buffer
  47. char *temp_buffer_password; // Temporary buffer for text input (Password)
  48. uint32_t temp_buffer_size_password; // Size of the temporary buffer
  49. } WebCrawlerApp;