Interface

AtkValue

Description [src]

interface Atk.Value : GObject.Object

The ATK interface implemented by valuators and components which display or select a value from a bounded range of values.

AtkValue should be implemented for components which either display a value from a bounded range, or which allow the user to specify a value from a bounded range, or both. For instance, most sliders and range controls, as well as dials, should have AtkObject representations which implement AtkValue on the component’s behalf. AtKValues may be read-only, in which case attempts to alter the value return would fail.

On the subject of current value text In addition to providing the current value, implementors can optionally provide an end-user-consumable textual description associated with this value. This description should be included when the numeric value fails to convey the full, on-screen representation seen by users.

Password strength A password strength meter whose value changes as the user types their new password. Red is used for values less than 4.0, yellow for values between 4.0 and 7.0, and green for values greater than 7.0. In this instance, value text should be provided by the implementor. Appropriate value text would be “weak”, “acceptable,” and “strong” respectively.

A level bar whose value changes to reflect the battery charge. The color remains the same regardless of the charge and there is no on-screen text reflecting the fullness of the battery. In this case, because the position within the bar is the only indication the user has of the current charge, value text should not be provided by the implementor.

Implementor Notes Implementors should bear in mind that assistive technologies will likely prefer the value text provided over the numeric value when presenting a widget’s value. As a result, strings not intended for end users should not be exposed in the value text, and strings which are exposed should be localized. In the case of widgets which display value text on screen, for instance through a separate label in close proximity to the value-displaying widget, it is still expected that implementors will expose the value text using the above API.

AtkValue should NOT be implemented for widgets whose displayed value is not reflective of a meaningful amount. For instance, a progress pulse indicator whose value alternates between 0.0 and 1.0 to indicate that some process is still taking place should not implement AtkValue because the current value does not reflect progress towards completion.

On the subject of ranges In addition to providing the minimum and maximum values, implementors can optionally provide details about subranges associated with the widget. These details should be provided by the implementor when both of the following are communicated visually to the end user: The existence of distinct ranges such as “weak”, “acceptable”, and “strong” indicated by color, bar tick marks, and/or on-screen text. Where the current value stands within a given subrange, for instance illustrating progression from very “weak” towards nearly “acceptable” through changes in shade and/or position on the bar within the “weak” subrange. If both of the above do not apply to the widget, it should be sufficient to expose the numeric value, along with the value text if appropriate, to make the widget accessible.

Implementor Notes If providing subrange details is deemed necessary, all possible values of the widget are expected to fall within one of the subranges defined by the implementor.

On the subject of localization of end-user-consumable text values Because value text and subrange descriptors are human-consumable, implementors are expected to provide localized strings which can be directly presented to end users via their assistive technology. In order to simplify this for implementors, implementors can use atk_value_type_get_localized_name() with the following already-localized constants for commonly-needed values can be used:

ATK_VALUE_VERY_WEAK ATK_VALUE_WEAK ATK_VALUE_ACCEPTABLE ATK_VALUE_STRONG ATK_VALUE_VERY_STRONG ATK_VALUE_VERY_LOW ATK_VALUE_LOW ATK_VALUE_MEDIUM ATK_VALUE_HIGH ATK_VALUE_VERY_HIGH ATK_VALUE_VERY_BAD ATK_VALUE_BAD ATK_VALUE_GOOD ATK_VALUE_VERY_GOOD ATK_VALUE_BEST ATK_VALUE_SUBSUBOPTIMAL ATK_VALUE_SUBOPTIMAL ATK_VALUE_OPTIMAL Proposals for additional constants, along with their use cases, should be submitted to the GNOME Accessibility Team.

On the subject of changes Note that if there is a textual description associated with the new numeric value, that description should be included regardless of whether or not it has also changed. .

Prerequisite

In order to implement Value, your type must inherit fromGObject.

Implementations

Instance methods

atk_value_get_current_value

Gets the value of this object.

deprecated: Unknown 

atk_value_get_increment

Gets the minimum increment by which the value of this object may be changed. If zero, the minimum increment is undefined, which may mean that it is limited only by the floating point precision of the platform.

since: 2.12

atk_value_get_maximum_value

Gets the maximum value of this object.

deprecated: Unknown 

atk_value_get_minimum_increment

Gets the minimum increment by which the value of this object may be changed. If zero, the minimum increment is undefined, which may mean that it is limited only by the floating point precision of the platform.

deprecated: Unknown since: 1.12

atk_value_get_minimum_value

Gets the minimum value of this object.

deprecated: Unknown 

atk_value_get_range

Gets the range of this object.

since: 2.12

atk_value_get_sub_ranges

Gets the list of subranges defined for this object. See AtkValue introduction for examples of subranges and when to expose them.

since: 2.12

atk_value_get_value_and_text

Gets the current value and the human readable text alternative of obj. text is a newly created string, that must be freed by the caller. Can be NULL if no descriptor is available.

since: 2.12

atk_value_set_current_value

Sets the value of this object.

deprecated: Unknown 

atk_value_set_value

Sets the value of this object.

since: 2.12

Signals

Atk.Value::value-changed

The ‘value-changed’ signal is emitted when the current value that represent the object changes. value is the numerical representation of this new value. text is the human readable text alternative of value, and can be NULL if it is not available. Note that if there is a textual description associated with the new numeric value, that description should be included regardless of whether or not it has also changed.

since: 2.12

Interface structure

struct AtkValueIface {
  GTypeInterface parent;
  void (* get_current_value) (
    AtkValue* obj,
    GValue* value
  );
  void (* get_maximum_value) (
    AtkValue* obj,
    GValue* value
  );
  void (* get_minimum_value) (
    AtkValue* obj,
    GValue* value
  );
  gboolean (* set_current_value) (
    AtkValue* obj,
    const GValue* value
  );
  void (* get_minimum_increment) (
    AtkValue* obj,
    GValue* value
  );
  void (* get_value_and_text) (
    AtkValue* obj,
    gdouble* value,
    gchar** text
  );
  AtkRange* (* get_range) (
    AtkValue* obj
  );
  gdouble (* get_increment) (
    AtkValue* obj
  );
  GSList* (* get_sub_ranges) (
    AtkValue* obj
  );
  void (* set_value) (
    AtkValue* obj,
    const gdouble new_value
  );
  
}

No description available.

Interface members
parent
GTypeInterface
 

No description available.

get_current_value
void (* get_current_value) (
    AtkValue* obj,
    GValue* value
  )
 

No description available.

get_maximum_value
void (* get_maximum_value) (
    AtkValue* obj,
    GValue* value
  )
 

No description available.

get_minimum_value
void (* get_minimum_value) (
    AtkValue* obj,
    GValue* value
  )
 

No description available.

set_current_value
gboolean (* set_current_value) (
    AtkValue* obj,
    const GValue* value
  )
 

No description available.

get_minimum_increment
void (* get_minimum_increment) (
    AtkValue* obj,
    GValue* value
  )
 

No description available.

get_value_and_text
void (* get_value_and_text) (
    AtkValue* obj,
    gdouble* value,
    gchar** text
  )
 

No description available.

get_range
AtkRange* (* get_range) (
    AtkValue* obj
  )
 

No description available.

get_increment
gdouble (* get_increment) (
    AtkValue* obj
  )
 

No description available.

get_sub_ranges
GSList* (* get_sub_ranges) (
    AtkValue* obj
  )
 

No description available.

set_value
void (* set_value) (
    AtkValue* obj,
    const gdouble new_value
  )
 

No description available.

Virtual methods

Atk.Value.get_current_value

Gets the value of this object.

deprecated: Unknown 

Atk.Value.get_increment

Gets the minimum increment by which the value of this object may be changed. If zero, the minimum increment is undefined, which may mean that it is limited only by the floating point precision of the platform.

since: 2.12

Atk.Value.get_maximum_value

Gets the maximum value of this object.

deprecated: Unknown 

Atk.Value.get_minimum_increment

Gets the minimum increment by which the value of this object may be changed. If zero, the minimum increment is undefined, which may mean that it is limited only by the floating point precision of the platform.

deprecated: Unknown since: 1.12

Atk.Value.get_minimum_value

Gets the minimum value of this object.

deprecated: Unknown 

Atk.Value.get_range

Gets the range of this object.

since: 2.12

Atk.Value.get_sub_ranges

Gets the list of subranges defined for this object. See AtkValue introduction for examples of subranges and when to expose them.

since: 2.12

Atk.Value.get_value_and_text

Gets the current value and the human readable text alternative of obj. text is a newly created string, that must be freed by the caller. Can be NULL if no descriptor is available.

since: 2.12

Atk.Value.set_current_value

Sets the value of this object.

deprecated: Unknown 

Atk.Value.set_value

Sets the value of this object.

since: 2.12