tcMenu
Public Member Functions | Static Public Member Functions | Friends | List of all members
RemoteMenuItem Class Reference

#include <RemoteMenuItem.h>

Inheritance diagram for RemoteMenuItem:
ListRuntimeMenuItem RuntimeMenuItem MenuItem

Public Member Functions

 RemoteMenuItem (const char *name, menuid_t id, MenuItem *next=nullptr)
 
void setRemoteServer (tcremote::TcMenuRemoteServer &server)
 
void registerCommsNotification (CommsCallbackFn passThruHandler)
 
void doPassThru (CommunicationInfo info)
 
- Public Member Functions inherited from ListRuntimeMenuItem
 ListRuntimeMenuItem (const AnyMenuInfo *info, int numberOfRows, const char *const *array, ListMode listMode, MenuItem *next=nullptr, bool isPgm=INFO_LOCATION_PGM)
 
 ListRuntimeMenuItem (const AnyMenuInfo *info, int numberOfRows, RuntimeRenderingFn renderFn, MenuItem *next=nullptr, bool isPgm=INFO_LOCATION_PGM)
 
 ListRuntimeMenuItem (menuid_t id, int numberOfRows, RuntimeRenderingFn renderFn, MenuItem *next=nullptr)
 
RuntimeMenuItemgetChildItem (int pos)
 
RuntimeMenuItemasParent ()
 
RuntimeMenuItemasBackMenu ()
 
ListMode getListMode () const
 
bool isActingAsParent () const
 
uint8_t getActiveIndex () const
 
void setActiveIndex (uint8_t idx)
 
const char *const * getDataArray ()
 
- Public Member Functions inherited from RuntimeMenuItem
 RuntimeMenuItem (MenuType menuType, menuid_t id, RuntimeRenderingFn renderFn, uint8_t itemPosition, uint8_t numberOfRows, MenuItem *next=nullptr)
 
 RuntimeMenuItem (const AnyMenuInfo *rtInfo, bool isPgm, MenuType menuType, RuntimeRenderingFn renderFn, uint8_t itemPosition, uint8_t numberOfRows, MenuItem *next=nullptr)
 
void copyValue (char *buffer, int bufferSize) const
 
void runCallback () const
 
int getRuntimeId () const
 
int getRuntimeEeprom () const
 
uint8_t getNumberOfParts () const
 
void copyRuntimeName (char *buffer, int bufferSize) const
 
uint8_t getNumberOfRows () const
 
uint8_t getItemPosition () const
 
void setNumberOfRows (uint8_t rows)
 
- Public Member Functions inherited from MenuItem
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
 
MenuItemgetNext () const
 
void setNext (MenuItem *pNext)
 
void changeOccurred (bool silent)
 

Static Public Member Functions

static RemoteMenuItemgetInstance ()
 

Friends

int remoteInfoRenderFn (RuntimeMenuItem *item, uint8_t row, RenderFnMode mode, char *buffer, int bufferSize)
 

Additional Inherited Members

- Public Types inherited from ListRuntimeMenuItem
enum  ListMode : uint8_t { CUSTOM_RENDER , RAM_ARRAY , FLASH_ARRAY }
 
- Protected Member Functions inherited from MenuItem
 MenuItem (MenuType menuType, const AnyMenuInfo *menuInfo, MenuItem *next, bool infoProgMem)
 
- Protected Attributes inherited from RuntimeMenuItem
menuid_t id
 
uint8_t itemPosition
 
uint8_t noOfParts
 
- Protected Attributes inherited from MenuItem
uint16_t flags
 
MenuItemnext
 
const AnyMenuInfoinfo = nullptr
 
RuntimeRenderingFn renderFn = nullptr
 
MenuType menuType
 

Detailed Description

A menu item that holds the current connectivity state of all remote connections registered with it, it is a run time list so needs no additional info structure. For each remote connection that you create, you register it with the addConnector(..) call. This registers this as the callback. If you also need to receive updates, register yourself as a communication listener and you'll receive updates as a pass thru. Note that this object is presently a singleton, one instance should manage all connection state.

Constructor & Destructor Documentation

◆ RemoteMenuItem()

RemoteMenuItem::RemoteMenuItem ( const char *  name,
menuid_t  id,
MenuItem next = nullptr 
)

Construct a remote menu item providing the ID, maximum remotes supported and the next item

Member Function Documentation

◆ setRemoteServer()

void RemoteMenuItem::setRemoteServer ( tcremote::TcMenuRemoteServer server)

Add all connections on a remote server to the list by their connector ID.

Parameters
server

◆ registerCommsNotification()

void RemoteMenuItem::registerCommsNotification ( CommsCallbackFn  passThruHandler)
inline

Register a pass thru for other items that are also interested in comms updates

Parameters
passThruthe callback to be called after this item has processed it

◆ doPassThru()

void RemoteMenuItem::doPassThru ( CommunicationInfo  info)
inline

call the pass thru if it's registered

Parameters
infothe comms info

◆ getInstance()

static RemoteMenuItem* RemoteMenuItem::getInstance ( )
inlinestatic
Returns
the global instance of this object. One list manages all connections.

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