Support functions: GdaBrowser hacking manual

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

## Stability Level

Stable, unless otherwise indicated

## Functions

BrowserConnection * | browser_connection_open ()
gboolean | browser_connection_close ()
void | browser_show_error ()
void | browser_show_message ()
void | browser_show_help ()
GtkWidget * | browser_make_tab_label_with_stock ()
GtkWidget * | browser_make_tab_label_with_pixbuf ()
GtkWidget * | browser_make_small_button ()
GtkWidget * | browser_make_tree_view ()
GtkWidget * | browser_find_parent_widget ()
GdkPixbuf * | browser_get_pixbuf_icon ()
GdaDataModel * | browser_get_connections_list ()

## Types and Values

enum | BrowserIconType

## Description

## Functions

### browser_connection_open ()

    BrowserConnection *
    browser_connection_open (GError **error);

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

#### Parameters

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`

#### Parameters

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

#### Parameters

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

#### Parameters

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

### browser_show_help ()

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

#### Parameters

topic | the help topic, or `NULL` for the global index. | [allow-none]

### 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.

#### Parameters

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.

### 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.

## Types and Values

### enum BrowserIconType

#### Members

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_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 |  |