tcMenu
MenuHistoryNavigator.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 https://www.thecoderscorner.com (Nutricherry LTD).
3  * This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4  */
5 
11 #ifndef TCMENU_MENUHISTORYNAVIGATOR_H
12 #define TCMENU_MENUHISTORYNAVIGATOR_H
13 
14 #include "MenuItems.h"
15 
16 #ifndef NAV_ITEM_ARRAY_SIZE
17 #define NAV_ITEM_ARRAY_SIZE 4
18 #endif
19 
20 namespace tcnav {
21 
23  private:
24  MenuItem* root;
25  MenuItem* currentRoot;
26  MenuItem* currentSub;
27  MenuItem* navItems[NAV_ITEM_ARRAY_SIZE];
28  MenuItem* activeItems[NAV_ITEM_ARRAY_SIZE];
29  uint8_t navIdx;
30  bool currentIsCustom;
31  public:
32  MenuNavigationStore() = default;
33 
37  MenuItem* getRoot() { return root; }
41  MenuItem* getCurrentRoot() { return currentRoot; }
46  MenuItem* getCurrentSubMenu() { return currentSub; }
47 
52  void setRootItem(MenuItem* item);
53 
60  void navigateTo(MenuItem* activeItem, MenuItem* newRoot, bool custom);
61 
67 
68  bool isShowingRoot();
69  };
70 }
71 
72 #endif //TCMENU_MENUHISTORYNAVIGATOR_H
Definition: MenuItems.h:329
MenuItem * getRoot()
Definition: MenuHistoryNavigator.h:37
Definition: MenuHistoryNavigator.h:20
Definition: MenuHistoryNavigator.h:22
void navigateTo(MenuItem *activeItem, MenuItem *newRoot, bool custom)
Definition: MenuHistoryNavigator.cpp:19
void setRootItem(MenuItem *item)
Definition: MenuHistoryNavigator.cpp:11
MenuItem * getCurrentSubMenu()
Definition: MenuHistoryNavigator.h:46
MenuItem * getCurrentRoot()
Definition: MenuHistoryNavigator.h:41
MenuItem * popNavigationGetActive()
Definition: MenuHistoryNavigator.cpp:35