![]() |
![]() |
![]() |
GNOME Data Access 4 manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Known Implementations | Signals |
GdauiDataProxyGdauiDataProxy — Modifying data in a GdaDataModel |
GdauiDataProxy; GdauiDataProxyIface; GdaDataProxy * gdaui_data_proxy_get_proxy (GdauiDataProxy *iface
); GtkActionGroup * gdaui_data_proxy_get_actions_group (GdauiDataProxy *iface
); enum GdauiAction; void gdaui_data_proxy_perform_action (GdauiDataProxy *iface
,GdauiAction action
); void gdaui_data_proxy_column_set_editable (GdauiDataProxy *iface
,gint column
,gboolean editable
); void gdaui_data_proxy_column_show_actions (GdauiDataProxy *iface
,gint column
,gboolean show_actions
); enum GdauiDataProxyWriteMode; gboolean gdaui_data_proxy_set_write_mode (GdauiDataProxy *iface
,GdauiDataProxyWriteMode mode
); GdauiDataProxyWriteMode gdaui_data_proxy_get_write_mode (GdauiDataProxy *iface
);
GdauiDataProxy is implemented by GdauiForm, GdauiGrid, GdauiRawForm and GdauiRawGrid.
The GdauiDataProxy interface is implemented by widgets which allow modifications to a GdaDataModel (through a GdaDataProxy to actually proxy the changes before they are written to the data model).
typedef struct { GTypeInterface g_iface; /* virtual table */ GdaDataProxy *(* get_proxy) (GdauiDataProxy *iface); void (* set_column_editable) (GdauiDataProxy *iface, gint column, gboolean editable); void (* show_column_actions) (GdauiDataProxy *iface, gint column, gboolean show_actions); GtkActionGroup *(* get_actions_group) (GdauiDataProxy *iface); gboolean (* set_write_mode) (GdauiDataProxy *iface, GdauiDataProxyWriteMode mode); GdauiDataProxyWriteMode (* get_write_mode)(GdauiDataProxy *iface); /* signals */ void (* proxy_changed) (GdauiDataProxy *iface, GdaDataProxy *proxy); } GdauiDataProxyIface;
GdaDataProxy * gdaui_data_proxy_get_proxy (GdauiDataProxy *iface
);
Get a pointer to the GdaDataProxy being used by iface
|
an object which implements the GdauiDataProxy interface |
Returns : |
a GdaDataProxy pointer. [transfer none] |
Since 4.2
GtkActionGroup * gdaui_data_proxy_get_actions_group (GdauiDataProxy *iface
);
Each widget imlplementing the GdauiDataProxy interface provides actions. Actions can be triggered
using the gdaui_data_proxy_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", "ActionReset". Note that the "ActionDelete" action is actually a GtkToggleAction action which can be used to delete a row or undelete it.
Record by record moving: "ActionFirstRecord", "ActionPrevRecord", "ActionNextRecord", "ActionLastRecord".
Chuncks of records moving: "ActionFirstChunck", "ActionPrevChunck", "ActionNextChunck", "ActionLastChunck".
Filtering: "ActionFilter".
|
an object which implements the GdauiDataProxy interface |
Returns : |
the GtkActionGroup with all the possible actions on the widget. [transfer none] |
Since 4.2
typedef enum { /* actions in GdauiDataWidget widgets */ GDAUI_ACTION_NEW_DATA, GDAUI_ACTION_WRITE_MODIFIED_DATA, GDAUI_ACTION_DELETE_SELECTED_DATA, GDAUI_ACTION_UNDELETE_SELECTED_DATA, GDAUI_ACTION_RESET_DATA, GDAUI_ACTION_MOVE_FIRST_RECORD, GDAUI_ACTION_MOVE_PREV_RECORD, GDAUI_ACTION_MOVE_NEXT_RECORD, GDAUI_ACTION_MOVE_LAST_RECORD, GDAUI_ACTION_MOVE_FIRST_CHUNCK, GDAUI_ACTION_MOVE_PREV_CHUNCK, GDAUI_ACTION_MOVE_NEXT_CHUNCK, GDAUI_ACTION_MOVE_LAST_CHUNCK } GdauiAction;
void gdaui_data_proxy_perform_action (GdauiDataProxy *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.
|
an object which implements the GdauiDataProxy interface |
|
a GdauiAction action |
Since 4.2
void gdaui_data_proxy_column_set_editable (GdauiDataProxy *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.
|
an object which implements the GdauiDataProxy interface |
|
column number of the data |
|
set to TRUE to make the column editable |
Since 4.2
void gdaui_data_proxy_column_show_actions (GdauiDataProxy *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.
|
an object which implements the GdauiDataProxy interface |
|
column number of the data, or -1 to apply the setting to all the columns |
|
set to TRUE if the actions menu must be shown |
Since 4.2
typedef enum { GDAUI_DATA_PROXY_WRITE_ON_DEMAND = 0, /* write only when explicitly requested */ GDAUI_DATA_PROXY_WRITE_ON_ROW_CHANGE = 1, /* write when the current selected row changes */ GDAUI_DATA_PROXY_WRITE_ON_VALUE_ACTIVATED = 2, /* write when user activates a value change */ GDAUI_DATA_PROXY_WRITE_ON_VALUE_CHANGE = 3 /* write when a parameters's value changes */ } GdauiDataProxyWriteMode;
gboolean gdaui_data_proxy_set_write_mode (GdauiDataProxy *iface
,GdauiDataProxyWriteMode 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
.
|
an object which implements the GdauiDataProxy interface |
|
the requested GdauiDataProxyWriteMode mode |
Returns : |
TRUE if the proposed mode has been taken into account |
Since 4.2
GdauiDataProxyWriteMode gdaui_data_proxy_get_write_mode (GdauiDataProxy *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
.
|
an object which implements the GdauiDataProxy interface |
Returns : |
the write mode used by iface
|
Since 4.2
"proxy-changed"
signalvoid user_function (GdauiDataProxy *gdauidataproxy,
GdaDataProxy *arg1,
gpointer user_data) : Run First
The ::proxy-changed signal is emitted each time the GdaDataProxy which would be
returned by gdaui_data_proxy_get_proxy()
changes. This is generally the result
of changes in the structure of the proxied data model (different number and/or type
of columns for example).
|
the GdauiDataProxy |
|
the GdaDataProxy which would be returned by gdaui_data_proxy_get_proxy()
|
|
user data set when the signal handler was connected. |
The GdauiDataSelector interface which is usually also implemented by the widgets which implement the GdauiDataProxy interface.