tcMenu
Public Types | Public Member Functions | Static Public Member Functions | List of all members
DateFormattedMenuItem Class Reference

#include <RuntimeMenuItem.h>

Inheritance diagram for DateFormattedMenuItem:
EditableMultiPartMenuItem RuntimeMenuItem MenuItem

Public Types

enum  DateFormatOption { DD_MM_YYYY , MM_DD_YYYY , YYYY_MM_DD }
 

Public Member Functions

 DateFormattedMenuItem (RuntimeRenderingFn renderFn, menuid_t id, MenuItem *next=nullptr)
 
 DateFormattedMenuItem (RuntimeRenderingFn renderFn, const DateStorage &initial, menuid_t id, MenuItem *next=nullptr)
 
 DateFormattedMenuItem (const AnyMenuInfo *info, RuntimeRenderingFn renderFn, const DateStorage &initial, menuid_t, MenuItem *next=nullptr, bool isPgm=INFO_LOCATION_PGM)
 
 DateFormattedMenuItem (const AnyMenuInfo *info, const DateStorage &initial, MenuItem *next=nullptr, bool isPgm=INFO_LOCATION_PGM)
 
DateStorage getDate () const
 
void setDate (DateStorage newDate)
 
void setDateFromString (const char *dateText)
 
DateStoragegetUnderlyingData ()
 
- Public Member Functions inherited from EditableMultiPartMenuItem
 EditableMultiPartMenuItem (MenuType type, menuid_t id, int numberOfParts, RuntimeRenderingFn renderFn, MenuItem *next=nullptr)
 
 EditableMultiPartMenuItem (const AnyMenuInfo *rtInfo, bool isPgm, MenuType type, int numberOfParts, RuntimeRenderingFn renderFn, MenuItem *next=nullptr)
 
uint8_t beginMultiEdit ()
 
int changeEditBy (int amt)
 
int previousPart ()
 
int nextPart ()
 
int getCurrentRange () const
 
void stopMultiEdit ()
 
int getPartValueAsInt () const
 
bool valueChanged (int newVal)
 
- 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 void setDateSeparator (char sep)
 
static char getDateSeparator ()
 
static void setDateFormatStyle (DateFormatOption fmt)
 
static DateFormatOption getDateFormatStyle ()
 

Additional Inherited Members

- 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 runtime menu item that represents a date value in the gregorian calendar. It is an extension of the multipart editor class that supports editing dates in parts, days, month and finally years. It has some very basic support for leap years. Instances of this class should use the dateItemRenderFn for the base rendering.

Member Function Documentation

◆ setDateSeparator()

static void DateFormattedMenuItem::setDateSeparator ( char  sep)
inlinestatic

sets the global separator for date rendering.

Parameters
septhe new separator character

◆ getDateSeparator()

static char DateFormattedMenuItem::getDateSeparator ( )
inlinestatic
Returns
the global separator for date rendering.

◆ setDateFormatStyle()

static void DateFormattedMenuItem::setDateFormatStyle ( DateFormatOption  fmt)
inlinestatic

Sets the global date formatting for dates, one of the enum DateFormatOption.

Parameters
fmtthe new format to use

◆ getDateFormatStyle()

static DateFormatOption DateFormattedMenuItem::getDateFormatStyle ( )
inlinestatic
Returns
the global date format option in use by all date formatters.

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