## GdauiDataWidget GdauiDataWidget |

## Synopsis

                        GdauiDataWidget;
                        GdauiDataWidgetIface;
    GdaDataProxy *      gdaui_data_widget_get_proxy         (GdauiDataWidget *iface);
    GtkActionGroup *    gdaui_data_widget_get_actions_group (GdauiDataWidget *iface);
    void                gdaui_data_widget_perform_action    (GdauiDataWidget *iface,
                                                             GdauiAction action);
    void                gdaui_data_widget_column_show       (GdauiDataWidget *iface,
                                                             gint column);
    void                gdaui_data_widget_column_hide       (GdauiDataWidget *iface,
                                                             gint column);
    void                gdaui_data_widget_column_set_editable
                                                            (GdauiDataWidget *iface,
                                                             gint column,
                                                             gboolean editable);
    void                gdaui_data_widget_column_show_actions
                                                            (GdauiDataWidget *iface,
                                                             gint column,
                                                             gboolean show_actions);
    GdaDataModel *      gdaui_data_widget_get_gda_model     (GdauiDataWidget *iface);
    void                gdaui_data_widget_set_gda_model     (GdauiDataWidget *iface,
                                                             GdaDataModel *model);
    GdaDataModelIter *  gdaui_data_widget_get_current_data  (GdauiDataWidget *iface);
    enum                GdauiDataWidgetWriteMode;
    gboolean            gdaui_data_widget_set_write_mode    (GdauiDataWidget *iface,
                                                             GdauiDataWidgetWriteMode mode);
    GdauiDataWidgetWriteMode  gdaui_data_widget_get_write_mode
                                                            (GdauiDataWidget *iface);
    void                gdaui_data_widget_set_data_layout_from_file
                                                            (GdauiDataWidget *iface,
                                                             const gchar *file_name,
                                                             const gchar *parent_table);

## Object Hierarchy

      GInterface
       +----GdauiDataWidget

## Prerequisites

GdauiDataWidget requires GObject.

## Known Implementations

GdauiDataWidget is implemented by GdauiRawGrid and GdauiRawForm.

## Signals

      "iter-changed"                                   : Run First
      "proxy-changed"                                  : Run First

## Description

## Details

### GdauiDataWidget

    typedef struct _GdauiDataWidget GdauiDataWidget;

### GdauiDataWidgetIface

    typedef struct {
    	GTypeInterface           g_iface;

    	/* virtual table */
    	GdaDataProxy        *(* get_proxy)           (GdauiDataWidget *iface);
    	void                 (* col_set_show)        (GdauiDataWidget *iface, gint column, gboolean shown);
    	void                 (* set_column_editable) (GdauiDataWidget *iface, gint column, gboolean editable);
    	void                 (* show_column_actions) (GdauiDataWidget *iface, gint column, gboolean show_actions);
    	GtkActionGroup      *(* get_actions_group)   (GdauiDataWidget *iface);
    	GdaDataModelIter    *(* get_data_set)        (GdauiDataWidget *iface);

    	GdaDataModel        *(* get_gda_model)       (GdauiDataWidget *iface);
    	void                 (* set_gda_model)       (GdauiDataWidget *iface, GdaDataModel *model);
    	gboolean             (* set_write_mode)      (GdauiDataWidget *iface, GdauiDataWidgetWriteMode mode);
    	GdauiDataWidgetWriteMode (* get_write_mode)(GdauiDataWidget *iface);
    	void                 (* set_data_layout)     (GdauiDataWidget *iface, const gpointer data);

    	/* signals */
    	void                 (* proxy_changed)       (GdauiDataWidget *iface, GdaDataProxy *proxy);
    	void                 (* iter_changed)        (GdauiDataWidget *iface, GdaDataModelIter *iter);
    } GdauiDataWidgetIface;

### gdaui_data_widget_get_proxy ()

    GdaDataProxy *      gdaui_data_widget_get_proxy         (GdauiDataWidget *iface);

Get a pointer to the GdaDataProxy being used by `iface`

`iface` : | an object which implements the GdauiDataWidget interface
Returns : | a GdaDataProxy pointer

### gdaui_data_widget_get_actions_group ()

    GtkActionGroup *    gdaui_data_widget_get_actions_group (GdauiDataWidget *iface);

Each widget imlplementing the GdauiDataWidget interface provides actions. Actions can be triggered using the `gdaui_data_widget_perform_action()` method, but using this method allows for the creation of toolbars, menus, etc calling these actions.

The actions are among:

- Data edition actions: "ActionNew", "ActionCommit", "ActionDelete, "ActionUndelete, "ActionReset",

- Record by record moving: "ActionFirstRecord", "ActionPrevRecord", "ActionNextRecord", "ActionLastRecord",

- Chuncks of records moving: "ActionFirstChunck", "ActionPrevChunck", "ActionNextChunck", "ActionLastChunck".

- Filtering: "ActionFilter"

`iface` : | an object which implements the GdauiDataWidget interface
Returns : | the GtkActionGroup with all the possible actions on the widget.

### gdaui_data_widget_perform_action ()

    void                gdaui_data_widget_perform_action    (GdauiDataWidget *iface,
                                                             GdauiAction action);

Forces the widget to perform the selected `action`, as if the user had pressed on the corresponding action button in the `iface` widget, if the corresponding action is possible and if the `iface` widget supports the action.

`iface` : | an object which implements the GdauiDataWidget interface
`action` : | a GdauiAction action

### gdaui_data_widget_column_show ()

    void                gdaui_data_widget_column_show       (GdauiDataWidget *iface,
                                                             gint column);

Shows the data at `column` in the data model `iface` operates on

`iface` : | an object which implements the GdauiDataWidget interface
`column` : | column number to show

### gdaui_data_widget_column_hide ()

    void                gdaui_data_widget_column_hide       (GdauiDataWidget *iface,
                                                             gint column);

Hides the data at `column` in the data model `iface` operates on

`iface` : | an object which implements the GdauiDataWidget interface
`column` : | column number to hide

### gdaui_data_widget_column_set_editable ()

    void                gdaui_data_widget_column_set_editable
                                                            (GdauiDataWidget *iface,
                                                             gint column,
                                                             gboolean editable);

Sets if the data entry in the `iface` widget at `column` (in the data model `iface` operates on) can be edited or not.

`iface` : | an object which implements the GdauiDataWidget interface
`column` : | column number of the data
`editable` : |

### gdaui_data_widget_column_show_actions ()

    void                gdaui_data_widget_column_show_actions
                                                            (GdauiDataWidget *iface,
                                                             gint column,
                                                             gboolean show_actions);

Sets if the data entry in the `iface` widget at `column` (in the data model `iface` operates on) must show its actions menu or not.

`iface` : | an object which implements the GdauiDataWidget interface
`column` : | column number of the data, or -1 to apply the setting to all the columns
`show_actions` : |

### gdaui_data_widget_get_gda_model ()

    GdaDataModel *      gdaui_data_widget_get_gda_model     (GdauiDataWidget *iface);

Get the current GdaDataModel used by `iface`

`iface` : | an object which implements the GdauiDataWidget interface
Returns : | the GdaDataModel, or `NULL` if there is none

### gdaui_data_widget_set_gda_model ()

    void                gdaui_data_widget_set_gda_model     (GdauiDataWidget *iface,
                                                             GdaDataModel *model);

Sets the data model which is used by `iface`.

`iface` : | an object which implements the GdauiDataWidget interface
`model` : | a valid GdaDataModel

### gdaui_data_widget_get_current_data ()

    GdaDataModelIter *  gdaui_data_widget_get_current_data  (GdauiDataWidget *iface);

Get the GdaDataModelIter object which contains all the parameters which in turn contain the actual data stored in `iface`. When the user changes what's displayed or what's selected (depending on the actual widget) in `iface`, then the parameter's values change as well.

`iface` : | an object which implements the GdauiDataWidget interface
Returns : | the GdaSet object for data (not a new object)

### enum GdauiDataWidgetWriteMode

    typedef enum {
    	GDAUI_DATA_WIDGET_WRITE_ON_DEMAND           = 0, /* write only when explicitly requested */
    	GDAUI_DATA_WIDGET_WRITE_ON_ROW_CHANGE       = 1, /* write when the current selected row changes */
    	GDAUI_DATA_WIDGET_WRITE_ON_VALUE_ACTIVATED  = 2, /* write when user activates a value change */
    	GDAUI_DATA_WIDGET_WRITE_ON_VALUE_CHANGE     = 3  /* write when a parameters's value changes */
    } GdauiDataWidgetWriteMode;

### gdaui_data_widget_set_write_mode ()

    gboolean            gdaui_data_widget_set_write_mode    (GdauiDataWidget *iface,
                                                             GdauiDataWidgetWriteMode mode);

Specifies the way the modifications stored in the GdaDataProxy used internally by `iface` are written back to the GdaDataModel which holds the data displayed in `iface`.

`iface` : | an object which implements the GdauiDataWidget interface
`mode` : |
Returns : | TRUE if the proposed mode has been taken into account

### gdaui_data_widget_get_write_mode ()

    GdauiDataWidgetWriteMode  gdaui_data_widget_get_write_mode
                                                            (GdauiDataWidget *iface);

Get the way the modifications stored in the GdaDataProxy used internally by `iface` are written back to the GdaDataModel which holds the data displayed in `iface`.

`iface` : | an object which implements the GdauiDataWidget interface
Returns : | the write mode used by `iface`

### gdaui_data_widget_set_data_layout_from_file ()

    void                gdaui_data_widget_set_data_layout_from_file
                                                            (GdauiDataWidget *iface,
                                                             const gchar *file_name,
                                                             const gchar *parent_table);

Sets a data layout according an XML string in the `iface` widget.

`iface` : | an object which implements the GdauiDataWidget interface
`file_name` : |
`parent_table` : |

## Signal Details

### The `"iter-changed"` signal

    void                user_function                      (GdauiDataWidget *gdauidatawidget,
                                                            gpointer         arg1,
                                                            gpointer         user_data)            : Run First

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

### The `"proxy-changed"` signal

    void                user_function                      (GdauiDataWidget *gdauidatawidget,
                                                            GdaDataProxy    *arg1,
                                                            gpointer         user_data)            : Run First

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