MgWorkWidget

Name

MgWorkWidget -- Interface used to perform common operations on widgets which implement it. The MgWorkForm and MgWorkGrid widgets do implement that interface.

Synopsis



#define     MG_WORK_WIDGET_TYPE
#define     MG_WORK_WIDGET                  (obj)
#define     IS_MG_WORK_WIDGET               (obj)
#define     MG_WORK_WIDGET_GET_IFACE        (obj)
struct      MgWorkWidget;
struct      MgWorkWidgetIface;
GType       mg_work_widget_get_type         (void);
void        mg_work_widget_run              (MgWorkWidget *iface,
                                             guint mode);
void        mg_work_widget_set_mode         (MgWorkWidget *iface,
                                             guint mode);
void        mg_work_widget_set_entry_editable
                                            (MgWorkWidget *iface,
                                             MgQfield *field,
                                             gboolean editable);
void        mg_work_widget_show_entry_actions
                                            (MgWorkWidget *iface,
                                             MgQfield *field,
                                             gboolean show_actions);
void        mg_work_widget_show_global_actions
                                            (MgWorkWidget *iface,
                                             gboolean show_actions);
MgParameter* mg_work_widget_get_param_for_field
                                            (MgWorkWidget *iface,
                                             MgQfield *field);
gboolean    mg_work_widget_has_been_changed (MgWorkWidget *iface);
MgContext*  mg_work_widget_get_exec_context (MgWorkWidget *iface);
void        mg_work_widget_bind_to_work_widget
                                            (MgWorkWidget *dest_iface,
                                             const gchar *dest_field_xml_id,
                                             MgWorkWidget *source_iface,
                                             const gchar *source_field_xml_id);
void        mg_work_widget_bind_to_context  (MgWorkWidget *dest_iface,
                                             const gchar *dest_field_xml_id,
                                             MgContext *source_context,
                                             const gchar *source_field_xml_id);
void        mg_work_widget_bind_to_context_all
                                            (MgWorkWidget *dest_iface,
                                             MgContext *source_context);

Object Hierarchy


  GInterface
   +----MgWorkWidget

Implementations

MgWorkWidget is implemented by MgWorkForm and MgWorkGrid.

Prerequisites

MgWorkWidget requires GObject.

Description

Details

MG_WORK_WIDGET_TYPE

#define MG_WORK_WIDGET_TYPE          (mg_work_widget_get_type())


MG_WORK_WIDGET()

#define MG_WORK_WIDGET(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, mg_work_widget_get_type(), MgWorkWidget)

obj :


IS_MG_WORK_WIDGET()

#define IS_MG_WORK_WIDGET(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, mg_work_widget_get_type ())

obj :


MG_WORK_WIDGET_GET_IFACE()

#define MG_WORK_WIDGET_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MG_WORK_WIDGET_TYPE, MgWorkWidgetIface))

obj :


struct MgWorkWidget

struct MgWorkWidget;


struct MgWorkWidgetIface

struct MgWorkWidgetIface {

	GTypeInterface           g_iface;

	/* virtual table */
	void         (* run)                 (MgWorkWidget *iface, guint mode);
	void         (* set_mode)            (MgWorkWidget *iface, guint mode);
	void         (* set_entry_editable)  (MgWorkWidget *iface, MgQfield *field, gboolean editable);
	void         (* show_entry_actions)  (MgWorkWidget *iface, MgQfield *field, gboolean show_actions);
	void         (* show_global_actions) (MgWorkWidget *iface, gboolean show_actions);
	MgParameter *(* get_param_for_field) (MgWorkWidget *iface, MgQfield *field);
	gboolean     (* has_been_changed)    (MgWorkWidget *iface);
	MgContext   *(* get_exec_context)    (MgWorkWidget *iface);
};


mg_work_widget_get_type ()

GType       mg_work_widget_get_type         (void);

Returns :


mg_work_widget_run ()

void        mg_work_widget_run              (MgWorkWidget *iface,
                                             guint mode);

Makes the widget run the queries it has to run in order to display usefull data. Havin a separate step to "run" the widget allows to have the execution context related to other events.

iface :

an object which implements the MgWorkWidget interface

mode :

an OR'ed collection of flags from MgEnumsMode


mg_work_widget_set_mode ()

void        mg_work_widget_set_mode         (MgWorkWidget *iface,
                                             guint mode);

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

iface :

an object which implements the MgWorkWidget interface

mode :

an OR'ed collection of flags from MgEnumsMode


mg_work_widget_set_entry_editable ()

void        mg_work_widget_set_entry_editable
                                            (MgWorkWidget *iface,
                                             MgQfield *field,
                                             gboolean editable);

Sets if the data entry in the iface widget corresponding to field can be edited or not.

iface :

an object which implements the MgWorkWidget interface

field :

a MgQfield object which belongs to the MgQuery which iface uses

editable :


mg_work_widget_show_entry_actions ()

void        mg_work_widget_show_entry_actions
                                            (MgWorkWidget *iface,
                                             MgQfield *field,
                                             gboolean show_actions);

Control if the actions buttons the iface widget offers are displayed or not.

iface :

an object which implements the MgWorkWidget interface

field :

a MgQfield object which belongs to the MgQuery which iface uses show_actions

show_actions :


mg_work_widget_show_global_actions ()

void        mg_work_widget_show_global_actions
                                            (MgWorkWidget *iface,
                                             gboolean show_actions);

Control if the actions buttons the iface widget offers are displayed or not.

iface :

an object which implements the MgWorkWidget interface show_actions

show_actions :


mg_work_widget_get_param_for_field ()

MgParameter* mg_work_widget_get_param_for_field
                                            (MgWorkWidget *iface,
                                             MgQfield *field);

Get the MgParameter object corresponding to field, as created by the iface object.

iface :

an object which implements the MgWorkWidget interface

field :

a MgQfield object which belongs to the MgQuery which iface uses

Returns :


mg_work_widget_has_been_changed ()

gboolean    mg_work_widget_has_been_changed (MgWorkWidget *iface);

Tells if the user has changed any of the data displayed by iface since the last refresh.

iface :

an object which implements the MgWorkWidget interface

Returns :


mg_work_widget_get_exec_context ()

MgContext*  mg_work_widget_get_exec_context (MgWorkWidget *iface);

Get the MgContext which represents the necessary parameters to be given a value before the MgQuery used by iface can be run.

iface :

an object which implements the MgWorkWidget interface

Returns :


mg_work_widget_bind_to_work_widget ()

void        mg_work_widget_bind_to_work_widget
                                            (MgWorkWidget *dest_iface,
                                             const gchar *dest_field_xml_id,
                                             MgWorkWidget *source_iface,
                                             const gchar *source_field_xml_id);

Retreives the MgParameter objects for the dest_field_xml_id and source_field_xml_id and bind them together: when the 'source' parameter changes, the 'dest' one takes the value of the 'source' one.

dest_iface :

an object which implements the MgWorkWidget interface

dest_field_xml_id :

source_iface :

an object which implements the MgWorkWidget interface

source_field_xml_id :


mg_work_widget_bind_to_context ()

void        mg_work_widget_bind_to_context  (MgWorkWidget *dest_iface,
                                             const gchar *dest_field_xml_id,
                                             MgContext *source_context,
                                             const gchar *source_field_xml_id);

Retreives the MgParameter objects for the dest_field_xml_id and source_field_xml_id and bind them together: when the 'source' parameter changes, the 'dest' one takes the value of the 'source' one.

dest_iface :

an object which implements the MgWorkWidget interface

dest_field_xml_id :

source_context :

a MgContext object

source_field_xml_id :


mg_work_widget_bind_to_context_all ()

void        mg_work_widget_bind_to_context_all
                                            (MgWorkWidget *dest_iface,
                                             MgContext *source_context);

For each MgParameter of source_context, retreives the corresponding MgParameter in dest_iface's exec. context, and bind the two together: when the 'source' parameter changes, the 'dest' one takes the value of the 'source' one.

dest_iface :

an object which implements the MgWorkWidget interface

source_context :

a MgContext object