gtkmm 4.17.0
|
An interface for accessible objects containing formatted text. More...
#include <gtkmm/accessibletext.h>
Public Types | |
enum class | Granularity { Granularity::CHARACTER , Granularity::WORD , Granularity::SENTENCE , Granularity::LINE , Granularity::PARAGRAPH } |
The granularity for queries about the text contents of a Gtk::AccessibleText implementation. More... | |
enum class | ContentChange { ContentChange::INSERT , ContentChange::REMOVE } |
The type of contents change operation. More... | |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::AccessibleText > | wrap (GtkAccessibleText *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
An interface for accessible objects containing formatted text.
The Gtk::AccessibleText interface is meant to be implemented by accessible objects that have text formatted with attributes, or non-trivial text contents.
You should use the Gtk::Accessible::Property::LABEL or the Gtk::Accessible::Property::DESCRIPTION properties for accessible objects containing simple, unformatted text.
|
protected |
You should derive from this class to use it.
|
noexcept |
|
overridenoexcept |
|
protectedvirtual |
Retrieves the text attributes inside the accessible object.
Each attribute is composed by:
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 GtkAccessibleTextRange.
offset | The offset, in characters. | |
[out] | n_ranges | The number of attributes. |
[out] | ranges | (array length=n_ranges) (optional) (transfer container) The ranges of the attributes inside the accessible object. |
[out] | attribute_names | (array zero-terminated=1) (optional) (transfer full) The names of the attributes inside the accessible object. |
[out] | attribute_values | (array zero-terminated=1) (optional) (transfer full) The values of the attributes inside the accessible object. |
true
if the accessible object has at least one attribute, and false
otherwise.Retrieves the position of the caret inside the accessible object.
|
protectedvirtual |
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.
offset | The offset, in characters. | |
granularity | The granularity of the query. | |
[out] | start | The start of the range, in characters. |
[out] | end | The end of the range, in characters. |
|
protectedvirtual |
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.
start | The beginning of the range, in characters. |
end | The end of the range, in characters. |
|
protectedvirtual |
Retrieves the default text attributes inside the accessible object.
Each attribute is composed by:
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.
[out] | attribute_names | (array zero-terminated=1) (optional) (transfer full) The names of the default attributes inside the accessible object. |
[out] | attribute_values | (array zero-terminated=1) (optional) (transfer full) The values of the default attributes inside the accessible object. |
|
protectedvirtual |
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 GtkAccessibleTextRange.
[out] | n_ranges | The number of selection ranges. |
[out] | ranges | (optional) (array length=n_ranges) (transfer container) The selection ranges. |
true
if there is at least one selection inside the accessible object, and false
otherwise.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
|
noexcept |
void Gtk::AccessibleText::update_caret_position | ( | ) |
Updates the position of the caret.
Implementations of the Gtk::AccessibleText
interface should call this function every time the caret has moved, in order to notify assistive technologies.
void Gtk::AccessibleText::update_contents | ( | ContentChange | change, |
unsigned int | start, | ||
unsigned int | end | ||
) |
Notifies assistive technologies of a change in contents.
Implementations of the Gtk::AccessibleText
interface should call this function every time their contents change as the result of an operation, like an insertion or a removal.
change | The type of change in the contents. |
start | The starting offset of the change, in characters. |
end | The end offset of the change, in characters. |
void Gtk::AccessibleText::update_selection_bound | ( | ) |
Updates the boundary of the selection.
Implementations of the Gtk::AccessibleText
interface should call this function every time the selection has moved, in order to notify assistive technologies.
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |