GOffice.FileOpener¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | for_id(id) | 
| class | new(id, description, suffixes, mimes, probe_func, open_func) | 
| class | new_with_enc(id, description, suffixes, mimes, probe_func, open_func) | 
| can_probe(pl) | |
| get_description() | |
| get_id() | |
| get_mimes() | |
| get_suffixes() | |
| is_encoding_dependent() | |
| open(opt_enc, io_context, view, input) | |
| probe(input, pl) | |
| register(priority) | |
| unregister() | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| description | str | r/w | The description of the opener | 
| id | str | r | The identifier of the opener | 
| interactive-only | bool | r/w | Trueif this opener requires interaction | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class GOffice.FileOpener(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - GOffice.FileOpenerClass- 
classmethod for_id(id)¶
- Parameters: - id ( - str) – File opener’s ID- Returns: - GOffice.FileOpenerwith given id.- Return type: - GOffice.FileOpeneror- None- Searches for file opener with given id, registered using - GOffice.FileOpener.register
 - 
classmethod new(id, description, suffixes, mimes, probe_func, open_func)¶
- Parameters: - id (strorNone) – Optional ID of the opener
- description (str) – Description of supported file format
- suffixes ([str]) – List of suffixes to associate with the opener
- mimes ([str]) – List of mime types to associate with the opener
- probe_func (GOffice.FileOpenerProbeFuncorNone) – “probe” function
- open_func (GOffice.FileOpenerOpenFunc) – “open” function
 - Returns: - newly created - GOffice.FileOpenerobject.- Return type: - Creates new - GOffice.FileOpenerobject. Optional id will be used after registering it with- GOffice.FileOpener.registerfunction.
- id (
 - 
classmethod new_with_enc(id, description, suffixes, mimes, probe_func, open_func)¶
- Parameters: - id (strorNone) – Optional ID of the opener
- description (str) – Description of supported file format
- suffixes ([str]) – List of suffixes to associate with the opener
- mimes ([str]) – List of mime types to associate with the opener
- probe_func (GOffice.FileOpenerProbeFuncorNone) – “probe” function
- open_func (GOffice.FileOpenerOpenFuncWithEnc) – “open” function
 - Returns: - newly created - GOffice.FileOpenerobject.- Return type: - Creates new - GOffice.FileOpenerobject. Optional id will be used after registering it with- GOffice.FileOpener.registerfunction.
- id (
 - 
can_probe(pl)¶
- Parameters: - pl ( - GOffice.FileProbeLevel) – probe level- Returns: - Trueif self has a probe function- Return type: - bool
 - 
open(opt_enc, io_context, view, input)¶
- Parameters: - opt_enc (strorNone) – Optional encoding
- io_context (GOffice.IOContext) – Context for i/o operation
- view (GOffice.View) –GOffice.View
- input (Gsf.Input) – Gsf input stream
 - Reads content of file_name file into - GOffice.workbookwbv is attached to. Results are reported using io_context object, use- GOffice.io_error_occurredto find out if operation was successful. The state of wbv and its- GOffice.workbookis undefined if operation fails, you should destroy them in that case.
- opt_enc (
 - 
probe(input, pl)¶
- Parameters: - input (Gsf.Input) –Gsf.Input
- pl (GOffice.FileProbeLevel) –GOffice.FileProbeLevel
 - Returns: - True, if the opener can read given file and- Falseotherwise.- Return type: - Checks if a given file is supported by the opener. 
- input (
 - 
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.countfor the opener is incremented inside the function, but you don’t have to (and shouldn’t) call- GObject.Object.unrefon it if it’s floating object (for example, when you pass object newly created with- GOffice.FileOpener.newand not referenced anywhere).
 - 
unregister()¶
- Removes self opener from list of available file openers. Reference - GOffice.countfor the opener is decremented inside the function.
 
- 
classmethod