## GnomeDbBasicForm

GnomeDbBasicForm — A GUI form to present data in a GnomeDbDataSet

## Synopsis

                GnomeDbBasicForm;
    GType       gnome_db_basic_form_get_type    (void);
    GtkWidget*  gnome_db_basic_form_new         (GnomeDbDict *dict,
                                                 GnomeDbDataSet *data_set);
    GtkWidget*  gnome_db_basic_form_new_in_layout
                                                (GnomeDbDict *dict,
                                                 GnomeDbDataSet *data_set,
                                                 GtkWidget *layout,
                                                 GHashTable *box_widgets);
    GtkWidget*  gnome_db_basic_form_new_in_dialog
                                                (GnomeDbDict *dict,
                                                 GnomeDbDataSet *data_set,
                                                 GtkWindow *parent,
                                                 const gchar *title,
                                                 const gchar *header);
    GnomeDbDataSet* gnome_db_basic_form_get_data_set
                                                (GnomeDbBasicForm *form);
    gboolean    gnome_db_basic_form_is_valid    (GnomeDbBasicForm *form);
    gboolean    gnome_db_basic_form_has_been_changed
                                                (GnomeDbBasicForm *form);
    void        gnome_db_basic_form_set_current_as_orig
                                                (GnomeDbBasicForm *form);
    void        gnome_db_basic_form_reset       (GnomeDbBasicForm *form);
    void        gnome_db_basic_form_show_entries_actions
                                                (GnomeDbBasicForm *form,
                                                 gboolean show_actions);
    void        gnome_db_basic_form_entry_show  (GnomeDbBasicForm *form,
                                                 GnomeDbParameter *param,
                                                 gboolean show);
    void        gnome_db_basic_form_entry_set_sensitive
                                                (GnomeDbBasicForm *form,
                                                 GnomeDbParameter *param,
                                                 gboolean sensitive);
    void        gnome_db_basic_form_set_entries_auto_default
                                                (GnomeDbBasicForm *form,
                                                 gboolean auto_default);
    void        gnome_db_basic_form_set_entries_default
                                                (GnomeDbBasicForm *form);

## Object Hierarchy

      GObject
       +----GtkObject
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBox
                               +----GtkVBox
                                     +----GnomeDbBasicForm

## Implemented Interfaces

GnomeDbBasicForm implements AtkImplementorIface.

## Signals

    "param-changed"
                void        user_function      (GnomeDbBasicForm *dbbasicform,
                                                GObject *arg1,
                                                gboolean arg2,
                                                gpointer user_data);

## Description

## Details

### GnomeDbBasicForm

    typedef struct _GnomeDbBasicForm GnomeDbBasicForm;

### gnome_db_basic_form_get_type ()

    GType       gnome_db_basic_form_get_type    (void);

Returns : |

### gnome_db_basic_form_new ()

    GtkWidget*  gnome_db_basic_form_new         (GnomeDbDict *dict,
                                                 GnomeDbDataSet *data_set);

Creates a new GnomeDbBasicForm widget using all the parameters provided in `data_set`. `data_set` is copied in the process.

The global layout is rendered using a table (a GtkTable), and an entry is created for each node of `data_set`.

`dict` : | a GnomeDbDict object
`data_set` : | a GnomeDbDataSet structure
Returns : | the new widget

### gnome_db_basic_form_new_in_layout ()

    GtkWidget*  gnome_db_basic_form_new_in_layout
                                                (GnomeDbDict *dict,
                                                 GnomeDbDataSet *data_set,
                                                 GtkWidget *layout,
                                                 GHashTable *box_widgets);

Creates a new GnomeDbBasicForm widget using all the parameters provided in `data_set`. `data_set` is unchanged in the process.

This function is identical to `gnome_db_basic_form_new()` except that the layout is not done using a table, but using the `layout` widget; and each entry is packed into one of the GtkBox widgets of `box_widgets` (specifically each entry corresponds to a GnomeDbDataSetNode of `data_set`, and that data_set node is used a the key to `box_widgets` to find the box to pack the entry in).

If any of `layout` or `box_widgets` is `NULL`, then this function is equivalent to `gnome_db_basic_form_new()`.

`dict` : | a GnomeDbDict object
`data_set` : | a GnomeDbDataSet structure
`layout` : | a GtkWidget container of all the widgets in `box_widgets`
`box_widgets` : |
Returns : | the new widget

### gnome_db_basic_form_new_in_dialog ()

    GtkWidget*  gnome_db_basic_form_new_in_dialog
                                                (GnomeDbDict *dict,
                                                 GnomeDbDataSet *data_set,
                                                 GtkWindow *parent,
                                                 const gchar *title,
                                                 const gchar *header);

Creates a new GnomeDbBasicForm widget in the same way as `gnome_db_basic_form_new()` and puts it into a GtkDialog widget. The returned dialog has the "Ok" and "Cancel" buttons which respectively return GTK_RESPONSE_ACCEPT and GTK_RESPONSE_REJECT.

The GnomeDbBasicForm widget is attached to the dialog using the user property "form".

`dict` : | a GnomeDbDict object
`data_set` : | a GnomeDbDataSet structure
`parent` : | the parent window for the new dialog, or `NULL`
`title` : | the title of the dialog window, or `NULL`
`header` : | a helper text displayed at the top of the dialog, or `NULL`
Returns : | the new GtkDialog widget

### gnome_db_basic_form_get_data_set ()

    GnomeDbDataSet* gnome_db_basic_form_get_data_set
                                                (GnomeDbBasicForm *form);

Get a pointer to the GnomeDbDataSet used internally by `form` to store values

`form` : | a GnomeDbBasicForm widget
Returns : |

### gnome_db_basic_form_is_valid ()

    gboolean    gnome_db_basic_form_is_valid    (GnomeDbBasicForm *form);

Tells if the form can be used as-is (if all the parameters do have some valid values)

`form` : | a GnomeDbBasicForm widget
Returns : | TRUE if the form is valid

### gnome_db_basic_form_has_been_changed ()

    gboolean    gnome_db_basic_form_has_been_changed
                                                (GnomeDbBasicForm *form);

Tells if the form has had at least on entry changed, or not

`form` : | a GnomeDbBasicForm widget
Returns : |

### gnome_db_basic_form_set_current_as_orig ()

    void        gnome_db_basic_form_set_current_as_orig
                                                (GnomeDbBasicForm *form);

Tells `form` that the current values in the different entries are to be considered as the original values for all the entries; the immediate consequence is that any sub-sequent call to `gnome_db_basic_form_has_been_changed()` will return FALSE (of course until any entry is changed).

`form` : | a GnomeDbBasicForm widget

### gnome_db_basic_form_reset ()

    void        gnome_db_basic_form_reset       (GnomeDbBasicForm *form);

Resets all the entries in the form to their original values

`form` : | a GnomeDbBasicForm widget

### gnome_db_basic_form_show_entries_actions ()

    void        gnome_db_basic_form_show_entries_actions
                                                (GnomeDbBasicForm *form,
                                                 gboolean show_actions);

Show or hide the actions button available at the end of each data entry in the form

`form` : | a GnomeDbBasicForm widget
`show_actions` : | a boolean

### gnome_db_basic_form_entry_show ()

    void        gnome_db_basic_form_entry_show  (GnomeDbBasicForm *form,
                                                 GnomeDbParameter *param,
                                                 gboolean show);

Shows or hides the GnomeDbDataEntry in `form` which corresponds to the `param` parameter

`form` : | a GnomeDbBasicForm widget
`param` : | a GnomeDbParameter object
`show` : |

### gnome_db_basic_form_entry_set_sensitive ()

    void        gnome_db_basic_form_entry_set_sensitive
                                                (GnomeDbBasicForm *form,
                                                 GnomeDbParameter *param,
                                                 gboolean sensitive);

Shows or hides the GnomeDbDataEntry in `form` which corresponds to the `param` parameter

`form` : | a GnomeDbBasicForm widget
`param` : | a GnomeDbParameter object
`sensitive` : |

### gnome_db_basic_form_set_entries_auto_default ()

    void        gnome_db_basic_form_set_entries_auto_default
                                                (GnomeDbBasicForm *form,
                                                 gboolean auto_default);

Sets weather all the GnomeDbDataEntry entries in the form must default to a default value if they are assigned a non valid value. Depending on the real type of entry, it will provide a default value which the user does not need to modify if it is OK.

For example a date entry can by default display the current date.

`form` : | a GnomeDbBasicForm widget
`auto_default` : |

### gnome_db_basic_form_set_entries_default ()

    void        gnome_db_basic_form_set_entries_default
                                                (GnomeDbBasicForm *form);

For each entry in the form, sets it to a default value if it is possible to do so.

`form` : | a GnomeDbBasicForm widget

## Signal Details

### The "param-changed" signal

    void        user_function                  (GnomeDbBasicForm *dbbasicform,
                                                GObject *arg1,
                                                gboolean arg2,
                                                gpointer user_data);

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