gnome-url

Name

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);
GQuark      gnome_url_error_quark           (void);

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
} GnomeURLError;

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


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);

Displays the given URL in an appropriate viewer. The appropriate viewer is user definable. It is determined by extracting the protocol from the url, then seeing if the /desktop/gnome/url-handlers//command key exists in the configuration database. It it does, this entry is used as the template for the command.

If no protocol specific handler exists, the /desktop/gnome/url-handlers/unknown/command key is used to determine the viewer.

Once a viewer is determined, it is called with the url as a parameter. If any errors occur, they are returned in the error parameter. These errors will either be in the GNOME_URL_ERROR, GNOME_SHELL_ERROR, or G_SPAWN_ERROR domains.


gnome_url_error_quark ()

GQuark      gnome_url_error_quark           (void);