tcMenu
Public Member Functions | List of all members
tcnav::MenuNavigationStore Class Reference

Public Member Functions

void addNavigationListener (NavigationListener *newListener)
 
void clearNavigationListeners ()
 
void triggerNavigationListener (bool completeReset)
 
MenuItemgetRoot ()
 
MenuItemgetCurrentRoot ()
 
MenuItemgetCurrentSubMenu ()
 
void setRootItem (MenuItem *item)
 
void navigateTo (MenuItem *activeItem, MenuItem *newRoot, bool custom)
 
MenuItempopNavigationGetActive ()
 
bool isShowingRoot ()
 
int getNavigationDepth () const
 
MenuItemgetActiveAt (uint8_t i)
 
MenuItemgetRootAt (uint8_t i)
 
void resetStack ()
 

Member Function Documentation

◆ getRoot()

MenuItem* tcnav::MenuNavigationStore::getRoot ( )
inline
Returns
the absolute root of all menu items

◆ getCurrentRoot()

MenuItem* tcnav::MenuNavigationStore::getCurrentRoot ( )
inline
Returns
the currently selected root (or sub menu)

◆ getCurrentSubMenu()

MenuItem* tcnav::MenuNavigationStore::getCurrentSubMenu ( )
inline

Get the submenu for the current item, WARNING null is returned on the root menu as it has no root

Returns
the current submenu or null for ROOT

◆ setRootItem()

void tcnav::MenuNavigationStore::setRootItem ( MenuItem item)

Call during initialisation of a complete menu structure, it sets the root, and resets navigation.

Parameters
itemthe new root

◆ navigateTo()

void tcnav::MenuNavigationStore::navigateTo ( MenuItem activeItem,
MenuItem newRoot,
bool  custom 
)

Navigates to a new menu, remembering the history of all items that are contained within the current root.

Parameters
activeItemthe item that was selected
newRootthe new root that will be displayed

◆ popNavigationGetActive()

MenuItem * tcnav::MenuNavigationStore::popNavigationGetActive ( )

Pops the last navigation item, or in the worst case goes back to root.

Returns
the item that should be selected after this item is popped

◆ getNavigationDepth()

int tcnav::MenuNavigationStore::getNavigationDepth ( ) const
inline
Returns
the depth of the navigation stack that is being managed.

◆ getActiveAt()

MenuItem* tcnav::MenuNavigationStore::getActiveAt ( uint8_t  i)
inline

The active item at a given zero based position in the stack or nullptr if out of range

Parameters
ithe index
Returns
the item or nullptr

◆ getRootAt()

MenuItem* tcnav::MenuNavigationStore::getRootAt ( uint8_t  i)
inline

Get the root menu item for the given zero based position in the stack or nullptr if out of range.

Parameters
ithe index
Returns
the item or nullptr

◆ resetStack()

void tcnav::MenuNavigationStore::resetStack ( )

Completely reset the navigation back to the initial state where root is on display


The documentation for this class was generated from the following files: