Loading...
Searching...
No Matches
juce::AccessibilityValueInterface Class Referenceabstract

Detailed Description

An abstract interface representing the value of an accessibility element.

Values should be used when information needs to be conveyed which cannot be represented by the accessibility element's label alone. For example, a gain slider with the label "Gain" needs to also provide a value for its position whereas a "Save" button does not.

This class allows for full control over the value text/numeric conversion, ranged, and read-only properties but in most cases you'll want to use one of the derived classes below which handle some of this for you.

See also
AccessibilityTextValueInterface, AccessibilityNumericValueInterface, AccessibilityRangedNumericValueInterface
Inheritance diagram for juce::AccessibilityValueInterface:

Classes

class  AccessibleValueRange
 Represents the range of this value, if supported. More...

Public Member Functions

virtual ~AccessibilityValueInterface ()=default
 Destructor.
virtual bool isReadOnly () const =0
 Returns true if the value is read-only and cannot be modified by an accessibility client.
virtual double getCurrentValue () const =0
 Returns the current value as a double.
virtual String getCurrentValueAsString () const =0
 Returns the current value as a String.
virtual void setValue (double newValue)=0
 Sets the current value to a new double value.
virtual void setValueAsString (const String &newValue)=0
 Sets the current value to a new String value.
virtual AccessibleValueRange getRange () const =0
 If this is a ranged value, this should return a valid AccessibleValueRange object representing the supported numerical range.

Constructors and Destructors

◆ ~AccessibilityValueInterface()

virtual juce::AccessibilityValueInterface::~AccessibilityValueInterface ( )
virtualdefault

Destructor.

Member Functions

◆ isReadOnly()

virtual bool juce::AccessibilityValueInterface::isReadOnly ( ) const
pure virtual

Returns true if the value is read-only and cannot be modified by an accessibility client.

See also
setValue, setValueAsString

Implemented in juce::AccessibilityNumericValueInterface, juce::AccessibilityRangedNumericValueInterface, and juce::AccessibilityTextValueInterface.

◆ getCurrentValue()

virtual double juce::AccessibilityValueInterface::getCurrentValue ( ) const
pure virtual

◆ getCurrentValueAsString()

virtual String juce::AccessibilityValueInterface::getCurrentValueAsString ( ) const
pure virtual

◆ setValue()

virtual void juce::AccessibilityValueInterface::setValue ( double newValue)
pure virtual

◆ setValueAsString()

virtual void juce::AccessibilityValueInterface::setValueAsString ( const String & newValue)
pure virtual

◆ getRange()

virtual AccessibleValueRange juce::AccessibilityValueInterface::getRange ( ) const
pure virtual

If this is a ranged value, this should return a valid AccessibleValueRange object representing the supported numerical range.

Implemented in juce::AccessibilityNumericValueInterface, juce::AccessibilityRangedNumericValueInterface, and juce::AccessibilityTextValueInterface.

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram