![]() |
![]() |
This should be implemented by Atk::Objects on behalf of widgets that have text content which is either attributed or otherwise non-trivial. Atk::Objects whose text content is simple, unattributed, and very brief may expose that content via Atk::Object::get_name() instead; however if the text is editable, multi-line, typically longer than three or four words, attributed, selectable, or if the object already uses the 'name' ATK property for other information, this Text interface should be used to expose the text content. In the case of editable text content, Atk::EditableText (a subtype of the Atk::Text interface) should be implemented instead.
Atk::Text provides not only traversal facilities and change notification for text content, but also caret tracking and glyph bounding box calculations. Note that the text strings are exposed as UTF-8, and are therefore potentially multi-byte, and caret-to-byte offset mapping makes no assumptions about the character length; also bounding box glyph-to-offset mapping may be complex for languages which use ligatures.
Public Types | |
typedef AtkTextRectangle | Rectangle |
Public Member Functions | |
bool | add_selection (int start_offset, int end_offset) |
Adds a selection bounded by the specified offsets. | |
AtkTextRange** | get_bounded_ranges (const Rectangle& rect, CoordType coord_type, TextClipType x_clip_type, TextClipType y_clip_type) |
Get the ranges of text in the specified bounding box. | |
int | get_caret_offset () const |
Gets the offset position of the caret (cursor). | |
gunichar | get_character_at_offset (int offset) const |
Gets the specified text. | |
int | get_character_count () const |
Gets the character count. | |
void | get_character_extents (int offset, int& x, int& y, int& width, int& height, CoordType coords) const |
Get the bounding box containing the glyph representing the character at a particular text offset. | |
AttributeSet | get_default_attributes () const |
Creates an Atk::AttributeSet which consists of the default values of attributes for the text. | |
int | get_n_selections () const |
Gets the number of selected regions. | |
int | get_offset_at_point (int x, int y, CoordType coords) const |
Gets the offset of the character located at coordinates x and y . | |
void | get_range_extents (int start_offset, int end_offset, CoordType coord_type, Rectangle& rect) |
Get the bounding box for text within the specified range. | |
AttributeSet | get_run_attributes (int offset, int& start_offset, int& end_offset) const |
Creates an Atk::AttributeSet which consists of the attributes explicitly set at the position offset in the text. | |
Glib::ustring | get_selection (int selection_num, int& start_offset, int& end_offset) const |
Gets the text from the specified selection. | |
Glib::ustring | get_text (int start_offset, int end_offset) const |
Gets the specified text. | |
Glib::ustring | get_text_after_offset (int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const |
Gets the specified text. | |
Glib::ustring | get_text_at_offset (int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const |
Gets the specified text. | |
Glib::ustring | get_text_before_offset (int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const |
Gets the specified text. | |
const AtkText* | gobj () const |
Provides access to the underlying C GObject. | |
AtkText* | gobj () |
Provides access to the underlying C GObject. | |
bool | remove_selection (int selection_num) |
Removes the specified selection. | |
bool | set_caret_offset (int offset) |
Sets the caret (cursor) position to the specified offset . | |
bool | set_selection (int selection_num, int start_offset, int end_offset) |
Changes the start and end offset of the specified selection. | |
Glib::SignalProxy0<void> | signal_text_attributes_changed () |
Glib::SignalProxy1< void, int > | signal_text_caret_moved () |
Glib::SignalProxy2< void, int, int > | signal_text_changed () |
Glib::SignalProxy0<void> | signal_text_selection_changed () |
virtual | ~Text () |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
Protected Member Functions | |
virtual bool | add_selection_vfunc (int start_offset, int end_offset) |
virtual int | get_caret_offset_vfunc () const |
virtual gunichar | get_character_at_offset_vfunc (int offset) const |
virtual int | get_character_count_vfunc () const |
virtual void | get_character_extents_vfunc (int offset, int& x, int& y, int& width, int& height, CoordType coords) const |
virtual AtkAttributeSet* | get_default_attributes_vfunc () const |
virtual int | get_n_selections_vfunc () const |
virtual int | get_offset_at_point_vfunc (int x, int y, CoordType coords) const |
virtual AtkAttributeSet* | get_run_attributes_vfunc (int offset, int& start_offset, int& end_offset) const |
virtual Glib::ustring | get_selection_vfunc (int selection_num, int& start_offset, int& end_offset) const |
virtual Glib::ustring | get_text_after_offset_vfunc (int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const |
virtual Glib::ustring | get_text_at_offset_vfunc (int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const |
virtual Glib::ustring | get_text_before_offset_vfunc (int offset, TextBoundary boundary_type, int& start_offset, int& end_offset) const |
virtual Glib::ustring | get_text_vfunc (int start_offset, int end_offset) const |
virtual void | on_text_attributes_changed () |
virtual void | on_text_caret_moved (int location) |
virtual void | on_text_changed (int position, int length) |
virtual void | on_text_selection_changed () |
virtual bool | remove_selection_vfunc (int selection_num) |
virtual bool | set_caret_offset_vfunc (int offset) |
virtual bool | set_selection_vfunc (int selection_num, int start_offset, int end_offset) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Atk::Text> | wrap (AtkText* object, bool take_copy=false) |
|
|
|
|
|
|
|
Adds a selection bounded by the specified offsets.
|
|
|
|
Get the ranges of text in the specified bounding box.
|
|
Gets the offset position of the caret (cursor).
|
|
|
|
Gets the specified text.
|
|
|
|
Gets the character count.
|
|
|
|
Get the bounding box containing the glyph representing the character at a particular text offset.
|
|
|
|
Creates an Atk::AttributeSet which consists of the default values of attributes for the text. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.
|
|
|
|
Gets the number of selected regions.
|
|
|
|
Gets the offset of the character located at coordinates x and y . x and y are interpreted as being relative to the screen or this widget's window depending on coords .
|
|
|
|
Get the bounding box for text within the specified range.
|
|
Creates an Atk::AttributeSet which consists of the attributes explicitly set at the position offset in the text. start_offset and end_offset are set to the start and end of the range around offset where the attributes are invariant. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.
|
|
|
|
Gets the text from the specified selection.
|
|
|
|
Gets the specified text.
|
|
Gets the specified text. If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character after the offset is returned. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start after the offset to the next word start. The returned string will contain the word after the offset if the offset is inside a word or if the offset is not inside a word. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end at or after the offset to the next work end. The returned string will contain the word after the offset if the offset is inside a word and will contain the word after the word after the offset if the offset is not inside a word. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start after the offset to the next sentence start. The returned string will contain the sentence after the offset if the offset is inside a sentence or if the offset is not inside a sentence. If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end at or after the offset to the next sentence end. The returned string will contain the sentence after the offset if the offset is inside a sentence and will contain the sentence after the sentence after the offset if the offset is not inside a sentence. If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start after the offset to the next line start. If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end at or after the offset to the next line start.
|
|
|
|
Gets the specified text. If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character at the offset is returned. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start at or before the offset to the word start after the offset. The returned string will contain the word at the offset if the offset is inside a word and will contain the word before the offset if the offset is not inside a word. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end before the offset to the word end at or after the offset. The returned string will contain the word at the offset if the offset is inside a word and will contain the word after to the offset if the offset is not inside a word. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start at or before the offset to the sentence start after the offset. The returned string will contain the sentence at the offset if the offset is inside a sentence and will contain the sentence before the offset if the offset is not inside a sentence. If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end before the offset to the sentence end at or after the offset. The returned string will contain the sentence at the offset if the offset is inside a sentence and will contain the sentence after the offset if the offset is not inside a sentence. If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start at or before the offset to the line start after the offset. If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end before the offset to the line end at or after the offset.
|
|
|
|
Gets the specified text. If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character before the offset is returned. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start before the word start before the offset to the word start before the offset. The returned string will contain the word before the offset if the offset is inside a word and will contain the word before the word before the offset if the offset is not inside a word. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end before the word end at or before the offset to the word end at or before the offset. The returned string will contain the word before the offset if the offset is inside a word or if the offset is not inside a word. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start before the sentence start before the offset to the sentence start before the offset. The returned string will contain the sentence before the offset if the offset is inside a sentence and will contain the sentence before the sentence before the offset if the offset is not inside a sentence. If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end before the sentence end at or before the offset to the sentence end at or before the offset. The returned string will contain the sentence before the offset if the offset is inside a sentence or if the offset is not inside a sentence. If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start before the line start ar or before the offset to the line start ar or before the offset. If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end before the line end before the offset to the line end before the offset.
|
|
|
|
|
|
Provides access to the underlying C GObject.
Reimplemented from Glib::Interface. Reimplemented in Atk::NoOpObject. |
|
Provides access to the underlying C GObject.
Reimplemented from Glib::Interface. Reimplemented in Atk::NoOpObject. |
|
|
|
|
|
|
|
|
|
Removes the specified selection.
|
|
|
|
Sets the caret (cursor) position to the specified offset .
|
|
|
|
Changes the start and end offset of the specified selection.
|
|
|
|
|
|
|
|
|
|
|
|
|