Interface

Gtk-4.0GtkAccessibleTextInterface

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

interface Interface {
    vfunc_get_accessible_id(): string | null;
    vfunc_get_accessible_parent(): Gtk.Accessible | null;
    vfunc_get_at_context(): Gtk.ATContext | null;
    vfunc_get_attributes(
        offset: number,
    ): [
        boolean,
        AccessibleTextRange[]
        | null,
        string[] | null,
        string[] | null,
    ];
    vfunc_get_bounds(): [boolean, number, number, number, number];
    vfunc_get_caret_position(): number;
    vfunc_get_contents(
        start: number,
        end: number,
    ): Uint8Array<ArrayBufferLike> | GLib.Bytes;
    vfunc_get_contents_at(
        offset: number,
        granularity: Gtk.AccessibleTextGranularity,
    ): [Uint8Array<ArrayBufferLike> | GLib.Bytes, number, number];
    vfunc_get_default_attributes(): [string[] | null, string[] | null];
    vfunc_get_extents(
        start: number,
        end: number,
        extents: Graphene.Rect,
    ): boolean;
    vfunc_get_first_accessible_child(): Gtk.Accessible | null;
    vfunc_get_next_accessible_sibling(): Gtk.Accessible | null;
    vfunc_get_offset(point: Graphene.Point): [boolean, number];
    vfunc_get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
    vfunc_get_selection(): [boolean, AccessibleTextRange[] | null];
    vfunc_set_caret_position(offset: number): boolean;
    vfunc_set_selection(i: number, range: AccessibleTextRange): boolean;
}

Hierarchy (View Summary)

Index

Methods

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

    Parameters

    • offset: number

      the offset, in characters

    Returns [boolean, AccessibleTextRange[] | null, string[] | null, string[] | null]

  • Retrieves the position of the caret inside the accessible object.

    Returns number

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

    Parameters

    • start: number

      the beginning of the range, in characters

    • end: number

      the end of the range, in characters

    Returns Uint8Array<ArrayBufferLike> | 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.

    Parameters

    Returns [Uint8Array<ArrayBufferLike> | GLib.Bytes, number, number]

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

    Returns [string[] | null, string[] | null]

  • Obtains the extents of a range of text, in widget coordinates.

    Parameters

    • start: number

      the start offset, in characters

    • end: number

      the end offset, in characters, extents (out caller-allocates): return location for the extents

    • extents: Graphene.Rect

    Returns 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].

    Returns [boolean, AccessibleTextRange[] | null]

  • Sets the caret position.

    Parameters

    • offset: number

      the text offset in characters

    Returns boolean

Methods - Inherited from Gtk.Accessible.Interface

  • Retrieves the accessible identifier for the accessible object.

    This functionality can be overridden by Gtk.Accessible implementations.

    It is left to the accessible implementation to define the scope and uniqueness of the identifier.

    Returns string | null

  • Queries the coordinates and dimensions of this accessible

    This functionality can be overridden by Gtk.Accessible implementations, e.g. to get the bounds from an ignored child widget.

    Returns [boolean, number, number, number, number]