GOffice.FileOpener¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The description of the opener |
||
r |
The identifier of the opener |
||
r/w |
|
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class GOffice.FileOpener(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod for_id(id)¶
- Parameters:
id (
str
) – File opener’s ID- Returns:
GOffice.FileOpener
with given id.- Return type:
Searches for file opener with given id, registered using
GOffice.FileOpener.register
- classmethod new(id, description, suffixes, mimes, probe_func, open_func)¶
- Parameters:
description (
str
) – Description of supported file formatsuffixes ([
str
]) – List of suffixes to associate with the openermimes ([
str
]) – List of mime types to associate with the openerprobe_func (
GOffice.FileOpenerProbeFunc
orNone
) – “probe” functionopen_func (
GOffice.FileOpenerOpenFunc
) – “open” function
- Returns:
newly created
GOffice.FileOpener
object.- Return type:
Creates new
GOffice.FileOpener
object. Optional id will be used after registering it withGOffice.FileOpener.register
function.
- classmethod new_with_enc(id, description, suffixes, mimes, probe_func, open_func)¶
- Parameters:
description (
str
) – Description of supported file formatsuffixes ([
str
]) – List of suffixes to associate with the openermimes ([
str
]) – List of mime types to associate with the openerprobe_func (
GOffice.FileOpenerProbeFunc
orNone
) – “probe” functionopen_func (
GOffice.FileOpenerOpenFuncWithEnc
) – “open” function
- Returns:
newly created
GOffice.FileOpener
object.- Return type:
Creates new
GOffice.FileOpener
object. Optional id will be used after registering it withGOffice.FileOpener.register
function.
- can_probe(pl)¶
- Parameters:
pl (
GOffice.FileProbeLevel
) – probe level- Returns:
True
if self has a probe function- Return type:
- open(opt_enc, io_context, view, input)¶
- Parameters:
io_context (
GOffice.IOContext
) – Context for i/o operationview (
GOffice.View
) –GOffice.View
input (
Gsf.Input
) – Gsf input stream
Reads content of file_name file into
GOffice.workbook
wbv is attached to. Results are reported using io_context object, useGOffice.io_error_occurred
to find out if operation was successful. The state of wbv and itsGOffice.workbook
is undefined if operation fails, you should destroy them in that case.
- probe(input, pl)¶
-
Checks if a given file is supported by the opener.
- register(priority)¶
- Parameters:
priority (
int
) – Opener’s priority
Adds self opener to the list of available file openers, making it available for Gnumeric i/o routines. The opener is registered with given priority. The priority is used to determine the order in which openers will be tried when reading a file. The higher the priority, the sooner it will be tried. Default XML-based Gnumeric file opener is registered at priority 50. Recommended range for priority is [0, 100]. Reference
GOffice.count
for the opener is incremented inside the function, but you don’t have to (and shouldn’t) callGObject.Object.unref
on it if it’s floating object (for example, when you pass object newly created withGOffice.FileOpener.new
and not referenced anywhere).
- unregister()¶
Removes self opener from list of available file openers. Reference
GOffice.count
for the opener is decremented inside the function.
Property Details¶
- GOffice.FileOpener.props.description¶
-
The description of the opener
- GOffice.FileOpener.props.id¶
-
The identifier of the opener