Support functions

## Support functions Support functions — Misc. functions for various situations |

## Synopsis

    BrowserConnection * browser_connection_open             (GError **error);
    gboolean            browser_connection_close            (GtkWindow *parent,
                                                             BrowserConnection *bcnc);

    void                browser_show_error                  (GtkWindow *parent,
                                                             const gchar *format,
                                                             ...);
    void                browser_show_message                (GtkWindow *parent,
                                                             const gchar *format,
                                                             ...);
    void                browser_show_help                   (GtkWindow *parent,
                                                             const gchar *topic);

    GtkWidget *          browser_make_tab_label_with_stock  (const gchar *label,
                                                             const gchar *stock_id,
                                                             gboolean with_close,
                                                             GtkWidget **out_close_button);
    GtkWidget *          browser_make_tab_label_with_pixbuf (const gchar *label,
                                                             GdkPixbuf *pixbuf,
                                                             gboolean with_close,
                                                             GtkWidget **out_close_button);
    GtkWidget *         browser_make_small_button           (gboolean is_toggle,
                                                             gboolean with_arrow,
                                                             const gchar *label,
                                                             const gchar *stock_id,
                                                             const gchar *tooltip);
    GtkWidget *         browser_make_tree_view              (GtkTreeModel *model);

    GtkWidget *         browser_find_parent_widget          (GtkWidget *current,
                                                             GType requested_type);

    enum                BrowserIconType;
    GdkPixbuf *         browser_get_pixbuf_icon             (BrowserIconType type);

    GdaDataModel *      browser_get_connections_list        (void);

## Description

## Details

### browser_connection_open ()

    BrowserConnection * browser_connection_open             (GError **error);

Display a login dialog and, if validated, create a new BrowserConnection

`error` : | a place to store errors, or `NULL`
Returns : | a new BrowserConnection, or `NULL` (the caller DOES NOT OWN a reference to the returned value)

### browser_connection_close ()

    gboolean            browser_connection_close            (GtkWindow *parent,
                                                             BrowserConnection *bcnc);

Displays a warning dialog and close `bcnc`

`parent` : | a GtkWindow
`bcnc` : | a BrowserConnection object
Returns : | `TRUE` if the connection has been closed

### browser_show_error ()

    void                browser_show_error                  (GtkWindow *parent,
                                                             const gchar *format,
                                                             ...);

Displays an error message until the user aknowledges it. I `parent` is a BrowserWindow, then the error message is displayed in the window if possible

`parent` : | a GtkWindow
`format` : | printf() style format string
`...` : | arguments for `format`

### browser_show_message ()

    void                browser_show_message                (GtkWindow *parent,
                                                             const gchar *format,
                                                             ...);

Displays an error message until the user aknowledges it. I `parent` is a BrowserWindow, then the error message is displayed in the window if possible

`parent` : | a GtkWindow
`format` : | printf() style format string
`...` : | arguments for `format`

### browser_show_help ()

    void                browser_show_help                   (GtkWindow *parent,
                                                             const gchar *topic);

`topic` : | the help topic, or `NULL` for the global index

### browser_make_tab_label_with_stock ()

    GtkWidget *          browser_make_tab_label_with_stock  (const gchar *label,
                                                             const gchar *stock_id,
                                                             gboolean with_close,
                                                             GtkWidget **out_close_button);

### browser_make_tab_label_with_pixbuf ()

    GtkWidget *          browser_make_tab_label_with_pixbuf (const gchar *label,
                                                             GdkPixbuf *pixbuf,
                                                             gboolean with_close,
                                                             GtkWidget **out_close_button);

### browser_make_small_button ()

    GtkWidget *         browser_make_small_button           (gboolean is_toggle,
                                                             gboolean with_arrow,
                                                             const gchar *label,
                                                             const gchar *stock_id,
                                                             const gchar *tooltip);

Creates a small button

Returns : | a new GtkWidget

### browser_make_tree_view ()

    GtkWidget *         browser_make_tree_view              (GtkTreeModel *model);

Creates a GtkTreeView which, when right clicked, selects the row underneath the mouse cursor.

`model` : | a GtkTreeModel
Returns : | a new GtkWidget

### browser_find_parent_widget ()

    GtkWidget *         browser_find_parent_widget          (GtkWidget *current,
                                                             GType requested_type);

Finds the 1st parent widget of `current` which is of the `requested_type` type.

### enum BrowserIconType

    typedef enum {
    	BROWSER_ICON_BOOKMARK,
    	BROWSER_ICON_SCHEMA,
    	BROWSER_ICON_TABLE,
    	BROWSER_ICON_COLUMN,
    	BROWSER_ICON_COLUMN_PK,
    	BROWSER_ICON_COLUMN_FK,
    	BROWSER_ICON_COLUMN_FK_NN,
    	BROWSER_ICON_COLUMN_NN,
    	BROWSER_ICON_REFERENCE,
    	BROWSER_ICON_DIAGRAM,
    	BROWSER_ICON_QUERY,
    	BROWSER_ICON_ACTION,

    	BROWSER_ICON_GRID,
    	BROWSER_ICON_FORM,

    	BROWSER_ICON_MENU_INDICATOR,

    	BROWSER_ICON_LDAP_ENTRY,
    	BROWSER_ICON_LDAP_GROUP,
    	BROWSER_ICON_LDAP_ORGANIZATION,
    	BROWSER_ICON_LDAP_PERSON,
    	BROWSER_ICON_LDAP_CLASS_STRUCTURAL,
    	BROWSER_ICON_LDAP_CLASS_ABSTRACT,
    	BROWSER_ICON_LDAP_CLASS_AUXILIARY,
    	BROWSER_ICON_LDAP_CLASS_UNKNOWN,

    	BROWSER_ICON_LAST
    } BrowserIconType;

### browser_get_pixbuf_icon ()

    GdkPixbuf *         browser_get_pixbuf_icon             (BrowserIconType type);

Get a pointer to an internal GdkPixbuf for the requested `type`. Don't unref it!

Returns : | an already existing GdkPixbuf, or `NULL` if the icon was not found

### browser_get_connections_list ()

    GdaDataModel *      browser_get_connections_list        (void);

Creates a unique instance of tree model listing all the connections, and returns a pointer to it. The object will always exist after it has been created, so no need to reference it.

Returns : | a pointer to the GtkTreeModel, the caller must not assume it has a reference to it.