EphyEmbedSingle

## EphyEmbedSingle EphyEmbedSingle — An interface to the global embedded browser |

## Synopsis

    void        ephy_embed_single_clear_cache   (EphyEmbedSingle *single);
    void        ephy_embed_single_clear_auth_cache
                                                (EphyEmbedSingle *single);
    void        ephy_embed_single_set_offline_mode
                                                (EphyEmbedSingle *single,
                                                 gboolean offline);
    GList*      ephy_embed_single_get_font_list (EphyEmbedSingle *single,
                                                 const char *lang_group);
    GtkWidget*  ephy_embed_single_open_window   (EphyEmbedSingle *single,
                                                 EphyEmbed *parent,
                                                 const char *address,
                                                 const char *name,
                                                 const char *features);

## Description

While Epiphany is running, its global embed_shell variable (an EphyEmbedShell) holds a reference to an EphyEmbedSingle. The only class which implements EphyEmbedSingle is MozillaEmbedSingle, so the two types are interchangeable via casting.

Example 2. Acquiring an EphyEmbedSingle

    #include <ephy-embed-shell.h>
    #include <ephy-embed-single.h>

    EphyEmbedSingle *ephy_single;

    /* embed_shell is a global variable, initialized as Epiphany starts */
    ephy_single = ephy_embed_shell_get_embed_single (embed_shell);

Since there is only one EphyEmbedShell, there is only one EphyEmbedSingle. It is used to perform browser-related actions which do not refer to an individual EphyEmbed.

## Details

### ephy_embed_single_clear_cache ()

    void        ephy_embed_single_clear_cache   (EphyEmbedSingle *single);

Clears the Mozilla cache (temporarily saved web pages).

`single` : | the EphyEmbedSingle

### ephy_embed_single_clear_auth_cache ()

    void        ephy_embed_single_clear_auth_cache
                                                (EphyEmbedSingle *single);

Clears the Mozilla HTTP authentication cache.

This does not clear regular website passwords; it only clears the HTTP authentication cache. Websites which use HTTP authentication require the browser to send a password along with every HTTP request; the browser will ask the user for the password once and then cache the password for subsequent HTTP requests. This function will clear the HTTP authentication cache, meaning the user will have to re-enter a username and password the next time Epiphany requests a web page secured with HTTP authentication.

`single` : | the EphyEmbedSingle

### ephy_embed_single_set_offline_mode ()

    void        ephy_embed_single_set_offline_mode
                                                (EphyEmbedSingle *single,
                                                 gboolean offline);

Sets the state of the network connection.

`single` : | the EphyEmbedSingle
`offline` : | `TRUE` to disable networking

### ephy_embed_single_get_font_list ()

    GList*      ephy_embed_single_get_font_list (EphyEmbedSingle *single,
                                                 const char *lang_group);

Returns the list of fonts matching `lang_group`, or all fonts if `lang_group` is `NULL`.

The available `lang_group` arguments are listed in Epiphany's Fonts and Colors preferences.

`single` : | the EphyEmbedSingle
`lang_group` : | a mozilla font language group name, or `NULL`
Returns : | a list of font names

### ephy_embed_single_open_window ()

    GtkWidget*  ephy_embed_single_open_window   (EphyEmbedSingle *single,
                                                 EphyEmbed *parent,
                                                 const char *address,
                                                 const char *name,
                                                 const char *features);

Opens a new window, as if it were opened in `parent` using the Javascript method and arguments: `window.open("`address`", "_blank", "`features`");`.

`single` : | the EphyEmbedSingle
`parent` : | the requested window's parent EphyEmbed
`address` : | the URL to load
`name` : | a name for the window
`features` : | a Javascript features string
Returns : | the new embed. This is either a EphyEmbed, or, when `features` specified "chrome", a GtkMozEmbed. NOTE: Use `ephy_shell_new_tab()` unless this handling of the `features` string is required.