Atk.Document¶
- Implementations:
Methods¶
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
Properties¶
None
Signals¶
Name |
Short Description |
---|---|
The “document-attribute-changed” signal should be emitted when there is a change to one of the document attributes returned by |
|
The ‘load-complete’ signal is emitted when a pending load of a static document has completed. |
|
The ‘load-stopped’ signal is emitted when a pending load of document contents is cancelled, paused, or otherwise interrupted by the user or application logic. |
|
The ‘page-changed’ signal is emitted when the current page of a document changes, e.g. |
|
The ‘reload’ signal is emitted when the contents of a document is refreshed from its source. |
Fields¶
None
Class Details¶
- class Atk.Document¶
- Bases:
- Structure:
The ATK interface which represents the toplevel container for document content.
The
Atk.Document
interface should be supported by any object whose content is a representation or view of a document. TheAtk.Document
interface should appear on the toplevel container for the document content; howeverAtk.Document
instances may be nested (i.e. anAtk.Document
may be a descendant of anotherAtk.Document
) in those cases where one document contains “embedded content” which can reasonably be considered a document in its own right.- get_attribute_value(attribute_name)[source]¶
- Parameters:
attribute_name (
str
) – a character string representing the name of the attribute whose value is being queried.- Returns:
a string value associated with the named attribute for this document, or
None
if a value for attribute_name has not been specified for this document.- Return type:
Retrieves the value of the given attribute_name inside self.
New in version 1.12.
- get_attributes()[source]¶
- Returns:
An AtkAttributeSet containing the explicitly set name-value-pair attributes associated with this document as a whole.
- Return type:
[
object
]
Gets an AtkAttributeSet which describes document-wide attributes as name-value pairs.
New in version 1.12.
- get_current_page_number()[source]¶
- Returns:
the current page number inside self, or -1 if not implemented, not know by the implementor, or irrelevant.
- Return type:
Retrieves the current page number inside self.
New in version 2.12.
- get_document()[source]¶
-
Gets a
object
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.Deprecated since version 2.12: document is already a representation of the document. Use it directly, or one of its children, as an instance of the DOM.
- get_document_type()[source]¶
- Returns:
a string indicating the document type
- Return type:
Gets a string indicating the document type.
Deprecated since version 2.12: Please use
Atk.Document.get_attributes
() to ask for the document type if it applies.
- get_locale()[source]¶
- Returns:
a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of the document content as a whole, or
None
if the document content does not specify a locale.- Return type:
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
.Deprecated since version 2.7.90: Please use
Atk.Object.get_object_locale
() instead.
- get_page_count()[source]¶
- Returns:
total page count of self, or -1 if not implemented, not know by the implementor or irrelevant.
- Return type:
Retrieves the total number of pages inside self.
New in version 2.12.
- get_text_selections()[source]¶
- Returns:
a
GLib.Array
ofAtk.TextSelection
structures representing the selection.- Return type:
Returns an array of AtkTextSelections within this document.
New in version 2.52.
- set_attribute_value(attribute_name, attribute_value)[source]¶
- Parameters:
- Returns:
True
if attribute_value is successfully associated with attribute_name for this self, andFalse
if if the document does not allow the attribute to be modified- Return type:
Sets the value for the given attribute_name inside self.
New in version 1.12.
- set_text_selections(selections)[source]¶
- Parameters:
selections ([
Atk.TextSelection
]) – aGLib.Array
of AtkTextSelections to be selected.- Returns:
True
if the selection was made successfully;False
otherwise.- Return type:
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.New in version 2.52.
- do_get_current_page_number() virtual¶
- Returns:
the current page number inside document, or -1 if not implemented, not know by the implementor, or irrelevant.
- Return type:
Retrieves the current page number inside document.
New in version 2.12.
- do_get_document() virtual¶
-
Gets a
object
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.Deprecated since version 2.12: document is already a representation of the document. Use it directly, or one of its children, as an instance of the DOM.
- do_get_document_attribute_value(attribute_name) virtual¶
- Parameters:
attribute_name (
str
) – a character string representing the name of the attribute whose value is being queried.- Returns:
a string value associated with the named attribute for this document, or
None
if a value for attribute_name has not been specified for this document.- Return type:
Retrieves the value of the given attribute_name inside document.
New in version 1.12.
- do_get_document_attributes() virtual¶
- Returns:
An AtkAttributeSet containing the explicitly set name-value-pair attributes associated with this document as a whole.
- Return type:
[
object
]
Gets an AtkAttributeSet which describes document-wide attributes as name-value pairs.
New in version 1.12.
- do_get_document_locale() virtual¶
- Returns:
a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of the document content as a whole, or
None
if the document content does not specify a locale.- Return type:
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
.Deprecated since version 2.7.90: Please use
Atk.Object.get_object_locale
() instead.
- do_get_document_type() virtual¶
- Returns:
a string indicating the document type
- Return type:
Gets a string indicating the document type.
Deprecated since version 2.12: Please use
Atk.Document.get_attributes
() to ask for the document type if it applies.
- do_get_page_count() virtual¶
- Returns:
total page count of document, or -1 if not implemented, not know by the implementor or irrelevant.
- Return type:
Retrieves the total number of pages inside document.
New in version 2.12.
- do_get_text_selections() virtual¶
- Returns:
a
GLib.Array
ofAtk.TextSelection
structures representing the selection.- Return type:
Returns an array of AtkTextSelections within this document.
New in version 2.52.
- do_set_document_attribute(attribute_name, attribute_value) virtual¶
- Parameters:
- Returns:
True
if attribute_value is successfully associated with attribute_name for this document, andFalse
if if the document does not allow the attribute to be modified- Return type:
Sets the value for the given attribute_name inside document.
New in version 1.12.
- do_set_text_selections(selections) virtual¶
- Parameters:
selections ([
Atk.TextSelection
]) – aGLib.Array
of AtkTextSelections to be selected.- Returns:
True
if the selection was made successfully;False
otherwise.- Return type:
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.New in version 2.52.
Signal Details¶
- Atk.Document.signals.document_attribute_changed(document, arg1, arg2)¶
- Signal Name:
document-attribute-changed
- Flags:
- Parameters:
document (
Atk.Document
) – The object which received the signalarg1 (
str
) – the name of the attribute being modified, orNone
if not available.arg2 (
str
) – the attribute’s new value, or %null if not available.
The “document-attribute-changed” signal should be emitted when there is a change to one of the document attributes returned by
Atk.Document.get_attributes
.New in version 2.52.
- Atk.Document.signals.load_complete(document)¶
- Signal Name:
load-complete
- Flags:
- Parameters:
document (
Atk.Document
) – The object which received the signal
The ‘load-complete’ signal is emitted when a pending load of a static document has completed. This signal is to be expected by ATK clients if and when
Atk.Document
implementors exposeAtk.StateType.BUSY
. If the state of anAtk.Object
which implementsAtk.Document
does not includeAtk.StateType.BUSY
, it should be safe for clients to assume that theAtk.Document
's static contents are fully loaded into the container. (Dynamic document contents should be exposed via other signals.)
- Atk.Document.signals.load_stopped(document)¶
- Signal Name:
load-stopped
- Flags:
- Parameters:
document (
Atk.Document
) – The object which received the signal
The ‘load-stopped’ signal is emitted when a pending load of document contents is cancelled, paused, or otherwise interrupted by the user or application logic. It should not however be emitted while waiting for a resource (for instance while blocking on a file or network read) unless a user-significant timeout has occurred.
- Atk.Document.signals.page_changed(document, page_number)¶
- Signal Name:
page-changed
- Flags:
- Parameters:
document (
Atk.Document
) – The object which received the signalpage_number (
int
) – the new page number. If this value is unknown or not applicable, -1 should be provided.
The ‘page-changed’ signal is emitted when the current page of a document changes, e.g. pressing page up/down in a document viewer.
New in version 2.12.
- Atk.Document.signals.reload(document)¶
- Signal Name:
reload
- Flags:
- Parameters:
document (
Atk.Document
) – The object which received the signal
The ‘reload’ signal is emitted when the contents of a document is refreshed from its source. Once ‘reload’ has been emitted, a matching ‘load-complete’ or ‘load-stopped’ signal should follow, which clients may await before interrogating ATK for the latest document content.