Trait atk::prelude::DocumentExt[][src]

pub trait DocumentExt: 'static {
    fn attribute_value(&self, attribute_name: &str) -> Option<GString>;
fn current_page_number(&self) -> i32;
fn document_type(&self) -> Option<GString>;
fn page_count(&self) -> i32;
fn set_attribute_value(
        &self,
        attribute_name: &str,
        attribute_value: &str
    ) -> bool;
fn connect_load_complete<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_load_stopped<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_page_changed<F: Fn(&Self, i32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_reload<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; }
Expand description

Trait containing all Document methods.

Implementors

Document, NoOpObject

Required methods

Retrieves the value of the given attribute_name inside self.

attribute_name

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.

Retrieves the current page number inside self.

Returns

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

Gets a string indicating the document type.

Deprecated

Since 2.12. Please use atk_document_get_attributes() to ask for the document type if it applies.

Returns

a string indicating the document type

Retrieves the total number of pages inside self.

Returns

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

Sets the value for the given attribute_name inside self.

attribute_name

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

attribute_value

a string value to be associated with attribute_name.

Returns

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

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 AtkDocument implementors expose ATK_STATE_BUSY. If the state of an AtkObject which implements AtkDocument does not include ATK_STATE_BUSY, it should be safe for clients to assume that the AtkDocument’s static contents are fully loaded into the container. (Dynamic document contents should be exposed via other signals.)

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.

The ‘page-changed’ signal is emitted when the current page of a document changes, e.g. pressing page up/down in a document viewer.

page_number

the new page number. If this value is unknown or not applicable, -1 should be provided.

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.

Implementors