tcMenu
Public Member Functions | List of all members
tcgfx::ItemDisplayPropertiesFactory Class Referenceabstract

#include <GfxMenuConfig.h>

Inheritance diagram for tcgfx::ItemDisplayPropertiesFactory:
tcgfx::ConfigurableItemDisplayPropertiesFactory tcgfx::NullItemDisplayPropertiesFactory

Public Member Functions

virtual ItemDisplayPropertiesconfigFor (MenuItem *pItem, ItemDisplayProperties::ComponentType compType)=0
 
virtual ItemDisplayPropertiesconfigForCurrentSub (ItemDisplayProperties::ComponentType compType)=0
 
virtual DrawableIconiconForMenuItem (uint16_t id)=0
 
virtual GridPositionWithIdgridPositionForItem (MenuItem *pItem)=0
 
virtual color_t getSelectedColor (ItemDisplayProperties::ColorType colorType, bool isUnderCursor=false)=0
 
virtual void addGridPosition (MenuItem *item, const GridPosition &position)=0
 

Detailed Description

This factory is responsible for generating all the display configuration settings for the main display, it provides all the grid setting overrides, icons, fonts, padding and colors. This class also provides sensible defaults for when no overrides are present. For GridSettings, it returns null if there is no override, for colors, fonts and padding it checks first by ID, then gets the default if no override exists. be easy to extend by the end user, in order to add additional drawing rules easily. This class will slowly replace the current GfxConfig objects which are quite inflexible.

Member Function Documentation

◆ configFor()

virtual ItemDisplayProperties* tcgfx::ItemDisplayPropertiesFactory::configFor ( MenuItem pItem,
ItemDisplayProperties::ComponentType  compType 
)
pure virtual

Returns the configuration for the parameters below, it should never return nullptr.

Parameters
pItemthe item or null for default
compTypethe component type to get the rendering for
Returns
the properties for a given component.

Implemented in tcgfx::NullItemDisplayPropertiesFactory, and tcgfx::ConfigurableItemDisplayPropertiesFactory.

◆ configForCurrentSub()

virtual ItemDisplayProperties* tcgfx::ItemDisplayPropertiesFactory::configForCurrentSub ( ItemDisplayProperties::ComponentType  compType)
pure virtual

Returns the configuration for the parameters below, it should never return nullptr, but the difference to configFor is that this version will not check at the item level so is safe when there are overrides at both the item and the sub level.

Parameters
compTypethe type of component to get the rendering for
Returns
the properties for the given component.

Implemented in tcgfx::NullItemDisplayPropertiesFactory, and tcgfx::ConfigurableItemDisplayPropertiesFactory.

◆ iconForMenuItem()

virtual DrawableIcon* tcgfx::ItemDisplayPropertiesFactory::iconForMenuItem ( uint16_t  id)
pure virtual

Returns the icon associated with the menu item ID, there are two special IDs for the edit and active icons

Parameters
idthe menu item ID or the special ID for edit or active icon
Returns
the icon or nullptr if not available

Implemented in tcgfx::NullItemDisplayPropertiesFactory, and tcgfx::ConfigurableItemDisplayPropertiesFactory.

◆ gridPositionForItem()

virtual GridPositionWithId* tcgfx::ItemDisplayPropertiesFactory::gridPositionForItem ( MenuItem pItem)
pure virtual

Get the grid item for a given position if it is available

Parameters
pItemthe item to get the grid position for
Returns
the grid position if available

Implemented in tcgfx::ConfigurableItemDisplayPropertiesFactory, and tcgfx::NullItemDisplayPropertiesFactory.

◆ getSelectedColor()

virtual color_t tcgfx::ItemDisplayPropertiesFactory::getSelectedColor ( ItemDisplayProperties::ColorType  colorType,
bool  isUnderCursor = false 
)
pure virtual

Get the selected color for a given palette entry

Parameters
colorType
Returns

Implemented in tcgfx::NullItemDisplayPropertiesFactory, and tcgfx::ConfigurableItemDisplayPropertiesFactory.

◆ addGridPosition()

virtual void tcgfx::ItemDisplayPropertiesFactory::addGridPosition ( MenuItem item,
const GridPosition position 
)
pure virtual

add a new grid position for a given menu item

Parameters
itemthe menu item the position is for
positionthe position to record

Implemented in tcgfx::ConfigurableItemDisplayPropertiesFactory, and tcgfx::NullItemDisplayPropertiesFactory.


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