GOffice.FileSaver

g GObject.Object GObject.Object GOffice.FileSaver GOffice.FileSaver GObject.Object->GOffice.FileSaver

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

for_file_name (file_name)

class

for_id (id)

class

for_mime_type (mime_type)

class

get_default ()

class

new (id, extension, description, level, save_func)

get_description ()

get_extension ()

get_format_level ()

get_id ()

get_mime_type ()

get_save_scope ()

register ()

register_as_default (priority)

save (io_context, view, output)

set_export_options (doc, options)

set_overwrite_files (overwrite)

set_save_scope (scope)

unregister ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

description

str

r/w

The description of the saver.

extension

str

r/w

The standard file name extension of the saver.

format-level

GOffice.FileFormatLevel

r/w

?

id

str

r/w/co

The identifier of the saver.

interactive-only

bool

r/w

True if this saver requires interaction

mime-type

str

r/w

The MIME type of the saver.

overwrite

bool

r/w

Whether the saver will overwrite files.

scope

GOffice.FileSaveScope

r/w

How much of a document is saved

sheet-selection

bool

r/w

True if this saver supports saving a subset of all sheet

Signals

Inherited:

GObject.Object (1)

Name

Short Description

set-export-options

Fields

Inherited:

GObject.Object (1)

Class Details

class GOffice.FileSaver(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GOffice.FileSaverClass

classmethod for_file_name(file_name)
Parameters:

file_name (str) – name

Returns:

GOffice.FileSaver for file_name

Return type:

GOffice.FileSaver or None

Searches for file saver matching the given file_name, registered using GOffice.FileSaver.register.

classmethod for_id(id)
Parameters:

id (str) – File saver’s ID

Returns:

GOffice.FileSaver with given id.

Return type:

GOffice.FileSaver or None

Searches for file saver with given id, registered using GOffice.FileSaver.register or register_file_opener_as_default.

classmethod for_mime_type(mime_type)
Parameters:

mime_type (str) – A mime type

Returns:

A GOffice.FileSaver object associated with mime_type.

Return type:

GOffice.FileSaver or None

classmethod get_default()
Returns:

GOffice.FileSaver for the highest priority default saver.

Return type:

GOffice.FileSaver or None

Finds file saver registered as default saver with the highest priority. Reference GOffice.count for the saver is NOT incremented.

classmethod new(id, extension, description, level, save_func)
Parameters:
Returns:

newly created GOffice.FileSaver object.

Return type:

GOffice.FileSaver

Creates new GOffice.FileSaver object. Optional id will be used after registering it with GOffice.FileSaver.register or GOffice.FileSaver.register_as_default function.

get_description()
Returns:

The description of self.

Return type:

str

get_extension()
Returns:

The default extensions for files saved by self.

Return type:

str or None

get_format_level()
Returns:

The format level of self.

Return type:

GOffice.FileFormatLevel

get_id()
Returns:

The id of self.

Return type:

str or None

get_mime_type()
Returns:

The mime type of the self.

Return type:

str or None

get_save_scope()
Returns:

The save scope of self.

Return type:

GOffice.FileSaveScope

register()

Adds self saver to the list of available file savers, making it available for the user when selecting file format for save.

register_as_default(priority)
Parameters:

priority (int) – Saver’s priority

Adds self saver to the list of available file savers, making it available for the user when selecting file format for save. The saver is also marked as default saver with given priority. When Gnumeric needs default file saver, it chooses the one with the highest priority. Recommended range for priority is [0, 100].

save(io_context, view, output)
Parameters:

Saves wbv and the GOffice.workbook it is attached to into output stream. Results are reported using io_context object, use GOffice.io_error_occurred to find out if operation was successful. It’s possible that file_name is created and contain some data if operation fails, you should remove the file in that case.

set_export_options(doc, options)
Parameters:
Raises:

GLib.Error

Return type:

bool

set_overwrite_files(overwrite)
Parameters:

overwrite (bool) – A boolean GOffice.value saying whether the saver should overwrite existing files.

Changes behaviour of the saver when saving a file. If overwrite is set to True, existing file will be overwritten. Otherwise, the saver will report an error without saving anything.

set_save_scope(scope)
Parameters:

scope (GOffice.FileSaveScope) –

unregister()

Removes self saver from list of available file savers. Reference GOffice.count for the saver is decremented inside the function.

Signal Details

GOffice.FileSaver.signals.set_export_options(file_saver, object, p0, p1)
Signal Name:

set-export-options

Flags:

RUN_LAST

Parameters:
Return type:

bool

Property Details

GOffice.FileSaver.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The description of the saver.

GOffice.FileSaver.props.extension
Name:

extension

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The standard file name extension of the saver.

GOffice.FileSaver.props.format_level
Name:

format-level

Type:

GOffice.FileFormatLevel

Default Value:

GOffice.FileFormatLevel.NEW

Flags:

READABLE, WRITABLE

?

GOffice.FileSaver.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The identifier of the saver.

GOffice.FileSaver.props.interactive_only
Name:

interactive-only

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

True if this saver requires interaction

GOffice.FileSaver.props.mime_type
Name:

mime-type

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The MIME type of the saver.

GOffice.FileSaver.props.overwrite
Name:

overwrite

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

Whether the saver will overwrite files.

GOffice.FileSaver.props.scope
Name:

scope

Type:

GOffice.FileSaveScope

Default Value:

GOffice.FileSaveScope.WORKBOOK

Flags:

READABLE, WRITABLE

How much of a document is saved

GOffice.FileSaver.props.sheet_selection
Name:

sheet-selection

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

True if this saver supports saving a subset of all sheet