GnomeDbDataWidget

GnomeDbDataWidget — Interface to control data boud widgets

Synopsis




            GnomeDbDataWidget;
            GnomeDbDataWidgetIface;
GType       gnome_db_data_widget_get_type   (void);
void        gnome_db_data_widget_set_mode   (GnomeDbDataWidget *iface,
                                             guint mode);
void        gnome_db_data_widget_global_show_actions
                                            (GnomeDbDataWidget *iface,
                                             gboolean show_actions);
GtkActionGroup* gnome_db_data_widget_get_actions_group
                                            (GnomeDbDataWidget *iface);
void        gnome_db_data_widget_perform_action
                                            (GnomeDbDataWidget *iface,
                                             GnomeDbAction action);
void        gnome_db_data_widget_column_show
                                            (GnomeDbDataWidget *iface,
                                             gint column);
void        gnome_db_data_widget_column_hide
                                            (GnomeDbDataWidget *iface,
                                             gint column);
void        gnome_db_data_widget_column_set_editable
                                            (GnomeDbDataWidget *iface,
                                             gint column,
                                             gboolean editable);
void        gnome_db_data_widget_column_show_actions
                                            (GnomeDbDataWidget *iface,
                                             gint column,
                                             gboolean show_actions);
GdaDataModel* gnome_db_data_widget_get_gda_model
                                            (GnomeDbDataWidget *iface);
void        gnome_db_data_widget_set_gda_model
                                            (GnomeDbDataWidget *iface,
                                             GnomeDbDict *dict,
                                             GdaDataModel *model);
GnomeDbDataSet* gnome_db_data_widget_get_params
                                            (GnomeDbDataWidget *iface);
GnomeDbDataSet* gnome_db_data_widget_get_data
                                            (GnomeDbDataWidget *iface);
void        gnome_db_data_widget_set_title  (GnomeDbDataWidget *iface,
                                             const gchar *title);
void        gnome_db_data_widget_set_show_title
                                            (GnomeDbDataWidget *iface,
                                             gboolean show);
void        gnome_db_data_widget_set_title_icon_from_stock
                                            (GnomeDbDataWidget *iface,
                                             const gchar *stock_id,
                                             GtkIconSize size);

Object Hierarchy


  GInterface
   +----GnomeDbDataWidget

Prerequisites

GnomeDbDataWidget requires GObject.

Known Implementations

GnomeDbDataWidget is implemented by GnomeDbLayout, GnomeDbMatrix, GnomeDbGrid and GnomeDbForm.

Description

Details

GnomeDbDataWidget

typedef struct _GnomeDbDataWidget GnomeDbDataWidget;


GnomeDbDataWidgetIface

typedef struct {
	GTypeInterface           g_iface;

	/* virtual table */
	void                 (* set_mode)            (GnomeDbDataWidget *iface, guint mode);
	void                 (* col_set_show)        (GnomeDbDataWidget *iface, gint column, gboolean shown);
	void                 (* set_column_editable) (GnomeDbDataWidget *iface, gint column, gboolean editable);
	void                 (* show_column_actions) (GnomeDbDataWidget *iface, gint column, gboolean show_actions);
	void                 (* show_global_actions) (GnomeDbDataWidget *iface, gboolean show_actions);
	GtkActionGroup      *(* get_actions_group)   (GnomeDbDataWidget *iface);
	GnomeDbDataSet      *(* get_params_set)      (GnomeDbDataWidget *iface);
	GnomeDbDataSet      *(* get_data_set)        (GnomeDbDataWidget *iface);

	GdaDataModel        *(* get_gda_model)       (GnomeDbDataWidget *iface);
	void                 (* set_gda_model)       (GnomeDbDataWidget *iface, GnomeDbDict *dict, GdaDataModel *model);
	void                 (* set_title)           (GnomeDbDataWidget *iface, const gchar *title);
	void                 (* set_show_title)      (GnomeDbDataWidget *iface, gboolean show);
	void                 (* set_t_i_from_stock)  (GnomeDbDataWidget *iface, const gchar *stock_id, GtkIconSize size);
} GnomeDbDataWidgetIface;


gnome_db_data_widget_get_type ()

GType       gnome_db_data_widget_get_type   (void);

Returns :

gnome_db_data_widget_set_mode ()

void        gnome_db_data_widget_set_mode   (GnomeDbDataWidget *iface,
                                             guint mode);

Changes the mode that was set when gnome_db_data_widget_run() was called.

iface : an object which implements the GnomeDbDataWidget interface
mode : an OR'ed collection of flags from GnomeDbActionMode

gnome_db_data_widget_global_show_actions ()

void        gnome_db_data_widget_global_show_actions
                                            (GnomeDbDataWidget *iface,
                                             gboolean show_actions);

Controls if the action buttons provided by the iface widget (for instance SAVE, RESET, MOVE TO NEXT, etc) are displayed or not.

iface : an object which implements the GnomeDbDataWidget interface
show_actions :

gnome_db_data_widget_get_actions_group ()

GtkActionGroup* gnome_db_data_widget_get_actions_group
                                            (GnomeDbDataWidget *iface);

Each widget imlplementing the GnomeDbDataWidget interface provides actions. Actions can be triggered using the gnome_db_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".

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

gnome_db_data_widget_perform_action ()

void        gnome_db_data_widget_perform_action
                                            (GnomeDbDataWidget *iface,
                                             GnomeDbAction 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 GnomeDbDataWidget interface
action : a GnomeDbAction action

gnome_db_data_widget_column_show ()

void        gnome_db_data_widget_column_show
                                            (GnomeDbDataWidget *iface,
                                             gint column);

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

iface : an object which implements the GnomeDbDataWidget interface
column : column number to show

gnome_db_data_widget_column_hide ()

void        gnome_db_data_widget_column_hide
                                            (GnomeDbDataWidget *iface,
                                             gint column);

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

iface : an object which implements the GnomeDbDataWidget interface
column : column number to hide

gnome_db_data_widget_column_set_editable ()

void        gnome_db_data_widget_column_set_editable
                                            (GnomeDbDataWidget *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 GnomeDbDataWidget interface
column : column number of the data
editable :

gnome_db_data_widget_column_show_actions ()

void        gnome_db_data_widget_column_show_actions
                                            (GnomeDbDataWidget *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 GnomeDbDataWidget interface
column : column number of the data
show_actions :

gnome_db_data_widget_get_gda_model ()

GdaDataModel* gnome_db_data_widget_get_gda_model
                                            (GnomeDbDataWidget *iface);

Get the current GdaDataModel used by iface

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

gnome_db_data_widget_set_gda_model ()

void        gnome_db_data_widget_set_gda_model
                                            (GnomeDbDataWidget *iface,
                                             GnomeDbDict *dict,
                                             GdaDataModel *model);

Sets the data model which is used by iface.

iface : an object which implements the GnomeDbDataWidget interface
dict :
model : a valid GdaDataModel

gnome_db_data_widget_get_params ()

GnomeDbDataSet* gnome_db_data_widget_get_params
                                            (GnomeDbDataWidget *iface);

Get the GnomeDbDataSet object which contains all the parameters which control the contents of the data in the iface widget. Modifying the values of the parameters in the returned data set will make the iface widget refresh its contents.

iface : an object which implements the GnomeDbDataWidget interface
Returns : the GnomeDbDataSet object for parameters (not a new object)

gnome_db_data_widget_get_data ()

GnomeDbDataSet* gnome_db_data_widget_get_data
                                            (GnomeDbDataWidget *iface);

Get the GnomeDbDataSet 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 GnomeDbDataWidget interface
Returns : the GnomeDbDataSet object for data (not a new object)

gnome_db_data_widget_set_title ()

void        gnome_db_data_widget_set_title  (GnomeDbDataWidget *iface,
                                             const gchar *title);

iface :
title :

gnome_db_data_widget_set_show_title ()

void        gnome_db_data_widget_set_show_title
                                            (GnomeDbDataWidget *iface,
                                             gboolean show);

iface :
show :

gnome_db_data_widget_set_title_icon_from_stock ()

void        gnome_db_data_widget_set_title_icon_from_stock
                                            (GnomeDbDataWidget *iface,
                                             const gchar *stock_id,
                                             GtkIconSize size);

iface :
stock_id :
size :