callback.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. #ifndef FLIP_SOCIAL_CALLBACK_H
  2. #define FLIP_SOCIAL_CALLBACK_H
  3. #include <flip_social.h>
  4. // replica of flipper_http_load_task but allows FlipperHTTP to be passed in
  5. typedef bool (*LoadingCallback)(FlipperHTTP *);
  6. void callback_loading_task(FlipperHTTP *fhttp,
  7. LoadingCallback http_request,
  8. LoadingCallback parse_response,
  9. uint32_t success_view_id,
  10. uint32_t failure_view_id,
  11. ViewDispatcher **view_dispatcher);
  12. bool callback_request_await(FlipperHTTP *fhttp, LoadingCallback http_request, LoadingCallback parse_response);
  13. /**
  14. * @brief Navigation callback to go back to the submenu Logged out.
  15. * @param context The context - unused
  16. * @return next view id (FlipSocialViewLoggedOutSubmenu)
  17. */
  18. uint32_t callback_to_submenu_logged_out(void *context);
  19. /**
  20. * @brief Navigation callback to go back to the submenu Logged in.
  21. * @param context The context - unused
  22. * @return next view id (FlipSocialViewLoggedInSubmenu)
  23. */
  24. uint32_t callback_to_submenu_logged_in(void *context);
  25. /**
  26. * @brief Navigation callback to bring the user back to the (Logged out) Login screen
  27. * @param context The context - unused
  28. * @return next view id (FlipSocialViewLoggedOutLogin)
  29. */
  30. uint32_t callback_to_login_logged_out(void *context);
  31. /**
  32. * @brief Navigation callback to bring the user back to the (Logged out) Register screen
  33. * @param context The context - unused
  34. * @return next view id (FlipSocialViewLoggedOutRegister)
  35. */
  36. uint32_t callback_to_register_logged_out(void *context);
  37. /**
  38. * @brief Navigation callback to bring the user back to the (Logged out) Wifi Settings screen
  39. * @param context The context - unused
  40. * @return next view id (FlipSocialViewLoggedOutWifiSettings)
  41. */
  42. uint32_t callback_to_wifi_settings_logged_out(void *context);
  43. /**
  44. * @brief Navigation callback to bring the user back to the (Logged in) Wifi Settings screen
  45. * @param context The context - unused
  46. * @return next view id (FlipSocialViewLoggedInSettingsWifi)
  47. */
  48. uint32_t callback_to_wifi_settings_logged_in(void *context);
  49. /**
  50. * @brief Navigation callback to bring the user back to the (Logged in) Settings screen
  51. * @param context The context - unused
  52. * @return next view id (FlipSocialViewLoggedInSettingsWifi)
  53. */
  54. uint32_t callback_to_settings_logged_in(void *context);
  55. /**
  56. * @brief Navigation callback to bring the user back to the (Logged in) Compose screen
  57. * @param context The context - unused
  58. * @return next view id (FlipSocialViewLoggedInCompose)
  59. */
  60. uint32_t callback_to_compose_logged_in(void *context);
  61. /**
  62. * @brief Navigation callback to bring the user back to the (Logged in) Profile screen
  63. * @param context The context - unused
  64. * @return next view id (FlipSocialViewLoggedInProfile)
  65. */
  66. uint32_t callback_to_profile_logged_in(void *context);
  67. /**
  68. * @brief Navigation callback to bring the user back to the Explore submenu
  69. * @param context The context - unused
  70. * @return next view id (FlipSocialViewLoggedInExploreSubmenu)
  71. */
  72. uint32_t callback_to_explore_logged_in(void *context);
  73. /**
  74. * @brief Navigation callback to bring the user back to the Friends submenu
  75. * @param context The context - unused
  76. * @return next view id (FlipSocialViewLoggedInFriendsSubmenu)
  77. */
  78. uint32_t callback_to_friends_logged_in(void *context);
  79. /**
  80. * @brief Navigation callback to bring the user back to the Messages submenu
  81. * @param context The context - unused
  82. * @return next view id (FlipSocialViewLoggedInMessagesSubmenu)
  83. */
  84. uint32_t callback_to_messages_logged_in(void *context);
  85. /**
  86. * @brief Navigation callback to bring the user back to the User Choices screen
  87. * @param context The context - unused
  88. * @return next view id (FlipSocialViewLoggedInMessagesUserChoices)
  89. */
  90. uint32_t callback_to_messages_user_choices(void *context);
  91. /**
  92. * @brief Navigation callback for exiting the application
  93. * @param context The context - unused
  94. * @return next view id (VIEW_NONE to exit the app)
  95. */
  96. uint32_t callback_exit_app(void *context);
  97. void callback_feed_draw(Canvas *canvas, void *model);
  98. bool callback_feed_input(InputEvent *event, void *context);
  99. /**
  100. * @brief Handle ALL submenu item selections.
  101. * @param context The context - FlipSocialApp object.
  102. * @param index The FlipSocialSubmenuIndex item that was clicked.
  103. * @return void
  104. */
  105. void callback_submenu_choices(void *context, uint32_t index);
  106. /**
  107. * @brief Text input callback for when the user finishes entering their SSID on the wifi settings (logged out) screen.
  108. * @param context The context - FlipSocialApp object.
  109. * @return void
  110. */
  111. void callback_logged_out_wifi_settings_ssid_updated(void *context);
  112. /**
  113. * @brief Text input callback for when the user finishes entering their password on the wifi settings (logged out) screen.
  114. * @param context The context - FlipSocialApp object.
  115. * @return void
  116. */
  117. void callback_logged_out_wifi_settings_password_updated(void *context);
  118. /**
  119. * @brief Callback when the user selects a menu item in the wifi settings (logged out) screen.
  120. * @param context The context - FlipSocialApp object.
  121. * @param index The index of the selected item.
  122. * @return void
  123. */
  124. void callback_logged_out_wifi_settings_item_selected(void *context, uint32_t index);
  125. /**
  126. * @brief Text input callback for when the user finishes entering their username on the login (logged out) screen.
  127. * @param context The context - FlipSocialApp object.
  128. * @return void
  129. */
  130. void callback_logged_out_login_username_updated(void *context);
  131. /**
  132. * @brief Text input callback for when the user finishes entering their password on the login (logged out) screen.
  133. * @param context The context - FlipSocialApp object.
  134. * @return void
  135. */
  136. void callback_logged_out_login_password_updated(void *context);
  137. /**
  138. * @brief Callback when the user selects a menu item in the login (logged out) screen.
  139. * @param context The context - FlipSocialApp object.
  140. * @param index The index of the selected item.
  141. * @return void
  142. */
  143. void callback_logged_out_login_item_selected(void *context, uint32_t index);
  144. /**
  145. * @brief Text input callback for when the user finishes entering their username on the register (logged out) screen.
  146. * @param context The context - FlipSocialApp object.
  147. * @return void
  148. */
  149. void callback_logged_out_register_username_updated(void *context);
  150. /**
  151. * @brief Text input callback for when the user finishes entering their password on the register (logged out) screen.
  152. * @param context The context - FlipSocialApp object.
  153. * @return void
  154. */
  155. void callback_logged_out_register_password_updated(void *context);
  156. /**
  157. * @brief Text input callback for when the user finishes entering their password 2 on the register (logged out) screen.
  158. * @param context The context - FlipSocialApp object.
  159. * @return void
  160. */
  161. void callback_logged_out_register_password_2_updated(void *context);
  162. /**
  163. * @brief Text input callback for when the user finishes entering their SSID on the wifi settings (logged in) screen.
  164. * @param context The context - FlipSocialApp object.
  165. * @return void
  166. */
  167. void callback_logged_in_wifi_settings_ssid_updated(void *context);
  168. /**
  169. * @brief Text input callback for when the user finishes entering their password on the wifi settings (logged in) screen.
  170. * @param context The context - FlipSocialApp object.
  171. * @return void
  172. */
  173. void callback_logged_in_wifi_settings_password_updated(void *context);
  174. /**
  175. * @brief Callback when the user selects a menu item in the wifi settings (logged in) screen.
  176. * @param context The context - FlipSocialApp object.
  177. * @param index The index of the selected item.
  178. * @return void
  179. */
  180. void callback_logged_in_wifi_settings_item_selected(void *context, uint32_t index);
  181. /**
  182. * @brief Text input callback for when the user finishes entering their message on the compose (logged in) screen for Add Text
  183. * @param context The context - FlipSocialApp object.
  184. * @return void
  185. */
  186. void callback_logged_in_compose_pre_save_updated(void *context);
  187. /**
  188. * @brief Text input callback for when the user finishes entering their message on the profile (logged in) screen for change password
  189. * @param context The context - FlipSocialApp object.
  190. * @return void
  191. */
  192. void callback_logged_in_profile_change_password_updated(void *context);
  193. /**
  194. * @brief Callback when a user selects a menu item in the profile (logged in) screen.
  195. * @param context The context - FlipSocialApp object.
  196. * @param index The index of the selected item.
  197. * @return void
  198. */
  199. void callback_logged_in_profile_change_bio_updated(void *context);
  200. void callback_logged_in_profile_item_selected(void *context, uint32_t index);
  201. /**
  202. * @brief Text input callback for when the user finishes entering their message to send to the selected user choice (user choice messages view)
  203. * @param context The context - FlipSocialApp object.
  204. * @return void
  205. */
  206. void callback_logged_in_messages_user_choice_message_updated(void *context);
  207. /**
  208. * @brief Text input callback for when the user finishes entering their message to the selected user (messages view)
  209. * @param context The context - FlipSocialApp object.
  210. * @return void
  211. */
  212. void callback_logged_in_messages_new_message_updated(void *context);
  213. /**
  214. * @brief Callback when the user selects a menu item in the register (logged out) screen.
  215. * @param context The context - FlipSocialApp object.
  216. * @param index The index of the selected item.
  217. * @return void
  218. */
  219. void callback_logged_out_register_item_selected(void *context, uint32_t index);
  220. void callback_logged_in_user_settings_item_selected(void *context, uint32_t index);
  221. void callback_logged_in_explore_updated(void *context);
  222. void callback_logged_in_message_users_updated(void *context);
  223. void callback_message_dialog(DialogExResult result, void *context);
  224. //
  225. bool callback_home_notification(FlipperHTTP *fhttp);
  226. #endif