GXPS.File

g GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object GXPS.File GXPS.File GObject.Object->GXPS.File Gio.Initable->GXPS.File

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

error_quark ()

class

new (filename)

get_core_properties ()

get_document (n_doc)

get_document_for_link_target (target)

get_n_documents ()

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

Properties

Name

Type

Flags

Short Description

file

Gio.File

w/co

The file file

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class GXPS.File(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

No

Structure:

GXPS.FileClass

The GXPS.File struct contains only private fields and should not be directly accessed.

classmethod error_quark()
Return type:

int

classmethod new(filename)
Parameters:

filename (Gio.File) – a Gio.File

Raises:

GLib.Error

Returns:

a GXPS.File or None on error.

Return type:

GXPS.File

Creates a new GXPS.File for the given Gio.File.

get_core_properties()
Raises:

GLib.Error

Returns:

a new GXPS.CoreProperties or None. Free the returned object with GObject.Object.unref().

Return type:

GXPS.CoreProperties

Create a GXPS.CoreProperties object containing the metadata of xpsm, or None in case of error or if the GXPS.File doesn’t contain core properties.

get_document(n_doc)
Parameters:

n_doc (int) – the index of the document to get

Raises:

GLib.Error

Returns:

a new GXPS.Document or None on error. Free the returned object with GObject.Object.unref().

Return type:

GXPS.Document

Creates a new GXPS.Document representing the document at index n_doc in self file.

Parameters:

target (GXPS.LinkTarget) – a GXPS.LinkTarget

Returns:

the index of the document pointed by the given GXPS.LinkTarget or -1.

Return type:

int

Gets the index of the document in self pointed by target. If the GXPS.LinkTarget does not reference a document, or referenced document is not found in self file -1 will be returned. In this case you can look for the page pointed by the link target by calling GXPS.Document.get_page_for_anchor() with the anchor of the GXPS.LinkTarget for every document in self.

get_n_documents()
Returns:

the number of documents.

Return type:

int

Gets the number of documents in self.

Property Details

GXPS.File.props.file
Name:

file

Type:

Gio.File

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The file file