Next: , Previous: gnome-vfs-mime-utils, Up: Top


15 MIME Database

functions for getting information about applications and components associated with MIME types.

15.1 Overview

This API can be used to query the applications and components associated with particular MIME types, and to collect extra information about them, and also provides a convenience function for launching them. Applications can register themselves for particular MIME types by adhering to the Freedesktop.Org Desktop Entry Specification.

15.2 Usage

— Class: <gnome-vfs-mime-application>

Opaque pointer.

This class defines no direct slots.

— Function: gnome-vfs-mime-get-all-applications (mime_type mchars) ⇒  (ret glist-of)

Return an alphabetically sorted list of <gnome-vfs-mime-application> data structures representing all applications in the MIME database registered to handle files of MIME type mime-type (and supertypes).

mime-type
a const char * containing a mime type, e.g. "image/png".
ret
a <g-list> * where the elements are <gnome-vfs-mime-application> * representing applications that handle MIME type mime-type.
— Function: gnome-vfs-mime-get-all-components (mime_type mchars) ⇒  (ret glist-of)

gnome_vfs_mime_get_all_components’ is deprecated and should not be used in newly-written code.

mime-type

ret
— Function: gnome-vfs-mime-get-description (mime_type mchars) ⇒  (ret mchars)

Query the MIME database for a description of the mime-type.

mime-type
the mime type.
ret
description of MIME type mime-type.
— Function: gnome-vfs-mime-can-be-executable (mime_type mchars) ⇒  (ret bool)

Check whether files of mime-type might conceivably be executable. Default for known types if ‘#f’. Default for unknown types is ‘#t’.

mime-type
a const char * containing a mime type.
ret
#t’ if files of mime-type can be executable, ‘#f’ otherwise.
— Function: gnome-vfs-mime-application-launch (self <gnome-vfs-mime-application>) (uris glist-of) ⇒  (ret <gnome-vfs-result>)

Launches the given mime application with the given parameters. Command line parameters will be expanded as required by the application. The application will also be launched in a terminal if that is required. If the application only supports one argument per instance then multiple instances of the application will be launched.

app
the <gnome-vfs-mime-application> to launch.
uris
parameters for the <gnome-vfs-mime-application>.
ret
GNOME_VFS_OK’ if the application was launched. ‘GNOME_VFS_ERROR_NOT_SUPPORTED’ if the uri protocol is not supported by the application. ‘GNOME_VFS_ERROR_PARSE’ if the application command can not be parsed. ‘GNOME_VFS_ERROR_LAUNCH’ if the application command can not be launched. ‘GNOME_VFS_ERROR_INTERNAL’ for other internal and GConf errors.

Since 2.4

— Function: gnome-vfs-mime-application-get-name (self <gnome-vfs-mime-application>) ⇒  (ret mchars)

Returns the name of the application app

app
a <gnome-vfs-mime-application>.
ret
the name of the application.

Since 2.10

— Function: gnome-vfs-mime-application-get-icon (self <gnome-vfs-mime-application>) ⇒  (ret mchars)

Returns an icon representing the specified application.

app
a <gnome-vfs-mime-application>.
ret
the filename of the icon usually without path information, e.g. "gedit-icon.png", and sometimes does not have an extension, e.g. "gnome-pdf" if the icon is supposed to be image type agnostic between icon themes. Icons are generic, and not theme specific.

Since 2.10

— Function: gnome-vfs-mime-application-get-exec (self <gnome-vfs-mime-application>) ⇒  (ret mchars)

Returns the program to execute, possibly with arguments and parameter variables, as specified by the Desktop Entry Specification.

app
a <gnome-vfs-mime-application>.
ret
the command line to execute.

Since 2.10

— Function: gnome-vfs-mime-application-equal (self <gnome-vfs-mime-application>) (app_b <gnome-vfs-mime-application>) ⇒  (ret bool)

Compare app-a and app-b.

app-a
a <gnome-vfs-mime-application>.
app-b
a <gnome-vfs-mime-application>.
ret
#t’ if app-a and app-b are equal, ‘#f’ otherwise.

Since 2.10