#include <wx/dcsvg.h>
Helper class for building a set of SVG and ARIA attributes to attach to an accessible group in the output of wxSVGFileDC.
ARIA (Accessible Rich Internet Applications) is a W3C specification of attributes that describe the content to assistive technology such as screen readers.
The class exposes a chainable builder API so multiple attributes can be specified inline. The resulting object is passed to wxSVGFileDC::BeginAccessibleGroup() or to the wxSVGAccessibleGroup RAII helper.
Example:
Public Member Functions | |
| wxSVGAttributes () | |
| Default constructor creates an empty set of attributes. | |
| wxSVGAttributes & | Role (const wxString &role) |
Sets the role attribute, which classifies the element for assistive technology. | |
| wxString | GetRole () const |
Returns the role attribute. | |
| wxSVGAttributes & | AriaLabel (const wxString &label) |
Sets the aria-label attribute: a short accessible name read aloud by screen readers. | |
| wxString | GetAriaLabel () const |
Returns the aria-label attribute. | |
| wxSVGAttributes & | AriaLabelledBy (const wxString &id) |
Sets the aria-labelledby attribute: instead of supplying a name inline, points at the id of another element whose text content provides the accessible name. | |
| wxString | GetAriaLabelledBy () const |
Returns the aria-labelledby attribute. | |
| wxSVGAttributes & | AriaDescribedBy (const wxString &id) |
Sets the aria-describedby attribute: points at the id of another element whose text content provides a longer description, announced after the accessible name. | |
| wxString | GetAriaDescribedBy () const |
Returns the aria-describedby attribute. | |
| wxSVGAttributes & | AriaHidden (bool hidden=true) |
Sets the aria-hidden attribute. | |
| bool | IsAriaHidden () const |
Returns true if the aria-hidden attribute is set to "true". | |
| wxSVGAttributes & | AriaDetails (const wxString &id) |
Sets the aria-details attribute: points at the id of another element containing extended information about this one (e.g., a data table describing a chart). | |
| wxString | GetAriaDetails () const |
Returns the aria-details attribute. | |
| wxSVGAttributes & | AriaRoleDescription (const wxString &desc) |
Sets the aria-roledescription attribute: a human-readable, optionally localized phrase that replaces the default spoken role (for example "pie chart" instead of "graphic"). | |
| wxString | GetAriaRoleDescription () const |
Returns the aria-roledescription attribute. | |
| wxSVGAttributes & | Id (const wxString &id) |
Sets the id attribute, giving the element a unique identifier other attributes (such as aria-labelledby) or stylesheets can reference. | |
| wxString | GetId () const |
Returns the id attribute. | |
| wxSVGAttributes & | Class (const wxString &classname) |
Sets the class attribute, used to associate the element with one or more CSS classes for styling the SVG output. | |
| wxString | GetClass () const |
Returns the class attribute. | |
| wxSVGAttributes & | Add (const wxString &name, const wxString &value) |
| Adds or updates an arbitrary attribute. | |
| wxString | GetAttribute (const wxString &name) const |
| Returns the value of the attribute with the given name. | |
| bool | IsEmpty () const |
| Returns true if no attributes have been set. | |
| wxSVGAttributes::wxSVGAttributes | ( | ) |
Default constructor creates an empty set of attributes.
| wxSVGAttributes & wxSVGAttributes::Add | ( | const wxString & | name, |
| const wxString & | value ) |
Adds or updates an arbitrary attribute.
If name is already set, its value is replaced; otherwise a new entry is appended.
| wxSVGAttributes & wxSVGAttributes::AriaDescribedBy | ( | const wxString & | id | ) |
Sets the aria-describedby attribute: points at the id of another element whose text content provides a longer description, announced after the accessible name.
| wxSVGAttributes & wxSVGAttributes::AriaDetails | ( | const wxString & | id | ) |
Sets the aria-details attribute: points at the id of another element containing extended information about this one (e.g., a data table describing a chart).
| wxSVGAttributes & wxSVGAttributes::AriaHidden | ( | bool | hidden = true | ) |
Sets the aria-hidden attribute.
The default hidden value of true is the common case (hide decorative content from assistive technology). Passing false is only meaningful when overriding an inherited aria-hidden="true" on an ancestor.
| wxSVGAttributes & wxSVGAttributes::AriaLabel | ( | const wxString & | label | ) |
Sets the aria-label attribute: a short accessible name read aloud by screen readers.
Use when no visible text label exists.
| wxSVGAttributes & wxSVGAttributes::AriaLabelledBy | ( | const wxString & | id | ) |
Sets the aria-labelledby attribute: instead of supplying a name inline, points at the id of another element whose text content provides the accessible name.
| wxSVGAttributes & wxSVGAttributes::AriaRoleDescription | ( | const wxString & | desc | ) |
Sets the aria-roledescription attribute: a human-readable, optionally localized phrase that replaces the default spoken role (for example "pie chart" instead of "graphic").
| wxSVGAttributes & wxSVGAttributes::Class | ( | const wxString & | classname | ) |
Sets the class attribute, used to associate the element with one or more CSS classes for styling the SVG output.
| wxString wxSVGAttributes::GetAriaDescribedBy | ( | ) | const |
Returns the aria-describedby attribute.
| wxString wxSVGAttributes::GetAriaDetails | ( | ) | const |
Returns the aria-details attribute.
| wxString wxSVGAttributes::GetAriaLabel | ( | ) | const |
Returns the aria-label attribute.
| wxString wxSVGAttributes::GetAriaLabelledBy | ( | ) | const |
Returns the aria-labelledby attribute.
| wxString wxSVGAttributes::GetAriaRoleDescription | ( | ) | const |
Returns the aria-roledescription attribute.
Returns the value of the attribute with the given name.
Returns an empty string if the attribute is not set.
| wxString wxSVGAttributes::GetClass | ( | ) | const |
Returns the class attribute.
| wxString wxSVGAttributes::GetId | ( | ) | const |
Returns the id attribute.
| wxString wxSVGAttributes::GetRole | ( | ) | const |
Returns the role attribute.
| wxSVGAttributes & wxSVGAttributes::Id | ( | const wxString & | id | ) |
Sets the id attribute, giving the element a unique identifier other attributes (such as aria-labelledby) or stylesheets can reference.
| bool wxSVGAttributes::IsAriaHidden | ( | ) | const |
Returns true if the aria-hidden attribute is set to "true".
| bool wxSVGAttributes::IsEmpty | ( | ) | const |
Returns true if no attributes have been set.
| wxSVGAttributes & wxSVGAttributes::Role | ( | const wxString & | role | ) |
Sets the role attribute, which classifies the element for assistive technology.
Common SVG values include "img" (the subtree is a single graphical image), "graphics-document", and "graphics-symbol".