callback.h 9.4 KB

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