| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- #ifndef FLIP_SOCIAL_CALLBACK_H
- #define FLIP_SOCIAL_CALLBACK_H
- #include <flip_social.h>
- #include <messages/flip_social_messages.h>
- #include <friends/flip_social_friends.h>
- #include <explore/flip_social_explore.h>
- #include <feed/flip_social_feed.h>
- #include <flip_storage/flip_social_storage.h>
- #include <alloc/free.h>
- #include <alloc/alloc.h>
- /**
- * @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_logged_in_profile_change_bio_updated(void *context);
- 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);
- void flip_social_logged_in_user_settings_item_selected(void *context, uint32_t index);
- void flip_social_logged_in_explore_updated(void *context);
- void flip_social_logged_in_message_users_updated(void *context);
- // 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);
- void messages_dialog_callback(DialogExResult result, void *context);
- void feed_dialog_callback(DialogExResult result, void *context);
- //
- bool flip_social_home_notification();
- #endif
|