Class · aurore
aurore::View
On this page
#include <aurore/core/view.hpp>
class aurore::ViewDerived by
Description
Superclass for all the other views Lifecycle of a view is : new -> [willAppear -> willDisappear] -> delete
Users have do to the new, the rest of the lifecycle is taken care of by the library
willAppear and willDisappear can be called zero or multiple times before deletion (in case of a TabLayout for instance)
Types 1
Constructors 2
Functions 221
Draws the view (its background, content and highlight) scaled around its centre, without laying anything out again: a pressed or focused view grown or shrunk a little. Touch hit-testing keeps the unscaled frame. XML: scale="1.05".
view.hpp:415void setBackground(ViewBackground background) How the view's background is drawn: none, the sidebar's, the backdrop, a plain colour or a gradient.
view.hpp:433void setBackgroundLinearGradient( NVGcolor start,NVGcolor end,ViewBackground direction = ViewBackground::VERTICAL_LINEAR)Sets a linear gradient background for the view, from start to end: top to bottom (VERTICAL_LINEAR) or left to right (HORIZONTAL_LINEAR).
view.hpp:439void shakeHighlight(FocusDirection direction) Shakes the focus highlight towards direction: there is nothing to go to there.
Rect getFrame() The view's position and size on the screen, after layout (getX(), getY(), getWidth(), getHeight()).
view.hpp:445The position on the screen, in layout units: the parents' positions and translations added.
view.hpp:447Rect getLocalFrame() The position and size in the parent, as laid out by Yoga.
view.hpp:451The size as laid out by Yoga; the height without the collapse when includeCollapse is false.
Triggers a layout of the whole view tree. Must be called after a yoga node property is changed.
Only methods that change yoga nodes properties should call this method.
view.hpp:466Called when a layout pass ends on that view.
view.hpp:471virtual View * getView(std::string id) Returns the view with the corresponding id in the view or its children, or nullptr if it hasn't been found.
Research is done recursively by traversing the tree starting from this view. This view's parents are not traversed.
view.hpp:480Sets the preferred width of the view. Use aurore::View::AUTO to have the layout automatically resize the view.
If set to anything else than AUTO, the view is guaranteed to never shrink below the given width.
view.hpp:493Sets the preferred height of the view. Use aurore::View::AUTO to have the layout automatically resize the view.
If set to anything else than AUTO, the view is guaranteed to never shrink below the given height.
view.hpp:502void setSize(Size size) Sets the preferred width and height of the view. Use aurore::View::AUTO to have the layout automatically resize the view.
If set to anything else than AUTO, the view is guaranteed to never shrink below the given height.
view.hpp:511Shortcut to setWidth + setHeight.
Only does one layout pass instead of two when using the two methods separately.
view.hpp:518Sets the preferred width of the view in percentage of the parent view width. Between 0.0f and 100.0f.
view.hpp:524Sets the preferred height of the view in percentage of the parent view height. Between 0.0f and 100.0f.
view.hpp:530Sets the minimum width of the view, in pixels.
This constraint is stronger than the grow factor: the view is guaranteed to never be less than the given min width.
Use View::AUTO to disable the min width constraint.
view.hpp:540Sets the minimum height of the view, in pixels.
This constraint is stronger than the grow factor: the view is guaranteed to never be less than the given max height.
Use View::AUTO to disable the min height constraint.
view.hpp:550Sets the minimum width of the view, in parent width percentage.
This constraint is stronger than the grow factor: the view is guaranteed to never be less than the given max width.
Use View::AUTO to disable the min width constraint.
view.hpp:560Sets the minimum height of the view, in parent height percentage.
This constraint is stronger than the grow factor: the view is guaranteed to never be less than the given max height.
Use View::AUTO to disable the min height constraint.
view.hpp:570Sets the maximum width of the view, in pixels.
This constraint is stronger than the grow factor: the view is guaranteed to never be larger than the given max width.
Use View::AUTO to disable the max width constraint.
view.hpp:580Sets the maximum height of the view, in pixels.
This constraint is stronger than the grow factor: the view is guaranteed to never be larger than the given max height.
Use View::AUTO to disable the max height constraint.
view.hpp:590Sets the maximum width of the view, in parent width percentage.
This constraint is stronger than the grow factor: the view is guaranteed to never be larger than the given max width.
Use View::AUTO to disable the max width constraint.
view.hpp:600Sets the maximum height of the view, in parent height percentage.
This constraint is stronger than the grow factor: the view is guaranteed to never be larger than the given max height.
Use View::AUTO to disable the max height constraint.
view.hpp:610Sets the grow factor of the view, aka the percentage of remaining space to give this view, in the containing box axis. Opposite of shrink. Default is 0.0f;
view.hpp:618Sets the shrink factor of the view, aka the percentage of space the view is allowed to shrink for if there is not enough space for everyone in the contaning box axis. Opposite of grow. Default is 1.0f;
view.hpp:626Sets the margin of the view, aka the space that separates this view and the surrounding ones in all 4 directions.
Use aurore::View::AUTO to have the layout automatically select the margin.
Only works with views that have parents - top level views that are pushed on the stack don't have parents.
Only does one layout pass instead of four when using the four methods separately.
view.hpp:640Sets the top margin of the view, aka the space that separates this view and the surrounding ones.
Only works with views that have parents - top level views that are pushed on the stack don't have parents.
Use aurore::View::AUTO to have the layout automatically select the margin.
view.hpp:652Sets the right margin of the view, aka the space that separates this view and the surrounding ones.
Only works with views that have parents - top level views that are pushed on the stack don't have parents.
Use aurore::View::AUTO to have the layout automatically select the margin.
view.hpp:664Sets the bottom margin of the view, aka the space that separates this view and the surrounding ones.
Only works with views that have parents - top level views that are pushed on the stack don't have parents.
Use aurore::View::AUTO to have the layout automatically select the margin.
view.hpp:679Sets the right margin of the view, aka the space that separates this view and the surrounding ones.
Only works with views that have parents - top level views that are pushed on the stack don't have parents.
Use aurore::View::AUTO to have the layout automatically select the margin.
view.hpp:691void setVisibility(Visibility visibility) Sets the visibility of the view.
view.hpp:696Visibility getVisibility() Gets the visibility of the view.
view.hpp:701Sets the top position of the view, in pixels.
The behavior of this attribute changes depending on the position type of the view.
If relative, it will simply offset the view by the given amount.
If absolute, it will behave like the "display: absolute;" CSS property and move the view freely in its parent. Use 0 to snap to the parent top edge. Absolute positioning ignores padding.
Use View::AUTO to disable (not the same as 0).
view.hpp:717Sets the right position of the view, in pixels.
The behavior of this attribute changes depending on the position type of the view.
If relative, it will simply offset the view by the given amount.
If absolute, it will behave like the "display: absolute;" CSS property and move the view freely in its parent. Use 0 to snap to the parent right edge. Absolute positioning ignores padding.
Use View::AUTO to disable (not the same as 0).
view.hpp:733Sets the bottom position of the view, in pixels.
The behavior of this attribute changes depending on the position type of the view.
If relative, it will simply offset the view by the given amount.
If absolute, it will behave like the "display: absolute;" CSS property and move the view freely in its parent. Use 0 to snap to the parent bottom edge. Absolute positioning ignores padding.
Use View::AUTO to disable (not the same as 0).
view.hpp:749Sets the left position of the view, in pixels.
The behavior of this attribute changes depending on the position type of the view.
If relative, it will simply offset the view by the given amount.
If absolute, it will behave like the "display: absolute;" CSS property and move the view freely in its parent. Use 0 to snap to the parent left edge. Absolute positioning ignores padding.
Use View::AUTO to disable (not the same as 0).
view.hpp:765Sets the top position of the view, in percents.
The behavior of this attribute changes depending on the position type of the view.
view.hpp:773Sets the right position of the view, in percents.
The behavior of this attribute changes depending on the position type of the view.
view.hpp:781Sets the bottom position of the view, in percentage.
The behavior of this attribute changes depending on the position type of the view.
view.hpp:789Sets the left position of the view, in percents.
The behavior of this attribute changes depending on the position type of the view.
view.hpp:797void setPositionType(PositionType type) Sets the "position type" of the view, aka the behavior of the 4 position attributes.
Default is RELATIVE.
view.hpp:805Sets the id of the view.
view.hpp:810The view's id (setId, or the XML's id attribute), "" for none.
view.hpp:815void setAlignSelf(AlignSelf align) void setBoxSizing(BoxSizing sizing) Sets the line color for the view. To be used with setLineTop(), setLineRight()...
The "line" is separate from the shape "border".
view.hpp:844Sets the top line thickness. Use setLineColor() to change the line color.
The "line" is separate from the shape "border".
view.hpp:857Sets the right line thickness. Use setLineColor() to change the line color.
The "line" is separate from the shape "border".
view.hpp:868Sets the bottom line thickness. Use setLineColor() to change the line color.
The "line" is separate from the shape "border".
view.hpp:879Sets the left line thickness. Use setLineColor() to change the line color.
The "line" is separate from the shape "border".
view.hpp:890Sets the view shape background color.
view.hpp:898Sets the view shape border color.
view.hpp:909Sets the view shape border thickness.
view.hpp:923Sets the view shape corner radius (uniform). 0 means no rounded corners.
view.hpp:939Sets the view shape corner radii individually. Order: top-left, top-right, bottom-right, bottom-left.
view.hpp:954void setThemeArea(ThemeArea area) The area of the theme's decorations this view is (docs/themes.md, Decorations): HEADER, SIDEBAR or DIALOG. Its picture (backdrop.header, .sidebar, .dialog) is drawn over the view's background, under its content, in its corners. A DIALOG in a translucent colour over a theme's background image has that image drawn under it first, dimmed by aurore/backdrop, so that it does not show the screen behind it. A HEADER is drawn across the whole width of its parent (an AppletFrame), when that parent is a screen's (not in a dialog). NONE by default; the core's header, sidebar, dialogs and dropdowns are set.
view.hpp:979void setShadowType(ShadowType type) Sets the view shape shadow type. Default is NONE.
view.hpp:986Sets the shadow visibility.
view.hpp:994If set to true, the highlight background will be hidden for this view (the white rectangle that goes behind the view, replacing the usual background shape).
view.hpp:1003If set to true, the highlight border will be hidden for this view.
view.hpp:1011If set to true, the highlight will be hidden for this view.
view.hpp:1019No click animation when the view is clicked.
view.hpp:1025Sets the highlight padding of the view, aka the space between the highlight rectangle and the view. The highlight rect is enlarged, the view is untouched.
view.hpp:1034Sets the highlight rectangle corner radius.
view.hpp:1042virtual View * getNearestView(std::string id) Returns the "nearest" view with the corresponding id, or nullptr if none has been found. "Nearest" means the closest in the vicinity of this view. The siblings are searched as well as its children.
Research is done by traversing the tree upwards, starting from this view. The current algorithm is very inefficient.
view.hpp:1057Handles a child XML element.
You can redefine this method to handle child XML like as you want in your own views.
If left unimplemented, will throw an exception because raw views cannot handle child XML elements (Boxes can).
view.hpp:1115Applies the attributes of the given XML element to the view.
You can add your own attributes to by calling registerXMLAttribute() in the view constructor.
view.hpp:1123Applies the given attribute to the view.
You can add your own attributes to by calling registerXMLAttribute() in the view constructor.
view.hpp:1131void registerAutoXMLAttribute( std::string name,AutoAttributeHandler handler)Register a new XML attribute with the given name and handler method. You can have multiple attributes registered with the same name but different types / handlers, except if the type is string.
The method will be called if the attribute has the value "auto".
view.hpp:1140void registerPercentageXMLAttribute( std::string name,FloatAttributeHandler handler)Register a new XML attribute with the given name and handler method. You can have multiple attributes registered with the same name but different types / handlers, except if the type is string.
The method will be called if the attribute has a percentage value (an integer with "%" suffix). The given float value is guaranteed to be between 0.0f and 1.0f.
view.hpp:1150void registerFloatXMLAttribute( std::string name,FloatAttributeHandler handler)Register a new XML attribute with the given name and handler method. You can have multiple attributes registered with the same name but different types / handlers, except if the type is string.
The method will be called if the attribute has an integer, float, @style or "px" value.
void registerStringXMLAttribute( std::string name,StringAttributeHandler handler)Register a new XML attribute with the given name and handler method. You can have multiple attributes registered with the same name but different types / handlers, except if the type is string.
The method will be called if the attribute has a string or @i18n value.
If you use string as a type, you can only have one handler for the attribute.
view.hpp:1170void registerColorXMLAttribute( std::string name,ColorAttributeHandler handler)Register a new XML attribute with the given name and handler method. You can have multiple attributes registered with the same name but different types / handlers, except if the type is string.
The method will be called if the attribute has a color value ("#XXXXXX" or "#XXXXXXXX") or a @theme value.
void registerBoolXMLAttribute( std::string name,BoolAttributeHandler handler)Register a new XML attribute with the given name and handler method. You can have multiple attributes registered with the same name but different types / handlers, except if the type is string.
The method will be called if the attribute has a boolean value ("true" or "false").
view.hpp:1189void registerFilePathXMLAttribute( std::string name,FilePathAttributeHandler handler)Register a new XML attribute with the given name and handler method. You can have multiple attributes registered with the same name but different types / handlers, except if the type is string.
The method will be called if the attribute has a file path value ("@res/" or raw path).
view.hpp:1198Returns if the given XML attribute name is valid for that view.
view.hpp:1215Sets the maximum number of allowed children XML elements when using a view of that class in an XML file.
view.hpp:1265If set to true, will force the view to be translucent.
view.hpp:1272Sets the view to be focusable.
Required to be able to use actions that need focus on that view (such as an A press).
view.hpp:1280Whether the view takes the focus: focusable, and visible.
view.hpp:1286Removes view from it's parent
view.hpp:1291void setFocusSound(enum Sound sound) Sets the sound to play when this view gets focused.
view.hpp:1296Sets the detached flag to true. This action is irreversible.
A detached view will, as the name suggests, not be attached to their parent Yoga node. That means that invalidation and layout need to be taken care of manually by the parent.
detach() must be called before adding the view to the parent.
view.hpp:1313Sets the position of the view, if detached.
view.hpp:1321Sets the position X of the view, if detached.
view.hpp:1326Sets the position Y of the view, if detached.
view.hpp:1331Point getDetachedPosition() const Gets detached position of the view.
view.hpp:1336void setParent(Box *parent, void *parentUserdata = nullptr) The box this view is in (Box::addView sets it; parentUserdata is the box's own).
ActionIterator getAction(ActionIdentifier identifier) The action registered under identifier, or getActions().end().
template <class ButtonType, class ActionType>ActionIdentifier registerAction( const std::string &hintText,ButtonType button,const ActionListener &actionListener,bool hidden = false,bool allowRepeating = false,enum Sound sound = SOUND_NONE)Registers an action with the given parameters. The listener will be fired when the user presses the key when the view is focused.
The listener should return true if the action was consumed, false otherwise. The sound will only be played if the listener returned true.
A hidden action will not show up in the bottom-right hints.
Returns the identifier for the action, so it can be unregistered later on. Returns ACTION_NONE if the action was not registered.
view.hpp:1369ActionIdentifier registerAction( const std::string &hintText,ControllerButton button,const ActionListener &actionListener,bool hidden = false,bool allowRepeating = false,enum Sound sound = SOUND_NONE)The same, on a controller button.
view.hpp:1372ActionIdentifier registerAction( AuroreKeyCombination key,const ActionListener &actionListener,bool allowRepeating = false)An action on a keyboard key (a combination with modifiers): no hint, no sound.
view.hpp:1375void unregisterAction(ActionIdentifier identifier) Unregisters an action with the given identifier.
view.hpp:1382void registerClickAction(const ActionListener &actionListener) Shortcut to register a generic "A OK" click action.
view.hpp:1387void updateActionHint( enum ControllerButton button,const std::string &hintText)Changes the hint of the action on button.
void setActionAvailable(enum ControllerButton button, bool available) Turns the action on button on or off (an action off runs nothing and shows no hint).
The same for every action of the view.
view.hpp:1394void setActionHidden(enum ControllerButton button, bool hidden) Shows or hides the hint of the action on button (the action still works), as registerAction's hidden but while the view lives.
Plays the click animation (the flash over the view).
view.hpp:1404The view's class name ("Label", "Box"…).
view.hpp:1407The class name and the id, for logs: Label (id="title").
The view's Yoga node.
view.hpp:1413const std::vector< std::shared_ptr< Action > > & getActions() The actions registered on the view.
view.hpp:1416const std::vector< GestureRecognizer * > & getGestureRecognizers() Get the vector of all gesture recognizers attached to that view.
view.hpp:1421Interrupt every recognizer on this view. If onlyIfUnsureState == true, only recognizers with current state UNSURE will be interupted
view.hpp:1428void addGestureRecognizer(GestureRecognizer *recognizer) Add new gesture recognizer on this view.
view.hpp:1433bool removeGestureRecognizer(GestureRecognizer *recognizer) Removes a recognizer added with addGestureRecognizer and deletes it (false if the view did not have it). Not from one of its own callbacks: the gesture being handled still uses it.
view.hpp:1440Sound gestureRecognizerRequest( TouchState touch,MouseState mouse,View *firstResponder)Called each frame when touch is registered.
- Returns
sound to play invoked by touch recognizers.
virtual void frame(FrameContext *ctx) Called each frame Do not override it to draw your view, override draw() instead
view.hpp:1454void frameHighlight(FrameContext *ctx) Called each frame
view.hpp:1459virtual void draw( NVGcontext *vg,float x,float y,float width,float height,Style style,FrameContext *ctx) =0Called by frame() to draw the view onscreen. Views should not draw outside of their bounds (they may be clipped if they do so).
view.hpp:1466Called when the view will appear on screen, before or after layout().
Can be called if the view has already appeared, so be careful.
view.hpp:1475Called when the view will disappear from the screen.
Can be called if the view has already disappeared, so be careful.
view.hpp:1487Called when the show() animation (fade in) ends
view.hpp:1496Shows the view with a fade in animation.
view.hpp:1501Shows the view with a fade in animation, or no animation at all.
view.hpp:1506virtual float getShowAnimationDuration(TransitionAnimation animation) Returns the duration of the view show / hide animation.
view.hpp:1511Hides the view in a collapse animation
view.hpp:1516Whether collapse() hid the view.
view.hpp:1519The view's opacity, 0 to 1 (a transition when its style has one).
view.hpp:1522Shows the view in a expand animation (opposite of collapse)
view.hpp:1528Hides the view with a fade out animation.
view.hpp:1533Hides the view with a fade out animation, or no animation at all.
view.hpp:1538Whether hide() hid the view.
view.hpp:1541Is this view translucent?
If you override it please return
|| View::isTranslucent() to keep the fadeIn transition
view.hpp:1550Whether the view has the focus.
view.hpp:1553virtual View * getDefaultFocus() Returns the default view to focus when focusing this view Typically the view itself or one of its children.
Returning nullptr means that the view is not focusable (and neither are its children)
By default, a view is focusable if the flag is set to true with setFocusable() and if the view is visible.
When pressing a key, the flow is :
- starting from the currently focused view's parent, traverse the tree upwards and repeatedly call getNextFocus() on every view until we find a next view to focus or meet the end of the tree
- if a view is found, getNextFocus() will internally call getDefaultFocus() for the selected child
- give focus to the result, if it exists
Returns the view to focus with the corresponding screen coordinates in the view or its children, or nullptr if it hasn't been found.
Research is done recursively by traversing the tree starting from this view. This view's parents are not traversed.
view.hpp:1580virtual View * getNextFocus( FocusDirection direction,View *currentView)Returns the next view to focus given the requested direction and the currently focused view (as parent user data)
Returning nullptr means that there is no next view to focus in that direction - getNextFocus will then be called on our parent if any
view.hpp:1590Fired when focus is gained.
view.hpp:1615Fired when focus is lost.
view.hpp:1620virtual void onParentFocusGained(View *focusedView) Fired when focus is gained on this view's parent, or the parent of the parent...
view.hpp:1625virtual void onParentFocusLost(View *focusedView) Fired when focus is lost on one of this view's parents. Works similarly to onParentFocusGained().
view.hpp:1631Fired when the window size changes, after updating layout.
view.hpp:1637GenericEvent * getFocusEvent() Fired with the view when it gains the focus.
view.hpp:1643GenericEvent * getFocusLostEvent() Fired with the view when it loses the focus.
view.hpp:1645The opacity drawn: the view's alpha times its parents'.
view.hpp:1650void overrideTheme(Theme *newTheme) Forces this view and its children to use the specified theme.
view.hpp:1658Enables / disable culling for that view.
To disable culling for all child views of a Box use setCullingEnabled on the box.
view.hpp:1666The width over the height, kept by the layout (values <= 0 are ignored).
view.hpp:1677Sets the background corner radii of the view. Only for vertical linear style.
view.hpp:1684Sets the Y translation of this view.
Translation is applied after the layout phase. Use relative position and setPosition methods if possible instead.
view.hpp:1695Sets the X translation of this view.
Translation is applied after the layout phase. Use relative position and setPosition methods if possible instead.
view.hpp:1703Wireframe mode allows you to see the view size and margins (and padding if applicable) directly in your app.
Useful to diagnose views misplacements or display bugs.
view.hpp:1711Whether the children are clipped to the view's frame when drawn.
view.hpp:1737virtual AppletFrame * getAppletFrame() The AppletFrame the view is in, or nullptr.
view.hpp:1748void present(View *view) Pushes view as the content of the view's AppletFrame (a page inside the frame).
Pops the AppletFrame's content back to the one before, then runs cb.
A token that expires when this view is deleted. A task that comes back to the view from another thread captures it by value and checks it on the UI thread, before it touches the view:
aurore::async([this, alive = aliveToken()] { auto result = work(); // not this: the view may be gone aurore::sync([this, alive, result] { if (alive.expired()) return; ... }); });
Checked on another thread it only says the view was alive then.
view.hpp:1771Keeps the view from being deleted by the deletion pool while a pointer to it is in use (counted: one ptrUnlock() per ptrLock()).
view.hpp:1774Whether a ptrLock() holds the view.
view.hpp:1777Deletes the view at the end of the frame (Application::addToFreeQueue).
view.hpp:1779Activity * getParentActivity() The activity the view is in, through its parents; nullptr when none.
view.hpp:1782bool setStateStyle( StyleState state,const std::string &property,const std::string &value)While state is on, the style property property takes value (as XML writes it: "#rrggbb", "rgba(…)", "@theme/…", "4", "@style/…"), and goes back to what it was when no state styles it any more. XML: focus:backgroundColor="@theme/aurore/accent", pressed:scale="0.96", disabled:alpha="0.4", hover:borderColor="#ffffff". A "@theme/" value is read when the state comes on, so it follows the theme. Returns false for a property the view does not have.
void setStyleState(StyleState state, bool on) Turns a style state on or off. FOCUS, PRESSED and HOVER follow the focus, the click animation and the mouse by themselves; DISABLED is the app's (a Button sets it from its ButtonState).
view.hpp:1806Animates the changes of style properties instead of applying them at once, the state styles' as well as the setters' (setBackgroundColor…): "backgroundColor 150ms ease-out, scale 120ms" or "all 200ms". The easing is linear, ease, ease-in, ease-out, ease-in-out, or one of tweeny's (quadraticOut, backOut…). Skipped while the app asks for reduced motion (Application::getReduceMotion). An empty spec removes them. XML: transition="…". Returns false (and changes nothing) for a spec it cannot read.
view.hpp:1819virtual bool getStyleProperty( const std::string &name,StyleValue *value)The style properties the states and transitions work on, by name: backgroundColor, borderColor, lineColor (colours), borderThickness, cornerRadius, alpha, scale (numbers); a Label adds textColor, a Rectangle color, a Button textColor. Only properties that are drawn, never laid out. A subclass adds its own by overriding both and calling the base for the others.
view.hpp:1829void keepSubscription(Subscription &&subscription) Keeps subscription (an Observable's) as long as the view lives: what binds a view to an Observable ends with the view.
Binds a property of the view to an observable of the data models (Application::registerModel, Activity::registerModel): "text: profile.name, visible: profile.online". Properties: text (a string, int or float observable; views that have a text: Label, Button, cells), visible (bool: VISIBLE or GONE), and every style property (float or NVGcolor). Returns false for a spec it cannot read; a model not registered yet is looked up again when the view joins an activity. XML: bind="…".
view.hpp:1848Sets the view's text, for bind="text: …"; false when it has none.
view.hpp:1853void setAccessibilityRole(AccessibilityRole role) What the view is and what it says, for the focus announcer (Application::setFocusAnnouncer). By default a Label says its text, a Button and the cells their title, a focusable Box the texts shown in it. XML: accessibilityRole="button", accessibilityLabel="@i18n/…".
view.hpp:1861AccessibilityRole getAccessibilityRole() What the view is set to, said after its role: a cell's detail, "on" or "off" for a BooleanCell, "40%" for a slider. XML: accessibilityValue="…".
view.hpp:1872The chosen one of its kind (a picker's current row, a checked radio cell): "selected" is said after its value.
view.hpp:1879Where the view is among the rows it belongs to, from 1, said as "3 of 10": a recycler's cell its row in its section, a cell, a button or a tab among the focusable views of its parent. False when that says nothing (a view alone, a label).
view.hpp:1888What is announced when the view takes the focus: its label, then its role, its value and state in the app's language and its place ("Wi-Fi, switch, on, 2 of 5"; "Save, button, disabled").
view.hpp:1895The texts shown in the view, for a label made of them: its own label for a view with no children, else the labels of the views under it (a focusable one left out: it speaks for itself), joined by ", ". Nothing for a hidden view.
view.hpp:1903Says the view's value and state again (Application::announce) when it has the focus and the user pressed or touched something in the last 2 s (not a value changing on its own): called by the views whose value changes in place (a toggle flipped, a slider moved, a detail changed).
view.hpp:1911void resolveBindings(Activity *activity = nullptr) Resolves the bindings left pending in this view and its children against activity's models (its own activity's when nullptr), then the application's. Called when a tree joins an activity.
Called on every view of the screens when the text scale changes (Application::setTextScale): a view that measures text marks itself dirty here.
view.hpp:1925Draws the style property property (backgroundColor, textColor…, see getStyleProperty) in the theme colour key ("aurore/text"), now and again each time the theme changes (a theme file, the light or dark variant). XML does it for every "@theme/…" colour. A colour the app sets on the property afterwards (setTextColor…) replaces the key. An empty key only forgets the property's key (the colour stays). Returns false for a property the view does not have or an unknown key.
The key setThemeColor gave property, "" when it has none.
Called on every view of the screens when the theme changes (Application::getThemeChangedEvent): the colours given by key (setThemeColor) take their new values, the state styles read their "@theme/" values again. A view that keeps other colours of its own looks them up again here, then calls the base. A Box goes on to its children.
view.hpp:1951Static functions 14
Whether the highlight's border glides from the view that had the focus to the next one (140 ms), rather than jumping. On by default.
view.hpp:407static View * createFromXMLString(std::string_view xml) Creates a view from the given XML file content.
The method handleXMLElement() is executed for each child node in the XML.
Uses the internal lookup table to instantiate the views. Use registerXMLView() to add your own views to the table so that you can use them in your own XML files.
view.hpp:1068static View * createFromXMLElement(tinyxml2::XMLElement *element) Creates a view from the given XML element (node and attributes).
Elements nest at most 64 levels deep, the files aurore:View includes counted (a file including itself is an error, not a stack overflow).
The method handleXMLElement() is executed for each child node in the XML.
Uses the internal lookup table to instantiate the views. Use registerXMLView() to add your own views to the table so that you can use them in your own XML files.
view.hpp:1082static View * createFromXMLFile(std::string path) Creates a view from the given XML file path.
The method handleXMLElement() is executed for each child node in the XML.
Uses the internal lookup table to instantiate the views. Use registerXMLView() to add your own views to the table so that you can use them in your own XML files.
view.hpp:1093static View * createFromXMLResource(std::string name) Creates a view from the given XML resource file name.
The method handleXMLElement() is executed for each child node in the XML.
Uses the internal lookup table to instantiate the views. Use registerXMLView() to add your own views to the table so that you can use them in your own XML files.
view.hpp:1104Get the XML document for the XML file, creating a new one if none is cached.
view.hpp:1203Drops the cached document of an XML file, which is then read again (hot reload). The document stays in memory: views made from it may still point into it.
view.hpp:1210Describes the document's parse error for a fatal message: where it comes from (the path, or the resource being loaded), the line and tinyxml2's own text.
view.hpp:1222Where an element is: "file:line" (the path or the resource it was loaded from), "line N" for an XML string.
view.hpp:1234fatal() for an XML error, the message prefixed with where the element being read is ("file:line: <tag>: ").
view.hpp:1240The known name closest to name (a typo's), or "" when none is close.
template <typename T>static std::string listXMLValues( const std::unordered_map< std::string, T > &values)An enumeration's values, sorted, for an error message.
view.hpp:1249Resolves the value of the given XML attribute string. Applies i18n if the value is an "@i18n/" string, returns the string as it is otherwise.
view.hpp:1720Resolves the value of the given XML attribute file path. Returns the full path of the resource if it starts with "@res/", returns the path as it is otherwise. A resource path with ".." is refused: "".
view.hpp:1727Attributes 1
Static attributes 3
A size or position left to the layout (auto in XML).
A folder whose xml/ files replace the built-in ones of the same name in createFromXMLResource(); one that cannot be read is logged, and the built-in one used.
view.hpp:427The XML resource being loaded, named in the parse errors of a document given as a string.
view.hpp:1228Protected functions 13
Helper functions to apply this view's alpha to a color.
view.hpp:368Should the hint alpha be animated when pushing the view?
view.hpp:397virtual AccessibilityRole getDefaultAccessibilityRole() The view's own role and label when the app gave none.
view.hpp:1957bool transitionStyle(const char *name, const StyleValue &to) Called by a style property's setter before it changes the value: true when a transition takes the change over (the setter then returns without changing anything). Cheap for a view with no transition.
view.hpp:1967Protected attributes 8
Read from Aurore's headers by Doxygen at each build · library/include