mate-url

## mate-url mate-url — Display urls using appropriate viewers. |

## Synopsis

    #include <libmate/libmate.h>

    enum                MateURLError;
    #define             MATE_URL_ERROR
    gboolean            mate_url_show                      (const char *url,
                                                             GError **error);
    gboolean            mate_url_show_with_env             (const char *url,
                                                             char **envp,
                                                             GError **error);

## Description

A MATE 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 MateURLError

    typedef enum {
      MATE_URL_ERROR_PARSE,
      MATE_URL_ERROR_LAUNCH,
      MATE_URL_ERROR_URL,
      MATE_URL_ERROR_NO_DEFAULT,
      MATE_URL_ERROR_NOT_SUPPORTED,
      MATE_URL_ERROR_VFS,
      MATE_URL_ERROR_CANCELLED
    } MateURLError;

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

`MATE_URL_ERROR_PARSE` | The parsing of the handler failed.
`MATE_URL_ERROR_LAUNCH` |
`MATE_URL_ERROR_URL` |
`MATE_URL_ERROR_NO_DEFAULT` |
`MATE_URL_ERROR_NOT_SUPPORTED` |
`MATE_URL_ERROR_VFS` |
`MATE_URL_ERROR_CANCELLED` |

### MATE_URL_ERROR

    #define MATE_URL_ERROR (mate_url_error_quark ())

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

### mate_url_show ()

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

Once the input has been converted into a fully qualified url this function calls mate_vfs_url_show. Any error codes returned by mate-vfs will be wrapped in the error parameter. All errors comes from the `MATE_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 mate_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).

### mate_url_show_with_env ()

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

Like `mate_url_show()`, but mate_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).

Since 2.2