JUCE: AccessibilityValueInterface Class Reference

JUCE

Classes | Public Member Functions | List of all members
AccessibilityValueInterface Class Referenceabstract
juce_gui_basics » accessibility

An abstract interface representing the value of an accessibility element. More...

`#include <juce_AccessibilityValueInterface.h>`

Inheritance diagram for AccessibilityValueInterface:

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

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

## 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

## Constructor & Destructor Documentation

## ◆ ~AccessibilityValueInterface()

virtual AccessibilityValueInterface::~AccessibilityValueInterface | ( |  | ) |
| virtualdefault

Destructor.

## Member Function Documentation

## ◆ isReadOnly()

virtual bool 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 AccessibilityTextValueInterface, AccessibilityNumericValueInterface, and AccessibilityRangedNumericValueInterface.

## ◆ getCurrentValue()

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

Returns the current value as a double.

Implemented in AccessibilityTextValueInterface, AccessibilityNumericValueInterface, and AccessibilityRangedNumericValueInterface.

## ◆ getCurrentValueAsString()

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

Returns the current value as a String.

Implemented in AccessibilityNumericValueInterface, AccessibilityRangedNumericValueInterface, and AccessibilityTextValueInterface.

## ◆ setValue()

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

Sets the current value to a new double value.

Implemented in AccessibilityTextValueInterface, AccessibilityNumericValueInterface, and AccessibilityRangedNumericValueInterface.

## ◆ setValueAsString()

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

Sets the current value to a new String value.

Implemented in AccessibilityNumericValueInterface, AccessibilityRangedNumericValueInterface, and AccessibilityTextValueInterface.

## ◆ getRange()

virtual AccessibleValueRange 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 AccessibilityTextValueInterface, AccessibilityNumericValueInterface, and AccessibilityRangedNumericValueInterface.

The documentation for this class was generated from the following file:

- juce_AccessibilityValueInterface.h