Atk.Document¶
- Implementations:
Methods¶
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
Properties¶
None
Signals¶
Name |
Short Description |
---|---|
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.
- 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.
- 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_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.
Signal Details¶
- 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.