#ifndef FLIP_SOCIAL_CALLBACK_H #define FLIP_SOCIAL_CALLBACK_H #include #include #include #include #include #include #include /** * @brief Navigation callback to go back to the submenu Logged out. * @param context The context - unused * @return next view id (FlipSocialViewLoggedOutSubmenu) */ uint32_t flip_social_callback_to_submenu_logged_out(void *context); /** * @brief Navigation callback to go back to the submenu Logged in. * @param context The context - unused * @return next view id (FlipSocialViewLoggedInSubmenu) */ uint32_t flip_social_callback_to_submenu_logged_in(void *context); /** * @brief Navigation callback to bring the user back to the (Logged out) Login screen * @param context The context - unused * @return next view id (FlipSocialViewLoggedOutLogin) */ uint32_t flip_social_callback_to_login_logged_out(void *context); /** * @brief Navigation callback to bring the user back to the (Logged out) Register screen * @param context The context - unused * @return next view id (FlipSocialViewLoggedOutRegister) */ uint32_t flip_social_callback_to_register_logged_out(void *context); /** * @brief Navigation callback to bring the user back to the (Logged out) Wifi Settings screen * @param context The context - unused * @return next view id (FlipSocialViewLoggedOutWifiSettings) */ uint32_t flip_social_callback_to_wifi_settings_logged_out(void *context); /** * @brief Navigation callback to bring the user back to the (Logged in) Wifi Settings screen * @param context The context - unused * @return next view id (FlipSocialViewLoggedInSettingsWifi) */ uint32_t flip_social_callback_to_wifi_settings_logged_in(void *context); /** * @brief Navigation callback to bring the user back to the (Logged in) Settings screen * @param context The context - unused * @return next view id (FlipSocialViewLoggedInSettingsWifi) */ uint32_t flip_social_callback_to_settings_logged_in(void *context); /** * @brief Navigation callback to bring the user back to the (Logged in) Compose screen * @param context The context - unused * @return next view id (FlipSocialViewLoggedInCompose) */ uint32_t flip_social_callback_to_compose_logged_in(void *context); /** * @brief Navigation callback to bring the user back to the (Logged in) Profile screen * @param context The context - unused * @return next view id (FlipSocialViewLoggedInProfile) */ uint32_t flip_social_callback_to_profile_logged_in(void *context); /** * @brief Navigation callback to bring the user back to the Explore submenu * @param context The context - unused * @return next view id (FlipSocialViewLoggedInExploreSubmenu) */ uint32_t flip_social_callback_to_explore_logged_in(void *context); /** * @brief Navigation callback to bring the user back to the Friends submenu * @param context The context - unused * @return next view id (FlipSocialViewLoggedInFriendsSubmenu) */ uint32_t flip_social_callback_to_friends_logged_in(void *context); /** * @brief Navigation callback to bring the user back to the Messages submenu * @param context The context - unused * @return next view id (FlipSocialViewLoggedInMessagesSubmenu) */ uint32_t flip_social_callback_to_messages_logged_in(void *context); /** * @brief Navigation callback to bring the user back to the User Choices screen * @param context The context - unused * @return next view id (FlipSocialViewLoggedInMessagesUserChoices) */ uint32_t flip_social_callback_to_messages_user_choices(void *context); /** * @brief Navigation callback for exiting the application * @param context The context - unused * @return next view id (VIEW_NONE to exit the app) */ uint32_t flip_social_callback_exit_app(void *context); /** * @brief Handle ALL submenu item selections. * @param context The context - FlipSocialApp object. * @param index The FlipSocialSubmenuIndex item that was clicked. * @return void */ void flip_social_callback_submenu_choices(void *context, uint32_t index); /** * @brief Text input callback for when the user finishes entering their SSID on the wifi settings (logged out) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_out_wifi_settings_ssid_updated(void *context); /** * @brief Text input callback for when the user finishes entering their password on the wifi settings (logged out) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_out_wifi_settings_password_updated(void *context); /** * @brief Callback when the user selects a menu item in the wifi settings (logged out) screen. * @param context The context - FlipSocialApp object. * @param index The index of the selected item. * @return void */ void flip_social_text_input_logged_out_wifi_settings_item_selected(void *context, uint32_t index); /** * @brief Text input callback for when the user finishes entering their username on the login (logged out) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_out_login_username_updated(void *context); /** * @brief Text input callback for when the user finishes entering their password on the login (logged out) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_out_login_password_updated(void *context); /** * @brief Callback when the user selects a menu item in the login (logged out) screen. * @param context The context - FlipSocialApp object. * @param index The index of the selected item. * @return void */ void flip_social_text_input_logged_out_login_item_selected(void *context, uint32_t index); /** * @brief Text input callback for when the user finishes entering their username on the register (logged out) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_out_register_username_updated(void *context); /** * @brief Text input callback for when the user finishes entering their password on the register (logged out) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_out_register_password_updated(void *context); /** * @brief Text input callback for when the user finishes entering their password 2 on the register (logged out) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_out_register_password_2_updated(void *context); /** * @brief Text input callback for when the user finishes entering their SSID on the wifi settings (logged in) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_in_wifi_settings_ssid_updated(void *context); /** * @brief Text input callback for when the user finishes entering their password on the wifi settings (logged in) screen. * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_in_wifi_settings_password_updated(void *context); /** * @brief Callback when the user selects a menu item in the wifi settings (logged in) screen. * @param context The context - FlipSocialApp object. * @param index The index of the selected item. * @return void */ void flip_social_text_input_logged_in_wifi_settings_item_selected(void *context, uint32_t index); /** * @brief Text input callback for when the user finishes entering their message on the compose (logged in) screen for Add Text * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_in_compose_pre_save_updated(void *context); /** * @brief Text input callback for when the user finishes entering their message on the profile (logged in) screen for change password * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_in_profile_change_password_updated(void *context); /** * @brief Callback when a user selects a menu item in the profile (logged in) screen. * @param context The context - FlipSocialApp object. * @param index The index of the selected item. * @return void */ void flip_social_text_input_logged_in_profile_item_selected(void *context, uint32_t index); /** * @brief Callback when a user selects a menu item in the settings (logged in) screen. * @param context The context - FlipSocialApp object. * @param index The index of the selected item. * @return void */ void flip_social_text_input_logged_in_settings_item_selected(void *context, uint32_t index); /** * @brief Text input callback for when the user finishes entering their message to send to the selected user choice (user choice messages view) * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_in_messages_user_choice_message_updated(void *context); /** * @brief Text input callback for when the user finishes entering their message to the selected user (messages view) * @param context The context - FlipSocialApp object. * @return void */ void flip_social_logged_in_messages_new_message_updated(void *context); /** * @brief Callback when the user selects a menu item in the register (logged out) screen. * @param context The context - FlipSocialApp object. * @param index The index of the selected item. * @return void */ void flip_social_text_input_logged_out_register_item_selected(void *context, uint32_t index); // Add edits by Derek Jamison typedef enum DataState DataState; enum DataState { DataStateInitial, DataStateRequested, DataStateReceived, DataStateParsed, DataStateParseError, DataStateError, }; typedef enum FlipSocialCustomEvent FlipSocialCustomEvent; enum FlipSocialCustomEvent { FlipSocialCustomEventProcess, }; typedef struct DataLoaderModel DataLoaderModel; typedef bool (*DataLoaderFetch)(DataLoaderModel *model); typedef char *(*DataLoaderParser)(DataLoaderModel *model); struct DataLoaderModel { char *title; char *data_text; DataState data_state; DataLoaderFetch fetcher; DataLoaderParser parser; void *parser_context; size_t request_index; size_t request_count; ViewNavigationCallback back_callback; FuriTimer *timer; }; void flip_social_generic_switch_to_view(FlipSocialApp *app, char *title, DataLoaderFetch fetcher, DataLoaderParser parser, size_t request_count, ViewNavigationCallback back, uint32_t view_id); void flip_social_loader_draw_callback(Canvas *canvas, void *model); void flip_social_loader_init(View *view); void flip_social_loader_free_model(View *view); bool flip_social_custom_event_callback(void *context, uint32_t index); #endif