## gnome-url

gnome-url — Display urls using appropriate viewers.

## Synopsis

    #include <libgnome/libgnome.h>

    enum        GnomeURLError;
    #define     GNOME_URL_ERROR
    gboolean    gnome_url_show                  (const char *url,
                                                 GError **error);
    gboolean    gnome_url_show_with_env         (const char *url,
                                                 char **envp,
                                                 GError **error);

## Description

A GNOME user can configure which viewers they wish to use to view certain protocols. Protocols can include http, ftp (where "view" might mean "download"), ghelp, etc. This module provides a means for application to display a url without having to worry about which viewer is going to ultimately handle the job.

## Details

### enum GnomeURLError

    typedef enum {
      GNOME_URL_ERROR_PARSE,
      GNOME_URL_ERROR_LAUNCH,
      GNOME_URL_ERROR_URL,
      GNOME_URL_ERROR_NO_DEFAULT,
      GNOME_URL_ERROR_NOT_SUPPORTED,
      GNOME_URL_ERROR_VFS
    } GnomeURLError;

The errors that can be returned due to bad parameters being pass to `gnome_url_show()`.

`GNOME_URL_ERROR_PARSE` | The parsing of the handler failed.
`GNOME_URL_ERROR_LAUNCH` |
`GNOME_URL_ERROR_URL` |
`GNOME_URL_ERROR_NO_DEFAULT` |
`GNOME_URL_ERROR_NOT_SUPPORTED` |
`GNOME_URL_ERROR_VFS` |

### GNOME_URL_ERROR

    #define GNOME_URL_ERROR (gnome_url_error_quark ())

The class (domain) of errors raised by this module.

### gnome_url_show ()

    gboolean    gnome_url_show                  (const char *url,
                                                 GError **error);

Once the input has been converted into a fully qualified url this function calls gnome_vfs_url_show. Any error codes returned by gnome-vfs will be wrapped in the error parameter. All errors comes from the `GNOME_URL_ERROR`% domain.

`url` : | The url or path to display. The path can be relative to the current working directory or the user's home directory. This function will convert it into a fully qualified url using the gnome_url_get_from_input function.
`error` : | Used to store any errors that result from trying to display the `url`.
Returns : | `TRUE` if everything went fine, `FALSE` otherwise (in which case `error` will contain the actual error).

### gnome_url_show_with_env ()

    gboolean    gnome_url_show_with_env         (const char *url,
                                                 char **envp,
                                                 GError **error);

Like `gnome_url_show()`, but gnome_vfs_url_show_with_env will be called with the given envirnoment.

`url` : | The url or path to display.
`envp` : | child's environment, or `NULL` to inherit parent's.
`error` : | Used to store any errors that result from trying to display the `url`.
Returns : | `TRUE` if everything went fine, `FALSE` otherwise (in which case `error` will contain the actual error).