Class: GOffice::FileOpener

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, description, suffixes, mimes, probe_func, open_func) ⇒ GOffice::FileOpener

Creates new GOFile::Opener object. Optional id will be used after registering it with go_file_opener_register function. associate with the opener associate with the opener

Parameters:

  • id (String)

    Optional ID of the opener

  • description (String)

    Description of supported file format

  • suffixes (GLib::SList<String>)

    List of suffixes to

  • mimes (GLib::SList<String>)

    List of mime types to

  • probe_func (GOffice::FileOpenerProbeFunc)

    "probe" function

  • open_func (GOffice::FileOpenerOpenFuncWithEnc)

    "open" function

Class Method Details

.for_id(id) ⇒ GOffice::FileOpener

Searches for file opener with given id, registered using go_file_opener_register

Parameters:

  • id (String)

    File opener's ID

Returns:

Instance Method Details

#can_probe(pl) ⇒ Boolean

Returns true if fo has a probe function.

Parameters:

Returns:

  • (Boolean)

    true if fo has a probe function

#descriptionString

Returns description.

Returns:

  • (String)

    description

#description=(description) ⇒ String

Parameters:

  • description (String)

Returns:

  • (String)

    description

  • (String)

    description

#idString

Returns id.

Returns:

  • (String)

    id

#id=(id) ⇒ String

Parameters:

  • id (String)

Returns:

  • (String)

    id

  • (String)

    id

#interactive_only=(interactive_only) ⇒ Boolean

Parameters:

  • interactive_only (Boolean)

Returns:

  • (Boolean)

    interactive-only

  • (Boolean)

    interactive-only

#interactive_only?Boolean

Returns interactive-only.

Returns:

  • (Boolean)

    interactive-only

#is_encoding_dependentBoolean

Returns true if fo is encoding dependent.

Returns:

  • (Boolean)

    true if fo is encoding dependent

#mimesGLib::SList<String>

Returns the supported mime types.

Returns:

  • (GLib::SList<String>)

    the supported mime types.

#open(opt_enc, io_context, view, input) ⇒ nil

Reads content of file_name file into workbook wbv is attached to. Results are reported using io_context object, use go_io_error_occurred to find out if operation was successful. The state of wbv and its workbook is undefined if operation fails, you should destroy them in that case.

Parameters:

  • opt_enc (String)

    Optional encoding

  • io_context (GOffice::IOContext)

    Context for i/o operation

  • view (GOffice::View)

    Go::View

  • input (Gsf::Input)

    Gsf input stream

Returns:

  • (nil)

#probe(input, pl) ⇒ Boolean

Checks if a given file is supported by the opener.

Parameters:

Returns:

  • (Boolean)

    true, if the opener can read given file and false otherwise.

#register(priority) ⇒ nil

Adds fo 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 count for the opener is incremented inside the function, but you don't have to (and shouldn't) call g_object_unref on it if it's floating object (for example, when you pass object newly created with go_file_opener_new and not referenced anywhere).

Parameters:

  • priority (Integer)

    Opener's priority

Returns:

  • (nil)

#suffixesGLib::SList<String>

supported file types.

Returns:

  • (GLib::SList<String>)

    the suffixes for the

#unregisternil

Removes fo opener from list of available file openers. Reference count for the opener is decremented inside the function.

Returns:

  • (nil)