6 #ifndef TCMENU_MANAGER_H
7 #define TCMENU_MANAGER_H
9 #include <IoAbstraction.h>
73 commitCb = callbackFn;
79 commitCb(item->
getId());
83 #ifndef MAX_MENU_NOTIFIERS
84 #define MAX_MENU_NOTIFIERS 4
98 EncoderWrapOverride(menuid_t itemId,
bool overrideValue) : itemId(itemId), overrideValue(overrideValue) {}
100 menuid_t getKey()
const {
return itemId; }
102 menuid_t getMenuId()
const {
return itemId; }
103 bool getOverrideValue()
const {
return overrideValue; }
118 EDITOR_WHOLE_ONLY = 0x0001, EDITOR_FRACTION_ONLY = 0x0002,
119 EDITOR_RUNTIME_TEXT = 0x0004,
120 EDITOR_OVERRIDE_LOCK = 0x8000
129 void lockEditor(
bool lock) { renderingType = lock ? EDITOR_OVERRIDE_LOCK : EDITOR_REGULAR; }
131 int getStartIndex()
const {
return editStart; }
132 int getEndIndex()
const {
return editEnd; }
146 EepromAbstraction* eepromRef;
148 bool useWrapAroundByDefault =
false;
149 BtreeList<menuid_t, EncoderWrapOverride> encoderWrapOverrides;
161 useWrapAroundByDefault = wrapAround;
220 pinid_t rightPin, pinid_t okPin,
int speed=20);
278 return authenticationManager;
317 EepromAbstraction* getEepromAbstraction() {
return eepromRef; }
324 eepromRef = globalRom;
331 void load(EepromAbstraction& eeprom, uint16_t magicKey = 0xfade, TimerFn onEepromEmpty =
nullptr);
338 void load(uint16_t magicKey = 0xfade, TimerFn onEepromEmpty =
nullptr);
441 return switches.getEncoder() !=
nullptr ? switches.getEncoder()->getCurrentReading() : 0;
514 void actionOnCurrentItem(
MenuItem * toEdit);
515 void actionOnSubMenu(
MenuItem* nextSub);
517 void notifyEditEnd(
MenuItem *pItem);
518 bool notifyEditStarting(
MenuItem *pItem);
524 return ty != CurrentEditorRenderingHints::EDITOR_REGULAR && ty != CurrentEditorRenderingHints::EDITOR_OVERRIDE_LOCK;
The base definitions and classes shared by all TcMenu renderers.
this file contains a series of helper methods for loading and saving menu item to eeprom.
void saveMenuStructure(EepromAbstraction *eeprom, uint16_t magicKey=0xfade)
Definition: EepromItemStorage.cpp:82
Contains the base functionality for communication between the menu library and remote APIs.
Definition: RemoteAuthentication.h:38
void menuEditEnded(MenuItem *item) override
Definition: tcMenu.h:78
void structureHasChanged() override
Definition: tcMenu.h:76
bool menuEditStarting(MenuItem *) override
Definition: tcMenu.h:77
EditorRenderingType
Definition: tcMenu.h:116
Definition: RemoteAuthentication.h:171
A series of utilities that used throughout tcMenu.