Module: Atk::Document

Defined in:
(unknown)

Overview

The ATK interface which represents the toplevel
container for document content.

The AtkDocument interface should be supported by any object whose
content is a representation or view of a document. The AtkDocument
interface should appear on the toplevel container for the document
content; however AtkDocument instances may be nested (i.e. an
AtkDocument may be a descendant of another AtkDocument) in those
cases where one document contains "embedded content" which can
reasonably be considered a document in its own right.

Instance Method Summary collapse

Instance Method Details

#attributesAtk::AttributeSet

Gets an AtkAttributeSet which describes document-wide
attributes as name-value pairs.

Returns:

  • (Atk::AttributeSet)

    An AtkAttributeSet containing the explicitly
    set name-value-pair attributes associated with this document
    as a whole.

#current_page_numberInteger

Retrieves the current page number inside document.

Returns:

  • (Integer)

    the current page number inside document, or -1 if
    not implemented, not know by the implementor, or irrelevant.

#documentGObject

Gets a %gpointer that points to an instance of the DOM. It is
up to the caller to check atk_document_get_type to determine
how to cast this pointer.

Returns:

  • (GObject)

    a %gpointer that points to an instance of the DOM.

#document_attributesAtk::AttributeSet

Gets an AtkAttributeSet which describes document-wide
attributes as name-value pairs.

Returns:

  • (Atk::AttributeSet)

    An AtkAttributeSet containing the explicitly
    set name-value-pair attributes associated with this document
    as a whole.

#document_localeString

Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale
of the content of this document instance. Individual
text substrings or images within this document may have
a different locale, see atk_text_get_attributes and
atk_image_get_image_locale.

Returns:

  • (String)

    a UTF-8 string indicating the POSIX-style LC_MESSAGES
    locale of the document content as a whole, or NULL if
    the document content does not specify a locale.

#document_typeString

Gets a string indicating the document type.

Returns:

  • (String)

    a string indicating the document type

#get_attribute_value(attribute_name) ⇒ String

Retrieves the value of the given attribute_name inside document.

Parameters:

  • attribute_name (String)

    a character string representing the name of the attribute
    whose value is being queried.

Returns:

  • (String)

    a string value associated with the named
    attribute for this document, or nil if a value for
    attribute_name has not been specified for this document.

#get_current_page_number(document) ⇒ Integer

Returns the current page number inside document, or -1 if
not implemented, not know by the implementor, or irrelevant.

Parameters:

Returns:

  • (Integer)

    the current page number inside document, or -1 if
    not implemented, not know by the implementor, or irrelevant.

#get_document(document) ⇒ GObject

Returns a %gpointer that points to an instance of the DOM.

Parameters:

  • document (Atk::Document)

    a #GObject instance that implements AtkDocumentIface

Returns:

  • (GObject)

    a %gpointer that points to an instance of the DOM.

#get_document_attribute_value(document, attribute_name) ⇒ String

Returns a string value associated with the named
attribute for this document, or nil if a value for
attribute_name has not been specified for this document.

Parameters:

  • document (Atk::Document)

    a #GObject instance that implements AtkDocumentIface

  • attribute_name (String)

    a character string representing the name of the attribute
    whose value is being queried.

Returns:

  • (String)

    a string value associated with the named
    attribute for this document, or nil if a value for
    attribute_name has not been specified for this document.

#get_document_attributes(document) ⇒ Atk::AttributeSet

Returns An AtkAttributeSet containing the explicitly
set name-value-pair attributes associated with this document
as a whole.

Parameters:

  • document (Atk::Document)

    a #GObject instance that implements AtkDocumentIface

Returns:

  • (Atk::AttributeSet)

    An AtkAttributeSet containing the explicitly
    set name-value-pair attributes associated with this document
    as a whole.

#get_document_locale(document) ⇒ String

Returns a UTF-8 string indicating the POSIX-style LC_MESSAGES
locale of the document content as a whole, or NULL if
the document content does not specify a locale.

Parameters:

  • document (Atk::Document)

    a #GObject instance that implements AtkDocumentIface

Returns:

  • (String)

    a UTF-8 string indicating the POSIX-style LC_MESSAGES
    locale of the document content as a whole, or NULL if
    the document content does not specify a locale.

#get_document_type(document) ⇒ String

Returns a string indicating the document type.

Parameters:

  • document (Atk::Document)

    a #GObject instance that implements AtkDocumentIface

Returns:

  • (String)

    a string indicating the document type

#get_page_count(document) ⇒ Integer

Returns total page count of document, or -1 if not implemented,
not know by the implementor or irrelevant.

Parameters:

Returns:

  • (Integer)

    total page count of document, or -1 if not implemented,
    not know by the implementor or irrelevant.

#get_text_selections(document) ⇒ Array<Atk::TextSelection>

AtkTextSelection structures representing the selection.

Parameters:

Returns:

  • (Array<Atk::TextSelection>)

    a GArray of

#localeString

Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale
of the content of this document instance. Individual
text substrings or images within this document may have
a different locale, see atk_text_get_attributes and
atk_image_get_image_locale.

Returns:

  • (String)

    a UTF-8 string indicating the POSIX-style LC_MESSAGES
    locale of the document content as a whole, or NULL if
    the document content does not specify a locale.

#page_countInteger

Retrieves the total number of pages inside document.

Returns:

  • (Integer)

    total page count of document, or -1 if not implemented,
    not know by the implementor or irrelevant.

#set_attribute_value(attribute_name, attribute_value) ⇒ Boolean

Sets the value for the given attribute_name inside document.

Parameters:

  • attribute_name (String)

    a character string representing the name of the attribute
    whose value is being set.

  • attribute_value (String)

    a string value to be associated with attribute_name.

Returns:

  • (Boolean)

    true if attribute_value is successfully associated
    with attribute_name for this document, and false if if the
    document does not allow the attribute to be modified

#set_document_attribute(document, attribute_name, attribute_value) ⇒ Boolean

Returns true if attribute_value is successfully associated
with attribute_name for this document, and false if if the
document does not allow the attribute to be modified.

Parameters:

  • document (Atk::Document)

    a #GObject instance that implements Atk::DocumentIface

  • attribute_name (String)

    a character string representing the name of the attribute
    whose value is being set.

  • attribute_value (String)

    a string value to be associated with attribute_name.

Returns:

  • (Boolean)

    true if attribute_value is successfully associated
    with attribute_name for this document, and false if if the
    document does not allow the attribute to be modified

#set_text_selections(document, selections) ⇒ Boolean

Returns TRUE if the selection was made successfully; FALSE otherwise.

Parameters:

  • document (Atk::Document)

    an Atk::Document.

  • selections (Array<Atk::TextSelection>)

    a GArray of AtkTextSelections
    to be selected.

Returns:

  • (Boolean)

    TRUE if the selection was made successfully; FALSE otherwise.

#text_selectionsArray<Atk::TextSelection>

Returns an array of AtkTextSelections within this document.
AtkTextSelection structures representing the selection.

Returns:

  • (Array<Atk::TextSelection>)

    a GArray of

#text_selections=(selections) ⇒ Boolean

Makes 1 or more selections within this document denoted by the given
array of AtkTextSelections. Any existing physical selection (inside or
outside this document) is replaced by the new selections. All objects within
the given selection ranges must be descendants of this document. Otherwise
FALSE will be returned.

Parameters:

  • selections (Array<Atk::TextSelection>)

    a GArray of AtkTextSelections
    to be selected.

Returns:

  • (Boolean)

    TRUE if the selection was made successfully; FALSE otherwise.