Interface

Atk-1.0AtkTextInterface

Interface for implementing Text. Contains only the virtual methods that need to be implemented.

interface Interface {
    vfunc_add_selection(start_offset: number, end_offset: number): boolean;
    vfunc_get_bounded_ranges(
        rect: TextRectangle,
        coord_type: Atk.CoordType,
        x_clip_type: Atk.TextClipType,
        y_clip_type: Atk.TextClipType,
    ): Atk.TextRange[];
    vfunc_get_caret_offset(): number;
    vfunc_get_character_at_offset(offset: number): string;
    vfunc_get_character_count(): number;
    vfunc_get_character_extents(
        offset: number,
        coords: Atk.CoordType,
    ): [number, number, number, number];
    vfunc_get_default_attributes(): SList;
    vfunc_get_n_selections(): number;
    vfunc_get_offset_at_point(
        x: number,
        y: number,
        coords: Atk.CoordType,
    ): number;
    vfunc_get_range_extents(
        start_offset: number,
        end_offset: number,
        coord_type: Atk.CoordType,
    ): TextRectangle;
    vfunc_get_run_attributes(offset: number): [SList, number, number];
    vfunc_get_selection(selection_num: number): [string, number, number];
    vfunc_get_string_at_offset(
        offset: number,
        granularity: Atk.TextGranularity,
    ): [string, number, number];
    vfunc_get_text(start_offset: number, end_offset: number): string;
    vfunc_get_text_after_offset(
        offset: number,
        boundary_type: Atk.TextBoundary,
    ): [string, number, number];
    vfunc_get_text_at_offset(
        offset: number,
        boundary_type: Atk.TextBoundary,
    ): [string, number, number];
    vfunc_get_text_before_offset(
        offset: number,
        boundary_type: Atk.TextBoundary,
    ): [string, number, number];
    vfunc_remove_selection(selection_num: number): boolean;
    vfunc_scroll_substring_to(
        start_offset: number,
        end_offset: number,
        type: Atk.ScrollType,
    ): boolean;
    vfunc_scroll_substring_to_point(
        start_offset: number,
        end_offset: number,
        coords: Atk.CoordType,
        x: number,
        y: number,
    ): boolean;
    vfunc_set_caret_offset(offset: number): boolean;
    vfunc_set_selection(
        selection_num: number,
        start_offset: number,
        end_offset: number,
    ): boolean;
    vfunc_text_attributes_changed(): void;
    vfunc_text_caret_moved(location: number): void;
    vfunc_text_changed(position: number, length: number): void;
    vfunc_text_selection_changed(): void;
}

Hierarchy (View Summary)

Index

Methods

  • Adds a selection bounded by the specified offsets.

    Parameters

    • start_offset: number

      the starting character offset of the selected region

    • end_offset: number

      the offset of the first character after the selected region.

    Returns boolean

  • Gets the offset of the position of the caret (cursor).

    Returns number

  • Gets the specified text.

    Parameters

    • offset: number

      a character offset within text

    Returns string

  • If the extent can not be obtained (e.g. missing support), all of x, y, width, height are set to -1.

    Get the bounding box containing the glyph representing the character at a particular text offset.

    Parameters

    • offset: number

      The offset of the text character for which bounding information is required.

    • coords: Atk.CoordType

      specify whether coordinates are relative to the screen or widget window

    Returns [number, number, number, number]

  • 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.

    Returns SList

  • 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.

    Parameters

    • x: number

      screen x-position of character

    • y: number

      screen y-position of character

    • coords: Atk.CoordType

      specify whether coordinates are relative to the screen or widget window

    Returns number

  • Get the bounding box for text within the specified range.

    If the extents can not be obtained (e.g. or missing support), the rectangle fields are set to -1.

    Parameters

    • start_offset: number

      The offset of the first text character for which boundary information is required.

    • end_offset: number

      The offset of the text character after the last character for which boundary information is required.

    • coord_type: Atk.CoordType

      Specify whether coordinates are relative to the screen or widget window.

    Returns TextRectangle

  • 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. Note that end_offset is the offset of the first character after the range. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.

    Parameters

    • offset: number

      the character offset at which to get the attributes, -1 means the offset of the character to be inserted at the caret location.

    Returns [SList, number, number]

  • Gets the text from the specified selection.

    Parameters

    • selection_num: number

      The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.

    Returns [string, number, number]

  • Gets a portion of the text exposed through an Atk.Text according to a given offset and a specific granularity, along with the start and end offsets defining the boundaries of such a portion of text.

    If granularity is ATK_TEXT_GRANULARITY_CHAR the character at the offset is returned.

    If granularity is ATK_TEXT_GRANULARITY_WORD 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 granularity is ATK_TEXT_GRANULARITY_SENTENCE 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 granularity is ATK_TEXT_GRANULARITY_LINE the returned string is from the line start at or before the offset to the line start after the offset.

    If granularity is ATK_TEXT_GRANULARITY_PARAGRAPH the returned string is from the start of the paragraph at or before the offset to the start of the following paragraph after the offset.

    Parameters

    Returns [string, number, number]

  • Gets the specified text.

    Parameters

    • start_offset: number

      a starting character offset within text

    • end_offset: number

      an ending character offset within text, or -1 for the end of the string.

    Returns string

  • 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_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_LINE_START the returned string is from the line start at or before the offset to the line start after the offset.

    Parameters

    Returns [string, number, number]

  • Removes the specified selection.

    Parameters

    • selection_num: number

      The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.

    Returns boolean

  • Makes a substring of text visible on the screen by scrolling all necessary parents.

    Parameters

    • start_offset: number

      start offset in the text

    • end_offset: number

      end offset in the text, or -1 for the end of the text.

    • type: Atk.ScrollType

      specify where the object should be made visible.

    Returns boolean

  • Move the top-left of a substring of text to a given position of the screen by scrolling all necessary parents.

    Parameters

    • start_offset: number

      start offset in the text

    • end_offset: number

      end offset in the text, or -1 for the end of the text.

    • coords: Atk.CoordType

      specify whether coordinates are relative to the screen or to the parent object.

    • x: number

      x-position where to scroll to

    • y: number

      y-position where to scroll to

    Returns boolean

  • Sets the caret (cursor) position to the specified offset.

    In the case of rich-text content, this method should either grab focus or move the sequential focus navigation starting point (if the application supports this concept) as if the user had clicked on the new caret position. Typically, this means that the target of this operation is the node containing the new caret position or one of its ancestors. In other words, after this method is called, if the user advances focus, it should move to the first focusable node following the new caret position.

    Calling this method should also scroll the application viewport in a way that matches the behavior of the application's typical caret motion or tab navigation as closely as possible. This also means that if the application's caret motion or focus navigation does not trigger a scroll operation, this method should not trigger one either. If the application does not have a caret motion or focus navigation operation, this method should try to scroll the new caret position into view while minimizing unnecessary scroll motion.

    Parameters

    • offset: number

      the character offset of the new caret position

    Returns boolean

  • Changes the start and end offset of the specified selection.

    Parameters

    • selection_num: number

      The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.

    • start_offset: number

      the new starting character offset of the selection

    • end_offset: number

      the new end position of (e.g. offset immediately past) the selection

    Returns boolean

  • the signal handler which is executed when there is a text change. This virtual function is deprecated sice 2.9.4 and it should not be overriden.

    Parameters

    • position: number
    • length: number

    Returns void