web_crawler_callback.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. #ifndef WEB_CRAWLER_CALLBACK_H
  2. #define WEB_CRAWLER_CALLBACK_H
  3. #include "web_crawler.h"
  4. #include <flip_storage/web_crawler_storage.h>
  5. extern bool sent_http_request;
  6. extern bool get_success;
  7. extern bool already_success;
  8. void web_crawler_draw_error(Canvas *canvas);
  9. void web_crawler_http_method_change(VariableItem *item);
  10. void web_crawler_view_draw_callback(Canvas *canvas, void *context);
  11. /**
  12. * @brief Navigation callback to handle exiting from other views to the submenu.
  13. * @param context The context - WebCrawlerApp object.
  14. * @return WebCrawlerViewSubmenu
  15. */
  16. uint32_t web_crawler_back_to_configure_callback(void *context);
  17. /**
  18. * @brief Navigation callback to handle returning to the Wifi Settings screen.
  19. * @param context The context - WebCrawlerApp object.
  20. * @return WebCrawlerViewSubmenu
  21. */
  22. uint32_t web_crawler_back_to_main_callback(void *context);
  23. uint32_t web_crawler_back_to_file_callback(void *context);
  24. uint32_t web_crawler_back_to_wifi_callback(void *context);
  25. uint32_t web_crawler_back_to_request_callback(void *context);
  26. /**
  27. * @brief Navigation callback to handle exiting the app from the main submenu.
  28. * @param context The context - unused
  29. * @return VIEW_NONE to exit the app
  30. */
  31. uint32_t web_crawler_exit_app_callback(void *context);
  32. /**
  33. * @brief Handle submenu item selection.
  34. * @param context The context - WebCrawlerApp object.
  35. * @param index The WebCrawlerSubmenuIndex item that was clicked.
  36. */
  37. void web_crawler_submenu_callback(void *context, uint32_t index);
  38. /**
  39. * @brief Configuration enter callback to handle different items.
  40. * @param context The context - WebCrawlerApp object.
  41. * @param index The index of the item that was clicked.
  42. */
  43. void web_crawler_wifi_enter_callback(void *context, uint32_t index);
  44. /**
  45. * @brief Configuration enter callback to handle different items.
  46. * @param context The context - WebCrawlerApp object.
  47. * @param index The index of the item that was clicked.
  48. */
  49. void web_crawler_file_enter_callback(void *context, uint32_t index);
  50. /**
  51. * @brief Configuration enter callback to handle different items.
  52. * @param context The context - WebCrawlerApp object.
  53. * @param index The index of the item that was clicked.
  54. */
  55. void web_crawler_request_enter_callback(void *context, uint32_t index);
  56. /**
  57. * @brief Callback for when the user finishes entering the URL.
  58. * @param context The context - WebCrawlerApp object.
  59. */
  60. void web_crawler_set_path_updated(void *context);
  61. /**
  62. * @brief Callback for when the user finishes entering the headers
  63. * @param context The context - WebCrawlerApp object.
  64. */
  65. void web_crawler_set_headers_updated(void *context);
  66. /**
  67. * @brief Callback for when the user finishes entering the payload.
  68. * @param context The context - WebCrawlerApp object.
  69. */
  70. void web_crawler_set_payload_updated(void *context);
  71. /**
  72. * @brief Callback for when the user finishes entering the SSID.
  73. * @param context The context - WebCrawlerApp object.
  74. */
  75. void web_crawler_set_ssid_updated(void *context);
  76. /**
  77. * @brief Callback for when the user finishes entering the Password.
  78. * @param context The context - WebCrawlerApp object.
  79. */
  80. void web_crawler_set_password_update(void *context);
  81. /**
  82. * @brief Callback for when the user finishes entering the File Type.
  83. * @param context The context - WebCrawlerApp object.
  84. */
  85. void web_crawler_set_file_type_update(void *context);
  86. /**
  87. * @brief Callback for when the user finishes entering the File Rename.
  88. * @param context The context - WebCrawlerApp object.
  89. */
  90. void web_crawler_set_file_rename_update(void *context);
  91. /**
  92. * @brief Handler for Path configuration item click.
  93. * @param context The context - WebCrawlerApp object.
  94. * @param index The index of the item that was clicked.
  95. */
  96. void web_crawler_setting_item_path_clicked(void *context, uint32_t index);
  97. /**
  98. * @brief Handler for headers configuration item click.
  99. * @param context The context - WebCrawlerApp object.
  100. * @param index The index of the item that was clicked.
  101. */
  102. void web_crawler_setting_item_headers_clicked(void *context, uint32_t index);
  103. /**
  104. * @brief Handler for payload configuration item click.
  105. * @param context The context - WebCrawlerApp object.
  106. * @param index The index of the item that was clicked.
  107. */
  108. void web_crawler_setting_item_payload_clicked(void *context, uint32_t index);
  109. /**
  110. * @brief Handler for SSID configuration item click.
  111. * @param context The context - WebCrawlerApp object.
  112. * @param index The index of the item that was clicked.
  113. */
  114. void web_crawler_setting_item_ssid_clicked(void *context, uint32_t index);
  115. /**
  116. * @brief Handler for Password configuration item click.
  117. * @param context The context - WebCrawlerApp object.
  118. * @param index The index of the item that was clicked.
  119. */
  120. void web_crawler_setting_item_password_clicked(void *context, uint32_t index);
  121. /**
  122. * @brief Handler for File Type configuration item click.
  123. * @param context The context - WebCrawlerApp object.
  124. * @param index The index of the item that was clicked.
  125. */
  126. void web_crawler_setting_item_file_type_clicked(void *context, uint32_t index);
  127. /**
  128. * @brief Handler for File Rename configuration item click.
  129. * @param context The context - WebCrawlerApp object.
  130. * @param index The index of the item that was clicked.
  131. */
  132. void web_crawler_setting_item_file_rename_clicked(void *context, uint32_t index);
  133. /**
  134. * @brief Handler for File Delete configuration item click.
  135. * @param context The context - WebCrawlerApp object.
  136. * @param index The index of the item that was clicked.
  137. */
  138. void web_crawler_setting_item_file_delete_clicked(void *context, uint32_t index);
  139. void web_crawler_setting_item_file_read_clicked(void *context, uint32_t index);
  140. #endif