#include <MenuItems.h>
Public Member Functions | |
uint8_t | copyNameToBuffer (char *sz, int size) const |
uint8_t | copyNameToBuffer (char *sz, int offset, int size) const |
menuid_t | getId () const |
uint16_t | getMaximumValue () const |
uint16_t | getEepromPosition () const |
MenuType | getMenuType () const |
void | triggerCallback () const |
bool | isInfoProgMem () const |
void | setChanged (bool changed) |
void | setChanged (int num, bool changed) |
bool | isChanged (int num=0) const |
bool | isSendRemoteNeeded (uint8_t remoteNo) const |
void | setSendRemoteNeededAll () |
void | clearSendRemoteNeededAll () |
void | setSendRemoteNeeded (uint8_t remoteNo, bool needed) |
void | setReadOnly (bool active) |
bool | isReadOnly () const |
void | setLocalOnly (bool localOnly) |
bool | isLocalOnly () const |
void | setSecured (bool secured) |
bool | isSecured () const |
void | setVisible (bool visible) |
bool | isVisible () const |
MenuItem * | getNext () const |
void | setNext (MenuItem *pNext) |
void | changeOccurred (bool silent) |
Protected Member Functions | |
MenuItem (MenuType menuType, const AnyMenuInfo *menuInfo, MenuItem *next, bool infoProgMem) | |
Protected Attributes | |
uint16_t | flags |
MenuItem * | next |
const AnyMenuInfo * | info = nullptr |
RuntimeRenderingFn | renderFn = nullptr |
MenuType | menuType |
This is the base class of all menu items, containing functionality to hold the current state of the menu and determine which is the next menu in the chain. It also defines a few functions that all implementations implement.
As there is limited memory on the device, most of the static information is stored in a paired AnyMenuInfo structure, saving quite a lot of RAM, also each menu item is in a chain, where getNext() will returned the next available item. NULL represents the end of the chain.
|
protected |
Do not directly create menu items, always use the leaf classes, such as AnalogMenuItem etc.
|
inline |
Copies the name into the provided buffer starting at position 0.
sz | the buffer space |
size | the size of sz, generally obtained using sizeof |
uint8_t MenuItem::copyNameToBuffer | ( | char * | sz, |
int | offset, | ||
int | size | ||
) | const |
Copies the name info the provided buffer starting at the specified position.
sz | the buffer space |
offset | the offset to start at relative to the buffer |
size | the size of sz, generally obtained using sizeof |
uint16_t MenuItem::getId | ( | ) | const |
Retrieves the ID from the info block
uint16_t MenuItem::getMaximumValue | ( | ) | const |
Retrieves the maximum value for this menu type
uint16_t MenuItem::getEepromPosition | ( | ) | const |
Retrieves the eeprom storage position for this menu (or 0xffff if not applicable)
|
inline |
returns the menu type as one of the above menu type enumeration
void MenuItem::triggerCallback | ( | ) | const |
triggers the event callback associated with this item
void MenuItem::setChanged | ( | bool | changed | ) |
set the item to be changed to all renderers, and when changed is true all remotes as well. When clearing changed flag prefer to use the numbered version below.
|
inline |
set the item to be changed, this lets a renderer know it needs painting
|
inline |
returns the changed state of the item
bool MenuItem::isSendRemoteNeeded | ( | uint8_t | remoteNo | ) | const |
returns if the menu item needs to be sent remotely
void MenuItem::setSendRemoteNeededAll | ( | ) |
Set all the flags indicating that a remote refresh is needed for all remotes
void MenuItem::clearSendRemoteNeededAll | ( | ) |
Clears all the flags indicating that a remote send is needed for all remotes.
void MenuItem::setSendRemoteNeeded | ( | uint8_t | remoteNo, |
bool | needed | ||
) |
set the flag indicating that a remote refresh is needed for a specific remote
|
inline |
sets this item to be read only, so that the manager will not allow it to be edited
|
inline |
returns true if this item is read only
|
inline |
sets this item to be available only locally
|
inline |
returns true if this item is only available locally
|
inline |
sets this item to need pin security in order to display, currently only available locally
|
inline |
returns true if this item requires a pin to display, , currently only available locally
|
inline |
sets this item to need pin security in order to display, currently only available locally
|
inline |
returns true if this item requires a pin to display, , currently only available locally
|
inline |
gets the next menu (sibling) at this level
|
inline |
sets or changes the menu item that comes after this one, nullptr means this is the last item
void MenuItem::changeOccurred | ( | bool | silent | ) |
Marks the menu item as having updated locally and remotely and also calls the callback if not silent
|
protected |
we only have either an info structure or a runtime menu callback function