## BrowserCore

BrowserCore — Singleton holding the global browser information

## Synopsis

                        BrowserCorePrivate;
    GSList *            (*BrowserCoreInitFactories)         (void);
                        BrowserCore;
    gboolean            browser_core_exists                 (void);
    BrowserCore *       browser_core_get                    (void);
    void                browser_core_take_window            (BrowserWindow *bwin);
    GSList *            browser_core_get_windows            (void);
    void                browser_core_close_window           (BrowserWindow *bwin);
    void                browser_core_take_connection        (BrowserConnection *bcnc);
    GSList *            browser_core_get_connections        (void);
    void                browser_core_close_connection       (BrowserConnection *bcnc);
    void                browser_core_quit                   (void);
                        BrowserPerspectiveFactory;
    BrowserPerspectiveFactory * browser_core_get_default_factory
                                                            (void);
    void                browser_core_set_default_factory    (const gchar *factory);
    const GSList *      browser_core_get_factories          (void);
    BrowserPerspectiveFactory * browser_core_get_factory    (const gchar *factory);

## Object Hierarchy

      GObject
       +----BrowserCore

## Signals

      "connection-added"                               : Run First
      "connection-removed"                             : Run First

## Description

A single instance of a BrowserCore is created when the browser is started, accessible using `browser_core_get()`.

## Details

### BrowserCorePrivate

    typedef struct _BrowserCorePrivate BrowserCorePrivate;

### BrowserCoreInitFactories ()

    GSList *            (*BrowserCoreInitFactories)         (void);

### BrowserCore

    typedef struct _BrowserCore BrowserCore;

### browser_core_exists ()

    gboolean            browser_core_exists                 (void);

Tells if a BrowserCore has already been created

Returns : | `TRUE` if the BrowserCore singleton has already been created

### browser_core_get ()

    BrowserCore *       browser_core_get                    (void);

Returns a BrowserCore object which holds the browser's configuration. This is a singleton factory.

Returns : | the BrowserCore object

### browser_core_take_window ()

    void                browser_core_take_window            (BrowserWindow *bwin);

Makes sure `bwin` is handled by the BrowserCore object, reference to `bwin` is stolen here. This method should be called after a BrowserWindow has been created to have it managed properly.

`bwin` : | a BrowserWindow

### browser_core_get_windows ()

    GSList *            browser_core_get_windows            (void);

Get a list of BrowserWindow mananged by the browser (windows must have been declared using `browser_core_take_window()`).

Returns : | a new list, free it with `g_slist_free()`

### browser_core_close_window ()

    void                browser_core_close_window           (BrowserWindow *bwin);

Requests that `bwin` be closed.

`bwin` : | a BrowserWindow

### browser_core_take_connection ()

    void                browser_core_take_connection        (BrowserConnection *bcnc);

Makes sure `bcnc` is handled by `dbata`, reference to `bcnc` is stolen here

`bcnc` : | a BrowserConnection

### browser_core_get_connections ()

    GSList *            browser_core_get_connections        (void);

Get a list of BrowserWindow

Returns : | a new list, free it with `g_slist_free()`

### browser_core_close_connection ()

    void                browser_core_close_connection       (BrowserConnection *bcnc);

Requests that `bcnc` be closed.

`bcnc` : | a BrowserConnection

### browser_core_quit ()

    void                browser_core_quit                   (void);

Quits the browser after having made some clean-ups

### BrowserPerspectiveFactory

    typedef struct {
    	const gchar          *perspective_name;
    	const gchar          *menu_shortcut;
    	BrowserPerspective *(*perspective_create) (BrowserWindow *);
    } BrowserPerspectiveFactory;

### browser_core_get_default_factory ()

    BrowserPerspectiveFactory * browser_core_get_default_factory
                                                            (void);

Get the default BrowserPerspectiveFactory used when making new BrowserWindow if none is provided when calling `browser_window_new()`.

Returns : | the default BrowserPerspectiveFactory

### browser_core_set_default_factory ()

    void                browser_core_set_default_factory    (const gchar *factory);

Sets the default BrowserPerspectiveFactory used when making new BrowserWindow if none is provided when calling `browser_window_new()`.

`factory` : | the name of a BrowserPerspectiveFactory

### browser_core_get_factories ()

    const GSList *      browser_core_get_factories          (void);

Get a list of all the known Perspective factories

Returns : | a constant list which must not be altered

### browser_core_get_factory ()

    BrowserPerspectiveFactory * browser_core_get_factory    (const gchar *factory);

Get a pointer to a BrowserPerspectiveFactory, from its name

`factory` : | the name of the requested factory
Returns : | a pointer to the BrowserPerspectiveFactory, or `NULL` if not found

## Signal Details

### The `"connection-added"` signal

    void                user_function                      (BrowserCore       *browsercore,
                                                            BrowserConnection *arg1,
                                                            gpointer           user_data)        : Run First

`browsercore` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"connection-removed"` signal

    void                user_function                      (BrowserCore       *browsercore,
                                                            BrowserConnection *arg1,
                                                            gpointer           user_data)        : Run First

`browsercore` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.