Module: Gtk::AccessibleText
- Defined in:
- (unknown)
Overview
An interface for accessible objects containing formatted text.
The GtkAccessibleText interfaces is meant to be implemented by accessible
objects that have text formatted with attributes, or non-trivial text contents.
You should use the [enumGtk.AccessibleProperty.LABEL] or the [enumGtk.AccessibleProperty.DESCRIPTION] properties for accessible objects containing simple, unformatted text.
Instance Method Summary collapse
-
#caret_position ⇒ Integer
Retrieves the position of the caret inside the accessible object.
-
#get_attributes(offset, n_ranges, ranges, attribute_names, attribute_values) ⇒ Boolean
Retrieves the text attributes inside the accessible object.
-
#get_contents(start, end) ⇒ GLib::Bytes
Retrieve the current contents of the accessible object within the given range.
-
#get_contents_at(offset, granularity, start, end) ⇒ GLib::Bytes
Retrieve the current contents of the accessible object starting from the given offset, and using the given granularity.
-
#get_default_attributes(attribute_names, attribute_values) ⇒ nil
Retrieves the default text attributes inside the accessible object.
-
#get_selection(n_ranges, ranges) ⇒ Boolean
Retrieves the selection ranges in the accessible object.
-
#update_caret_position ⇒ nil
Updates the position of the caret.
-
#update_contents(change, start, end) ⇒ nil
Notifies assistive technologies of a change in contents.
-
#update_selection_bound ⇒ nil
Updates the boundary of the selection.
Instance Method Details
#caret_position ⇒ Integer
Retrieves the position of the caret inside the accessible object.
#get_attributes(offset, n_ranges, ranges, attribute_names, attribute_values) ⇒ Boolean
Retrieves the text attributes inside the accessible object.
Each attribute is composed by:
- a range
- a name
- a value
It is left to the implementation to determine the serialization format of the value to a string.
GTK provides support for various text attribute names and values, but implementations of this interface are free to add their own attributes.
If this function returns true, n_ranges will be set to a value
greater than or equal to one, ranges will be set to a newly
allocated array of [struct#Gtk.AccessibleTextRange].
#get_contents(start, end) ⇒ GLib::Bytes
Retrieve the current contents of the accessible object within the given range.
If end is G_MAXUINT, the end of the range is the full content
of the accessible object.
#get_contents_at(offset, granularity, start, end) ⇒ GLib::Bytes
Retrieve the current contents of the accessible object starting from the given offset, and using the given granularity.
The start and end values contain the boundaries of the text.
#get_default_attributes(attribute_names, attribute_values) ⇒ nil
Retrieves the default text attributes inside the accessible object.
Each attribute is composed by:
- a name
- a value
It is left to the implementation to determine the serialization format of the value to a string.
GTK provides support for various text attribute names and values, but implementations of this interface are free to add their own attributes.
#get_selection(n_ranges, ranges) ⇒ Boolean
Retrieves the selection ranges in the accessible object.
If this function returns true, n_ranges will be set to a value
greater than or equal to one, and ranges will be set to a newly
allocated array of [struct#Gtk.AccessibleTextRange].
#update_caret_position ⇒ nil
Updates the position of the caret.
Implementations of the GtkAccessibleText interface should call this
function every time the caret has moved, in order to notify assistive
technologies.
#update_contents(change, start, end) ⇒ nil
Notifies assistive technologies of a change in contents.
Implementations of the GtkAccessibleText interface should call this
function every time their contents change as the result of an operation,
like an insertion or a removal.
Note: If the change is a deletion, this function must be called before removing the contents, if it is an insertion, it must be called after inserting the new contents.
#update_selection_bound ⇒ nil
Updates the boundary of the selection.
Implementations of the GtkAccessibleText interface should call this
function every time the selection has moved, in order to notify assistive
technologies.