A view that represents a set of views.
More...
#include <AUI/View/AViewContainerBase.h>
AViewContainerBase can store, render, resize, provide events to and handle the child views.
AViewContainerBase does not control the position and size of the child views by itself; instead, it delegates that responsibility to it's layout manager.
Since AViewContainerBase is an instance of AView, AViewContainerBase can handle AViewContainerBases recursively, thus, making possible complex UI by nested AViewContainerBases with different layout managers.
This class is abstract. The methods for modifying it's views are protected. You can use AViewContainer which exposes these methods to public or extend AViewContainerBase to make your own container-like view.
- Examples
- /home/runner/work/aui/aui/aui.views/src/AUI/View/AView.h, and examples/ui/contacts/src/view/ContactDetailsView.h.
> All members, including inherited
◆ addViewCustomLayout()
void AViewContainerBase::addViewCustomLayout |
( |
const _< AView > & | view | ) |
|
|
protected |
◆ applyGeometryToChildren()
virtual void AViewContainerBase::applyGeometryToChildren |
( |
| ) |
|
|
protectedvirtual |
◆ applyGeometryToChildrenIfNecessary()
void AViewContainerBase::applyGeometryToChildrenIfNecessary |
( |
| ) |
|
◆ capturesFocus()
bool AViewContainerBase::capturesFocus |
( |
| ) |
|
|
overridevirtual |
- Returns
- Can this view capture focus.
For containers, capturing focus is redundant.
Reimplemented from AView.
◆ consumesClick()
bool AViewContainerBase::consumesClick |
( |
const glm::ivec2 & | pos | ) |
|
|
overridevirtual |
◆ focusChainTarget()
_< AView > AViewContainerBase::focusChainTarget |
( |
| ) |
|
|
inline |
- Returns
- Focus chain target.
See mFocusChainTarget for further info.
◆ forceUpdateLayoutRecursively()
void AViewContainerBase::forceUpdateLayoutRecursively |
( |
| ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ getContentMinimumHeight()
int AViewContainerBase::getContentMinimumHeight |
( |
| ) |
|
|
overridevirtual |
◆ getContentMinimumWidth()
int AViewContainerBase::getContentMinimumWidth |
( |
| ) |
|
|
overridevirtual |
◆ getViewAt()
virtual _< AView > AViewContainerBase::getViewAt |
( |
glm::ivec2 | pos, |
|
|
ABitField< AViewLookupFlags > | flags = AViewLookupFlags::NONE ) const |
|
nodiscardvirtualnoexcept |
- Parameters
-
pos | position relative to this container |
flags | see AViewLookupFlags |
- Returns
- found view or nullptr
Some containers may implement getViewAt by it's own (i.e. AListView for performance reasons).
◆ getViewAtRecursive() [1/2]
_< AView > AViewContainerBase::getViewAtRecursive |
( |
glm::ivec2 | pos, |
|
|
ABitField< AViewLookupFlags > | flags = AViewLookupFlags::NONE ) const |
|
nodiscardnoexcept |
- Parameters
-
pos | position relative to this container |
flags | see AViewLookupFlags |
- Returns
- found view or nullptr
◆ getViewAtRecursive() [2/2]
bool AViewContainerBase::getViewAtRecursive |
( |
glm::ivec2 | pos, |
|
|
const Callback & | callback, |
|
|
ABitField< AViewLookupFlags > | flags = AViewLookupFlags::NONE ) |
|
inline |
- Parameters
-
pos | position relative to this container |
callback | callback to call |
flags | see AViewLookupFlags |
- Returns
- true if callback returned true; false otherwise
The passed callback is a predicate. If predicate returns true, the execution of lookup is stopped and getViewAt returns true. If predicate returns false, the lookup continues.
◆ getViewAtRecursiveOfType()
template<typename T>
_< T > AViewContainerBase::getViewAtRecursiveOfType |
( |
glm::ivec2 | pos, |
|
|
ABitField< AViewLookupFlags > | flags = AViewLookupFlags::NONE ) |
|
inline |
- Parameters
-
pos | position relative to this container |
flags | see AViewLookupFlags |
- Returns
- found view or nullptr
◆ invalidateAllStyles()
void AViewContainerBase::invalidateAllStyles |
( |
| ) |
|
|
overrideprotectedvirtual |
Unlike invalidateStateStyles(), completely resets styles for this view, causing it to iterate over all rules in global and parent stylesheets. This operation is much more expensive than invalidateStateStyles because invalidateStateStyles iterates over a small set of rules and performs fewer checks.
Prefer invalidateAllStyles over invalidateStateStyles when:
-
Added/removed rules to applicable stylesheets
-
The view is reinflated to other layout
-
Added/removed/changed ass names of this or parent views
Reimplemented from AView.
◆ invalidateAssHelper()
void AViewContainerBase::invalidateAssHelper |
( |
| ) |
|
|
overrideprotectedvirtual |
Reimplemented from AView.
◆ markMinContentSizeInvalid()
void AViewContainerBase::markMinContentSizeInvalid |
( |
| ) |
|
|
overridevirtual |
◆ markPixelDataInvalid()
void AViewContainerBase::markPixelDataInvalid |
( |
ARect< int > | invalidArea | ) |
|
|
overridevirtual |
- Parameters
-
invalidArea | area to invalidate. Must be in this view's coordinate space. |
Reimplemented from AView.
Reimplemented in AWindowBase.
◆ onCharEntered()
void AViewContainerBase::onCharEntered |
( |
char16_t | c | ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ onClickPrevented()
void AViewContainerBase::onClickPrevented |
( |
| ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ onDpiChanged()
void AViewContainerBase::onDpiChanged |
( |
| ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ onGesture()
bool AViewContainerBase::onGesture |
( |
const glm::ivec2 & | origin, |
|
|
const AGestureEvent & | event ) |
|
overridevirtual |
Handles touch screen gesture event.
- Parameters
-
origin | position where the event(s) started to occur from. |
event | gesture event. |
- Note
- The standard implementation
AView::onGesture
emulates desktop events such as right click and scroll.
- See also
- transformGestureEventsToDesktop
- Returns
- true, if consumed (handled). True value prevents click.
Reimplemented from AView.
Reimplemented in AWindowBase.
◆ onKeyDown()
void AViewContainerBase::onKeyDown |
( |
AInput::Key | key | ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ onKeyRepeat()
void AViewContainerBase::onKeyRepeat |
( |
AInput::Key | key | ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ onKeyUp()
void AViewContainerBase::onKeyUp |
( |
AInput::Key | key | ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ onMouseEnter()
void AViewContainerBase::onMouseEnter |
( |
| ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ onMouseLeave()
void AViewContainerBase::onMouseLeave |
( |
| ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ onPointerDoubleClicked()
Reimplemented from AView.
◆ onPointerMove()
void AViewContainerBase::onPointerMove |
( |
glm::vec2 | pos, |
|
|
const APointerMoveEvent & | event ) |
|
overridevirtual |
- Parameters
-
pos | event position |
event | event description |
- Note
- If the view is pressed, it would still received move events. Use AView::isMouseHover to check is the pointer actually over view or not. See AView::onPointerReleased for more info.
Reimplemented from AView.
Reimplemented in AWindow, and AWindowBase.
◆ onPointerPressed()
◆ onPointerReleased()
- Parameters
-
- Note
- To handle clicks, you should use AView::clicked signal instead. View still receives pointer move and released events even if cursor goes outside the view boundaries, or other exclusive event appeared (i.e. scrollarea scroll). AView::clicked emitted only if release event occurred inside view and no other event has prevented click gesture. See APointerReleasedEvent::triggerClick.
Reimplemented from AView.
Reimplemented in AWindowBase.
◆ onScroll()
void AViewContainerBase::onScroll |
( |
const AScrollEvent & | event | ) |
|
|
overridevirtual |
Handles mouse wheel events.
- Parameters
-
Reimplemented from AView.
Reimplemented in AWindowBase.
◆ onViewGraphSubtreeChanged()
void AViewContainerBase::onViewGraphSubtreeChanged |
( |
| ) |
|
|
overrideprotectedvirtual |
Called when a new direct or indirect parent was assigned or removed.
If a subtree reattached atomically (i.e., there were no dangling state), the method is called once.
The method is mostly intended to invalidate styles in order to respond to stylesheet rules (mExtraStylesheet) of the new (in)direct parent.
Emits viewGraphSubtreeChanged signal.
Reimplemented from AView.
◆ pointerEventsMapping()
- See also
- mPointerEventsMapping
◆ render()
- See also
- AView::drawView
AView::render is not guaranteed to be called on per-frame basis. Moreover, this method can be called multiple times if render-to-texture caching decides to do so.
Reimplemented from AView.
Reimplemented in AWindowBase.
◆ setContents()
void AViewContainerBase::setContents |
( |
const _< AViewContainer > & | container | ) |
|
|
protected |
◆ setEnabled()
void AViewContainerBase::setEnabled |
( |
bool | enabled = true | ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ setFocusChainTarget()
void AViewContainerBase::setFocusChainTarget |
( |
_weak< AView > | target | ) |
|
|
inline |
- Parameters
-
target | a new focus chain view belonging to this container |
See mFocusChainTarget for further info.
◆ setSize()
void AViewContainerBase::setSize |
( |
glm::ivec2 | size | ) |
|
|
overridevirtual |
Reimplemented from AView.
◆ visitsViewRecursive()
bool AViewContainerBase::visitsViewRecursive |
( |
Callback && | callback, |
|
|
ABitField< AViewLookupFlags > | flags = AViewLookupFlags::NONE ) |
|
inline |
- Parameters
-
callback | callback to call. Returns true to finish traversal. |
flags | see AViewLookupFlags |
- Returns
- true if there's at least one view for which callback returned true, false otherwise.