Top |
AtkValueAtkValue — The ATK interface implemented by valuators and components which display or select a value from a bounded range of values. |
void | atk_value_get_current_value () |
void | atk_value_get_maximum_value () |
void | atk_value_get_minimum_value () |
gboolean | atk_value_set_current_value () |
void | atk_value_get_minimum_increment () |
void | atk_value_get_value_and_text () |
AtkRange * | atk_value_get_range () |
gdouble | atk_value_get_increment () |
GSList * | atk_value_get_sub_ranges () |
void | atk_value_set_value () |
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.
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.
Example 1. Password strength
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.
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:
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.
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:
Proposals for additional constants, along with their use cases, should be submitted to the GNOME Accessibility Team.
void atk_value_get_current_value (AtkValue *obj
,GValue *value
);
atk_value_get_current_value
is deprecated and should not be used in newly-written code.
Since 2.12. Use atk_value_get_value_and_text()
instead.
Gets the value of this object.
void atk_value_get_maximum_value (AtkValue *obj
,GValue *value
);
atk_value_get_maximum_value
is deprecated and should not be used in newly-written code.
Since 2.12. Use atk_value_get_range()
instead.
Gets the maximum value of this object.
void atk_value_get_minimum_value (AtkValue *obj
,GValue *value
);
atk_value_get_minimum_value
is deprecated and should not be used in newly-written code.
Since 2.12. Use atk_value_get_range()
instead.
Gets the minimum value of this object.
gboolean atk_value_set_current_value (AtkValue *obj
,const GValue *value
);
atk_value_set_current_value
is deprecated and should not be used in newly-written code.
Since 2.12. Use atk_value_set_value()
instead.
Sets the value of this object.
void atk_value_get_minimum_increment (AtkValue *obj
,GValue *value
);
atk_value_get_minimum_increment
is deprecated and should not be used in newly-written code.
Since 2.12. Use atk_value_get_increment()
instead.
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.
obj |
a GObject instance that implements AtkValueIface |
|
value |
a GValue representing the minimum increment by which the accessible value may be changed |
Since 1.12
void atk_value_get_value_and_text (AtkValue *obj
,gdouble *value
,gchar **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 not descriptor is available.
obj |
a GObject instance that implements AtkValueIface |
|
value |
address of gdouble to put the current value of |
[out] |
text |
address of gchar to put the human
readable text alternative for |
[out][allow-none] |
Since 2.12
AtkRange *
atk_value_get_range (AtkValue *obj
);
Gets the range of this object.
a newly allocated AtkRange
that represents the minimum, maximum and descriptor (if available)
of obj
. NULL if that range is not defined.
Since 2.12
gdouble
atk_value_get_increment (AtkValue *obj
);
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
GSList *
atk_value_get_sub_ranges (AtkValue *obj
);
Gets the list of subranges defined for this object. See AtkValue introduction for examples of subranges and when to expose them.
an GSList of
AtkRange which each of the subranges defined for this object. Free
the returns list with g_slist_free()
.
[element-type AtkRange][transfer full]
Since 2.12
void atk_value_set_value (AtkValue *obj
,const gdouble new_value
);
Sets the value of this object.
This method is intended to provide a way to change the value of the object. In any case, it is possible that the value can't be modified (ie: a read-only component). If the value changes due this call, it is possible that the text could change, and will trigger an “value-changed” signal emission.
Note for implementors: the deprecated atk_value_set_current_value()
method returned TRUE or FALSE depending if the value was assigned
or not. In the practice several implementors were not able to
decide it, and returned TRUE in any case. For that reason it is not
required anymore to return if the value was properly assigned or
not.
obj |
a GObject instance that implements AtkValueIface |
|
new_value |
a double which is the desired new accessible value. |
Since 2.12
“value-changed”
signalvoid user_function (AtkValue *atkvalue, gdouble value, gchar *text, gpointer user_data)
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.
Example: a password meter whose value changes as the user types their new password. Appropiate value text would be "weak", "acceptable" and "strong".
atkvalue |
the object on which the signal was emitted. |
|
value |
the new value in a numerical form. |
|
text |
human readable text alternative (also called description) of this object. NULL if not available. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 2.12