|
DUDS
|
Distributed Update of Data from Something
|
Provides access to a MenuOutput for rendering. More...
#include <MenuOutputAccess.hpp>
Public Member Functions | |
| MenuOutputAccess (MenuOutput *mov, std::size_t newRange=-1) | |
| Creates a new MenuOutputAccess object that will provide information on the visible items from the given output view. More... | |
| MenuOutputAccess (MenuOutput &mov, std::size_t newRange=-1) | |
| Creates a new MenuOutputAccess object that will provide information on the visible items from the given output view. More... | |
| MenuOutputAccess (const MenuOutputSptr &mov, std::size_t newRange=-1) | |
| Creates a new MenuOutputAccess object that will provide information on the visible items from the given output view. More... | |
| ~MenuOutputAccess () | |
| Relinquishes access to the outview's data. More... | |
| MenuVisibleList::const_iterator | begin () const |
| Returns an iterator to the start of the visible menu items. More... | |
| bool | changed () const |
| True if the view has changed since the last access. More... | |
| bool | empty () const |
| Returns true if there are no visible menu items. More... | |
| MenuVisibleList::const_iterator | end () const |
| Returns an iterator to the end of the visible menu items. More... | |
| std::size_t | firstIndex () const |
| Returns the index of the first visible menu item, or -1 for an empty menu. More... | |
| bool | haveToggles () const |
| True if the menu has at least one MenuItem that is a toggle, even if none of the toggles are visible. More... | |
| const std::shared_ptr< MenuItem > & | item (std::size_t index) const |
| Returns the MenuItem object at the given position on the menu, not the position of visible items. More... | |
| std::size_t | lastIndex () const |
| Returns the index of the last visible menu item, or -1 for an empty menu. More... | |
| std::size_t | maxVisible () const |
| Returns the currently set maximum number of visible menu items. More... | |
| void | maxVisible (std::size_t newRange) const |
| Changes the maximum number of visible menu items and causes the visible list to be regenerated. More... | |
| const Menu * | menu () const |
| Returns the Menu in use. More... | |
| const MenuOutput * | outputView () const |
| Returns the MenuOutput being accessed. More... | |
| void | retire () noexcept |
| Relinquishes access to the outview's data. More... | |
| std::size_t | selectedIndex () const |
| Returns the index of the currently selected MenuItem from Menu's container. More... | |
| const MenuItem & | selectedItem () const |
| Returns the selected MenuItem object. More... | |
| const MenuVisibleList::const_iterator & | selectedIter () const |
| Returns an iterator to the selected menu item. More... | |
| std::size_t | selectedVisible () const |
| Returns the index of the currently selected MenuItem within the list of currently visible items. More... | |
| bool | showingAll () const |
| True if the entire menu is currently visible. More... | |
| bool | showingFirst () const |
| True if the menu's first visible item is one of the currently visible items. More... | |
| bool | showingLast () const |
| True if the menu's last visible item is one of the currently visible items. More... | |
| std::size_t | size () const |
| Returns the number of visible menu items. More... | |
Private Attributes | |
| friend | MenuOutput |
| MenuOutput * | outview |
| The output view being accessed. More... | |
| MenuVisibleList::const_iterator | seliter |
| An iterator to the selected item. More... | |
| Menu * | viewmenu |
| The menu used by the view. More... | |
Provides access to a MenuOutput for rendering.
Input processing in the MenuView may occur during this object's constructor, which may cause a MenuItem's chose() function to be called.
This will acquire a shared lock on the associated Menu and MenuView objects that are released when this object is destroyed or retire() is called. It will also get an exclusive lock on the MenuOutput during the constructor. None of these locks are recursive; a thread must not have multiple MenuOutputAccess objects from the same MenuOutput on the stack at the same time.
Definition at line 29 of file MenuOutputAccess.hpp.
| duds::ui::menu::MenuOutputAccess::MenuOutputAccess | ( | MenuOutput * | mov, |
| std::size_t | newRange = -1 |
||
| ) |
Creates a new MenuOutputAccess object that will provide information on the visible items from the given output view.
| mov | The output view to use. |
| newRange | The number of menu items that can be displayed, or -1 to not change the range. |
Definition at line 14 of file MenuOutputAccess.cpp.
|
inline |
Creates a new MenuOutputAccess object that will provide information on the visible items from the given output view.
| mov | The output view to use. |
| newRange | The number of menu items that can be displayed, or -1 to not change the range. |
Definition at line 59 of file MenuOutputAccess.hpp.
|
inline |
Creates a new MenuOutputAccess object that will provide information on the visible items from the given output view.
| mov | The output view to use. |
| newRange | The number of menu items that can be displayed, or -1 to not change the range. |
Definition at line 68 of file MenuOutputAccess.hpp.
|
inline |
Relinquishes access to the outview's data.
Definition at line 75 of file MenuOutputAccess.hpp.
|
inline |
Returns an iterator to the start of the visible menu items.
Definition at line 158 of file MenuOutputAccess.hpp.
|
inline |
True if the view has changed since the last access.
Definition at line 117 of file MenuOutputAccess.hpp.
|
inline |
Returns true if there are no visible menu items.
This may be true even when the menu has items.
Definition at line 148 of file MenuOutputAccess.hpp.
|
inline |
Returns an iterator to the end of the visible menu items.
As with regular C++ containers, this iterator cannot be dereferenced.
Definition at line 169 of file MenuOutputAccess.hpp.
|
inline |
Returns the index of the first visible menu item, or -1 for an empty menu.
Definition at line 212 of file MenuOutputAccess.hpp.
|
inline |
True if the menu has at least one MenuItem that is a toggle, even if none of the toggles are visible.
Room should be left on the rendered menu for toggles if the menu has toggles.
Definition at line 134 of file MenuOutputAccess.hpp.
|
inline |
Returns the MenuItem object at the given position on the menu, not the position of visible items.
Items that are not visible may be requested.
| index | The position of the menu item to return. |
| MenuBoundsError | The index is beyond the bounds of this menu. |
Definition at line 126 of file MenuOutputAccess.hpp.
|
inline |
Returns the index of the last visible menu item, or -1 for an empty menu.
Definition at line 218 of file MenuOutputAccess.hpp.
|
inline |
Returns the currently set maximum number of visible menu items.
Definition at line 97 of file MenuOutputAccess.hpp.
Referenced by duds::ui::menu::renderers::BppMenuRenderer::render().
|
inline |
Changes the maximum number of visible menu items and causes the visible list to be regenerated.
Since the visible list is generated as part of constructing this object, it is best to tell the constructor of any change in the number of visible items. If the number of visible items does not change, the list will not be regenerated.
| newRange | The number of menu items that can be displayed. |
Definition at line 111 of file MenuOutputAccess.hpp.
|
inline |
Returns the Menu in use.
Definition at line 85 of file MenuOutputAccess.hpp.
|
inline |
Returns the MenuOutput being accessed.
Definition at line 91 of file MenuOutputAccess.hpp.
|
noexcept |
Relinquishes access to the outview's data.
Definition at line 27 of file MenuOutputAccess.cpp.
Referenced by ~MenuOutputAccess().
|
inline |
Returns the index of the currently selected MenuItem from Menu's container.
This is not the position within the visible items; it is the position within all items for the menu. If the menu is empty, this value should not be used.
Definition at line 196 of file MenuOutputAccess.hpp.
|
inline |
Returns the selected MenuItem object.
Definition at line 187 of file MenuOutputAccess.hpp.
|
inline |
Returns an iterator to the selected menu item.
The iterator may be the same as end() if there is no selected item, but this should only be true for empty menus.
Definition at line 181 of file MenuOutputAccess.hpp.
|
inline |
Returns the index of the currently selected MenuItem within the list of currently visible items.
This must only be used by rendering code; menu operations requiring the selected index must use selected() instead. If the menu has no visible items (empty() is true), this value should not be used.
Definition at line 206 of file MenuOutputAccess.hpp.
Referenced by duds::ui::menu::renderers::BppMenuRenderer::render().
|
inline |
True if the entire menu is currently visible.
Definition at line 238 of file MenuOutputAccess.hpp.
Referenced by duds::ui::menu::renderers::BppMenuRenderer::render().
|
inline |
True if the menu's first visible item is one of the currently visible items.
Definition at line 225 of file MenuOutputAccess.hpp.
|
inline |
True if the menu's last visible item is one of the currently visible items.
Definition at line 232 of file MenuOutputAccess.hpp.
Referenced by duds::ui::menu::renderers::BppMenuRenderer::render().
|
inline |
Returns the number of visible menu items.
This may be smaller than the maximum number of items that can be displayed.
Definition at line 141 of file MenuOutputAccess.hpp.
Referenced by duds::ui::menu::renderers::BppMenuRenderer::render().
|
private |
Definition at line 42 of file MenuOutputAccess.hpp.
|
private |
The output view being accessed.
Definition at line 33 of file MenuOutputAccess.hpp.
Referenced by MenuOutputAccess(), outputView(), and retire().
|
private |
An iterator to the selected item.
Definition at line 41 of file MenuOutputAccess.hpp.
Referenced by MenuOutputAccess().
|
private |
The menu used by the view.
Definition at line 37 of file MenuOutputAccess.hpp.
Referenced by menu(), MenuOutputAccess(), and retire().