Stores a stack of screen view controllers (referred to here for simplicity as "screens") to allow for forward and backward navigation between screens (including handling screen transitions) by using PushScreen() and PopScreen().
Each call to PushScreen() and PopScreen() initiates a screen transition. In the case of PushScreen(), it is a transition to the pushed screen. In the case of PopScreen(), it is a transition to the next screen in the stack. However, this transition does not take place if IsTransitionActive() returns true since there is already a transition taking place.
A CYIScreenTransition controls the transitions between the screens.
To listen for and respond to varous screen transition events, construct a class that implements CYIScreenTransitionManager::ScreenTransitionDelegate.
Use the struct CYIScreenTransitionManager::ScreenTransitionBundle to store extra data for individual screens. This struct is stored using PushScreen() and can be retrieved with PeekScreenBundle().
Steps to create a screen transition manager using a screen transition delegate for listening:
Detailed description of the transition sequence when moving from one screen to the next:
#include <screen/YiScreenTransitionManager.h>

Classes | |
| struct | ScreenTransitionBundle |
| Contains optional data which can be stored on the screen stack with PushScreen() and retrieved using PeekScreenBundle(). More... | |
| class | ScreenTransitionDelegate |
| Listener interface for the CYIScreenTransitionManager events. More... | |
Public Attributes | |
| CYISignal< const CYIPersistentStore & > | TransitionStarted |
| CYISignal | TransitionCompleted |
| CYISignal< const CYIBundle & > | TransitionFailed |
| ScreenTransitionDelegate::onTransitionError. More... | |
Protected Member Functions | |
| uint32_t | GetStackSize () const |
| CYIScreenTransitionManager::CYIScreenTransitionManager | ( | ) |
|
virtual |
| void CYIScreenTransitionManager::AppSpecificLoadingComplete | ( | ) |
Called from CYIScreenController to indicate that the application loading is complete.
| void CYIScreenTransitionManager::ClearScreenNavigationHistory | ( | ) |
Clears the navigation history by removing all screens from the stack except the current screen.
| bool CYIScreenTransitionManager::Connect | ( | CYIAbstractScreenViewController * | pScreen | ) |
Connects the CYIAbstractScreenViewController signals to pScreen. Must be called before PushScreen(). Returns false and has no effect if pScreen is null.
| bool CYIScreenTransitionManager::Disconnect | ( | CYIAbstractScreenViewController * | pScreen | ) |
Disconnects the CYIAbstractScreenViewController signals from pScreen. Returns false and has no effect if pScreen is null.
|
protected |
| bool CYIScreenTransitionManager::IsTransitionActive | ( | ) | const |
Returns whether or not there is a transition currently active.
A transition is active once a screen is pushed or popped until such time as the screen being navigated to loads or fails to load. If a screen fails to load it is due to an error in CYIAbstractScreenViewController::Preload().
The active state will persist throughout any screen in and out animations, becoming inactive only upon the completion of the animations.
| CYIAbstractScreenViewController* CYIScreenTransitionManager::PeekScreen | ( | ) | const |
Returns the next screen on the stack underneath the current screen. This is the screen that will be transitioned to with a call to PopScreen().
This method is useful for a variety of tasks. For example, it can be used to check if there are no more screens on the stack or to retrieve details about the prevous screen in order to perform particular actions before PopScreen() is called.
| CYIBundle CYIScreenTransitionManager::PeekScreenBundle | ( | ) | const |
Returns a copy of the bundle of the next screen on the stack underneath the current screen. This is the screen that will be transitioned to with a call to PopScreen().
| void CYIScreenTransitionManager::PopAllScreens | ( | ) |
Unloads the current screen controller on the stack and removes all the others leaving the stack empty. Initiates a screen transition to the last screen in the stack.
| bool CYIScreenTransitionManager::PopScreen | ( | ) |
Removes the screen that was last pushed from the screen stack and initiates a screen transition to that screen.
| void CYIScreenTransitionManager::PushScreen | ( | CYIAbstractScreenViewController * | pScreen | ) |
Pushes pScreen onto the screen stack which initiates a screen transition to that screen.
| void CYIScreenTransitionManager::PushScreen | ( | CYIAbstractScreenViewController * | pScreen, |
| const CYIBundle & | bundle | ||
| ) |
Pushes pScreen onto the screen stack along with bundle data.
| void CYIScreenTransitionManager::PushScreen | ( | CYIAbstractScreenViewController * | pScreen, |
| const CYIBundle & | bundle, | ||
| const std::vector< ScreenTransitionBundle > & | historyScreens | ||
| ) |
Pushes pScreen onto the screen stack along with bundle data and a list of history screens.
| void CYIScreenTransitionManager::SetMaxScreenStackSize | ( | uint32_t | uSize | ) |
Assigns uSize as the maximum screen stack size. The default value is 0. A value of 0 indicates no stack size limit.
| void CYIScreenTransitionManager::SetTransitionDelegate | ( | ScreenTransitionDelegate * | pScreenTransitionDelegate | ) |
Assigns pScreenTransitionDelegate as the screen transition delegate which will be notified when various screen transition manager events occur. Only one ScreenTransitionDelegate can be set, and subsequent calls to this function will replace the active delegate. Use nullptr to remove a previously set ScreenTransitionDelegate.
| void CYIScreenTransitionManager::UseTransition | ( | CYIScreenTransition * | pTransition | ) |
Sets the CYIScreenTransition to be used during screen navigation. Only one CYIScreenTransition can be used, and subsequent calls to this function will replace a previously set transition. Use nullptr to remove a previously set CYIScreenTransition.
| CYISignal CYIScreenTransitionManager::TransitionCompleted |
| CYISignal<const CYIPersistentStore &> CYIScreenTransitionManager::TransitionStarted |