[gnome-db] updatable data models: first try



Hi all,

I just worked a few minutes on what rodrigo, paisa and I discussed about
the design of updatable data models in libgda, and here is a first patch
(interface only):

      * Renamed some methods:

        gda_data_model_is_editable -> gda_data_model_is_updatable ;
        gda_data_model_begin_edit -> gda_data_model_begin_update ;
        gda_data_model_cancel_edit -> gda_data_model_cancel_update ;
        gda_data_model_end_edit -> gda_data_model_end_update ;
        gda_data_model_is_editing -> gda_data_model_is_updated.

      * Renamed some signals:

        "begin_edit" -> "begin_update" ;
        "cancel_edit" -> "cancel_update" ;
        "end_edit" -> "end_update".

      * Added some methods:

        gboolean gda_data_model_append_column (GdaDataModel *model,  
        GdaFieldAttributes *col) ;
        gboolean gda_data_model_update_column (GdaDataModel *model, 
        const GdaFieldAttributes *col) ;
        gboolean gda_data_model_remove_column (GdaDataModel *model, 
        const GdaFieldAttributes *col).

      * Added some signals:

        "column_inserted" ;
        "column_updated" ;
        "column_removed".

Please tell me what you think about this.

--
Laurent
? gda-bdb-config.patch
? log
? udm.patch
? doc/C/tmpl/gda-enum-types.sgml
? libgda/gda-enum-types.c
? libgda/gda-enum-types.h
? libgda/s-enum-types-c
? libgda/s-enum-types-h
? providers/bdb/Makefile
? providers/bdb/Makefile.in
? providers/bdb/gda-bdb-test
Index: libgda/gda-data-model-array.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-data-model-array.c,v
retrieving revision 1.18
diff -u -r1.18 gda-data-model-array.c
--- libgda/gda-data-model-array.c	18 Oct 2003 23:03:52 -0000	1.18
+++ libgda/gda-data-model-array.c	2 Dec 2003 16:40:59 -0000
@@ -99,7 +99,7 @@
 }
 
 static gboolean
-gda_data_model_array_is_editable (GdaDataModel *model)
+gda_data_model_array_is_updatable (GdaDataModel *model)
 {
 	g_return_val_if_fail (GDA_IS_DATA_MODEL_ARRAY (model), FALSE);
 	return TRUE;
@@ -156,7 +156,7 @@
 	model_class->describe_column = gda_data_model_array_describe_column;
 	model_class->get_row = gda_data_model_array_get_row;
 	model_class->get_value_at = gda_data_model_array_get_value_at;
-	model_class->is_editable = gda_data_model_array_is_editable;
+	model_class->is_updatable = gda_data_model_array_is_updatable;
 	model_class->append_row = gda_data_model_array_append_row;
 	model_class->remove_row = gda_data_model_array_remove_row;
 	model_class->update_row = NULL;
Index: libgda/gda-data-model-hash.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-data-model-hash.c,v
retrieving revision 1.10
diff -u -r1.10 gda-data-model-hash.c
--- libgda/gda-data-model-hash.c	18 Oct 2003 23:03:52 -0000	1.10
+++ libgda/gda-data-model-hash.c	2 Dec 2003 16:41:00 -0000
@@ -61,7 +61,7 @@
 }
 
 static gboolean
-gda_data_model_hash_is_editable (GdaDataModel *model)
+gda_data_model_hash_is_updatable (GdaDataModel *model)
 {
 	g_return_val_if_fail (GDA_IS_DATA_MODEL_HASH (model), FALSE);
 	return TRUE;
@@ -120,7 +120,7 @@
 	model_class->describe_column = gda_data_model_hash_describe_column;
 	model_class->get_row = gda_data_model_hash_get_row;
 	model_class->get_value_at = gda_data_model_hash_get_value_at;
-	model_class->is_editable = gda_data_model_hash_is_editable;
+	model_class->is_updatable = gda_data_model_hash_is_updatable;
 	model_class->append_row = gda_data_model_hash_append_row;
 	model_class->remove_row = gda_data_model_hash_remove_row;
 }
Index: libgda/gda-data-model-list.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-data-model-list.c,v
retrieving revision 1.13
diff -u -r1.13 gda-data-model-list.c
--- libgda/gda-data-model-list.c	18 Oct 2003 23:03:52 -0000	1.13
+++ libgda/gda-data-model-list.c	2 Dec 2003 16:41:00 -0000
@@ -71,7 +71,7 @@
 }
 
 static gboolean
-gda_data_model_list_is_editable (GdaDataModel *model)
+gda_data_model_list_is_updatable (GdaDataModel *model)
 {
 	g_return_val_if_fail (GDA_IS_DATA_MODEL_LIST (model), FALSE);
 	return TRUE;
@@ -110,7 +110,7 @@
 	model_class->describe_column = NULL;
 	model_class->get_row = gda_data_model_list_get_row;
 	model_class->get_value_at = gda_data_model_list_get_value_at;
-	model_class->is_editable = gda_data_model_list_is_editable;
+	model_class->is_updatable = gda_data_model_list_is_updatable;
 	model_class->append_row = gda_data_model_list_append_row;
 	model_class->remove_row = gda_data_model_list_remove_row;
 	model_class->update_row = NULL;
Index: libgda/gda-data-model.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-data-model.c,v
retrieving revision 1.41
diff -u -r1.41 gda-data-model.c
--- libgda/gda-data-model.c	29 Nov 2003 14:52:50 -0000	1.41
+++ libgda/gda-data-model.c	2 Dec 2003 16:41:03 -0000
@@ -38,8 +38,8 @@
 	gchar *cmd_text;
 	GdaCommandType cmd_type;
 
-	/* edition mode */
-	gboolean editing;
+	/* update mode */
+	gboolean updating;
 };
 
 static void gda_data_model_class_init (GdaDataModelClass *klass);
@@ -51,9 +51,12 @@
 	ROW_INSERTED,
 	ROW_UPDATED,
 	ROW_REMOVED,
-	BEGIN_EDIT,
-	CANCEL_EDIT,
-	END_EDIT,
+	COLUMN_INSERTED,
+	COLUMN_UPDATED,
+	COLUMN_REMOVED,
+	BEGIN_UPDATE,
+	CANCEL_UPDATE,
+	END_UPDATE,
 	LAST_SIGNAL
 };
 
@@ -103,45 +106,72 @@
                               NULL, NULL,
                               g_cclosure_marshal_VOID__INT,
                               G_TYPE_NONE, 1, G_TYPE_INT);
-	gda_data_model_signals[BEGIN_EDIT] =
-		g_signal_new ("begin_edit",
+	gda_data_model_signals[COLUMN_INSERTED] =
+		g_signal_new ("column_inserted",
                               G_TYPE_FROM_CLASS (object_class),
                               G_SIGNAL_RUN_LAST,
-                              G_STRUCT_OFFSET (GdaDataModelClass, begin_edit),
+                              G_STRUCT_OFFSET (GdaDataModelClass, column_inserted),
+                              NULL, NULL,
+                              g_cclosure_marshal_VOID__INT,
+                              G_TYPE_NONE, 1, G_TYPE_INT);
+	gda_data_model_signals[COLUMN_UPDATED] =
+		g_signal_new ("column_updated",
+                              G_TYPE_FROM_CLASS (object_class),
+                              G_SIGNAL_RUN_LAST,
+                              G_STRUCT_OFFSET (GdaDataModelClass, column_updated),
+                              NULL, NULL,
+                              g_cclosure_marshal_VOID__INT,
+                              G_TYPE_NONE, 1, G_TYPE_INT);
+	gda_data_model_signals[COLUMN_REMOVED] =
+		g_signal_new ("column_removed",
+                              G_TYPE_FROM_CLASS (object_class),
+                              G_SIGNAL_RUN_LAST,
+                              G_STRUCT_OFFSET (GdaDataModelClass, column_removed),
+                              NULL, NULL,
+                              g_cclosure_marshal_VOID__INT,
+                              G_TYPE_NONE, 1, G_TYPE_INT);
+	gda_data_model_signals[BEGIN_UPDATE] =
+		g_signal_new ("begin_update",
+                              G_TYPE_FROM_CLASS (object_class),
+                              G_SIGNAL_RUN_LAST,
+                              G_STRUCT_OFFSET (GdaDataModelClass, begin_update),
                               NULL, NULL,
                               g_cclosure_marshal_VOID__VOID,
                               G_TYPE_NONE, 0);
-	gda_data_model_signals[CANCEL_EDIT] =
-		g_signal_new ("cancel_edit",
+	gda_data_model_signals[CANCEL_UPDATE] =
+		g_signal_new ("cancel_update",
                               G_TYPE_FROM_CLASS (object_class),
                               G_SIGNAL_RUN_LAST,
-                              G_STRUCT_OFFSET (GdaDataModelClass, cancel_edit),
+                              G_STRUCT_OFFSET (GdaDataModelClass, cancel_update),
                               NULL, NULL,
                               g_cclosure_marshal_VOID__VOID,
                               G_TYPE_NONE, 0);
-	gda_data_model_signals[END_EDIT] =
-		g_signal_new ("end_edit",
+	gda_data_model_signals[END_UPDATE] =
+		g_signal_new ("end_update",
                               G_TYPE_FROM_CLASS (object_class),
                               G_SIGNAL_RUN_LAST,
-                              G_STRUCT_OFFSET (GdaDataModelClass, end_edit),
+                              G_STRUCT_OFFSET (GdaDataModelClass, end_update),
                               NULL, NULL,
                               g_cclosure_marshal_VOID__VOID,
                               G_TYPE_NONE, 0);
 
 	object_class->finalize = gda_data_model_finalize;
 	klass->changed = NULL;
-	klass->begin_edit = NULL;
-	klass->cancel_edit = NULL;
-	klass->end_edit = NULL;
+	klass->begin_update = NULL;
+	klass->cancel_update = NULL;
+	klass->end_update = NULL;
 	klass->get_n_rows = NULL;
 	klass->get_n_columns = NULL;
 	klass->describe_column = NULL;
 	klass->get_row = NULL;
 	klass->get_value_at = NULL;
-	klass->is_editable = NULL;
+	klass->is_updatable = NULL;
 	klass->append_row = NULL;
 	klass->remove_row = NULL;
 	klass->update_row = NULL;
+	klass->append_column = NULL;
+	klass->remove_column = NULL;
+	klass->update_column = NULL;
 }
 
 static void
@@ -153,7 +183,7 @@
 	model->priv->notify_changes = TRUE;
 	model->priv->column_titles = g_hash_table_new (g_direct_hash,
 						       g_direct_equal);
-	model->priv->editing = FALSE;
+	model->priv->updating = FALSE;
 	model->priv->cmd_text = NULL;
 	model->priv->cmd_type = GDA_COMMAND_TYPE_INVALID;
 }
@@ -296,6 +326,69 @@
 }
 
 /**
+ * gda_data_model_column_inserted
+ * @model: a #GdaDataModel object.
+ * @col: column number.
+ *
+ * Emits the 'column_inserted' and 'changed' signals on @model.
+ */
+void
+gda_data_model_column_inserted (GdaDataModel *model, gint col)
+{
+	g_return_if_fail (GDA_IS_DATA_MODEL (model));
+
+	if (model->priv->notify_changes) {
+		g_signal_emit (G_OBJECT (model),
+			       gda_data_model_signals[COLUMN_INSERTED],
+			       0, col);
+
+		gda_data_model_changed (model);
+	}
+}
+
+/**
+ * gda_data_model_column_updated
+ * @model: a #GdaDataModel object.
+ * @col: column number.
+ *
+ * Emits the 'column_updated' and 'changed' signals on @model.
+ */
+void
+gda_data_model_column_updated (GdaDataModel *model, gint col)
+{
+	g_return_if_fail (GDA_IS_DATA_MODEL (model));
+
+	if (model->priv->notify_changes) {
+		g_signal_emit (G_OBJECT (model),
+			       gda_data_model_signals[COLUMN_UPDATED],
+			       0, col);
+
+		gda_data_model_changed (model);
+	}
+}
+
+/**
+ * gda_data_model_column_removed
+ * @model: a #GdaDataModel object.
+ * @col: column number.
+ *
+ * Emits the 'column_removed' and 'changed' signal on @model.
+ */
+void
+gda_data_model_column_removed (GdaDataModel *model, gint col)
+{
+	g_return_if_fail (GDA_IS_DATA_MODEL (model));
+
+	if (model->priv->notify_changes) {
+		g_signal_emit (G_OBJECT (model),
+			       gda_data_model_signals[COLUMN_REMOVED],
+			       0, col);
+
+		gda_data_model_changed (model);
+	}
+}
+
+/**
  * gda_data_model_freeze
  * @model: a #GdaDataModel object.
  *
@@ -542,20 +635,20 @@
 }
 
 /**
- * gda_data_model_is_editable
+ * gda_data_model_is_updatable
  * @model: a #GdaDataModel object.
  *
- * Checks whether the given data model can be edited or not.
+ * Checks whether the given data model can be updated or not.
  *
- * Returns: %TRUE if it can be edited, %FALSE if not.
+ * Returns: %TRUE if it can be updated, %FALSE if not.
  */
 gboolean
-gda_data_model_is_editable (GdaDataModel *model)
+gda_data_model_is_updatable (GdaDataModel *model)
 {
 	g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
-	g_return_val_if_fail (CLASS (model)->is_editable != NULL, FALSE);
+	g_return_val_if_fail (CLASS (model)->is_updatable != NULL, FALSE);
 
-	return CLASS (model)->is_editable (model);
+	return CLASS (model)->is_updatable (model);
 }
 
 /**
@@ -636,6 +729,88 @@
 }
 
 /**
+ * gda_data_model_append_column
+ * @model: a #GdaDataModel object.
+ * @col: a #GdaFieldAttributes describing the column to add.
+ *
+ * Appends a column to the given data model.  If successful, the position of
+ * the new column in the data model is set on @col, and you can grab it using
+ * @gda_field_attributes_get_position.
+ *
+ * Returns: %TRUE if successful, %FALSE otherwise.
+ */
+gboolean
+gda_data_model_append_column (GdaDataModel *model, GdaFieldAttributes *col)
+{
+	gboolean result;
+	
+	g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
+	g_return_val_if_fail (CLASS (model)->append_column != NULL, FALSE);
+	g_return_val_if_fail (col != NULL, FALSE);
+
+	result = CLASS (model)->append_column (model, col);
+	if (result) {
+		gda_data_model_column_inserted (model,
+						gda_field_attributes_get_position (col));
+	}
+
+	return result;
+}
+
+/**
+ * gda_data_model_remove_column
+ * @model: a #GdaDataModel object.
+ * @col: the column to be removed.
+ *
+ * Removes a column from the data model. This means that all values attached to this
+ * column in the data model will be destroyed in the underlying database.
+ *
+ * Returns: %TRUE if successful, %FALSE otherwise.
+ */
+gboolean
+gda_data_model_remove_column (GdaDataModel *model, const GdaFieldAttributes *col)
+{
+	gboolean result;
+
+	g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
+	g_return_val_if_fail (CLASS (model)->remove_column != NULL, FALSE);
+	g_return_val_if_fail (col != NULL, FALSE);
+
+	result = CLASS (model)->remove_column (model, col);
+	if (result) {
+		gda_data_model_column_removed (model, gda_field_attributes_get_position (col));
+	}
+
+	return result;
+}
+
+/**
+ * gda_data_model_update_column
+ * @model: a #GdaDataModel object.
+ * @col: the column to be updated.
+ *
+ * Updates a column in the given data model. This results in the underlying
+ * database row's values being changed.
+ *
+ * Returns: %TRUE if successful, %FALSE otherwise.
+ */
+gboolean
+gda_data_model_update_column (GdaDataModel *model, const GdaFieldAttributes *col)
+{
+	gboolean result;
+
+	g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
+	g_return_val_if_fail (CLASS (model)->update_row != NULL, FALSE);
+	g_return_val_if_fail (col != NULL, FALSE);
+
+	result = CLASS (model)->update_column (model, col);
+	if (result) {
+		gda_data_model_column_updated (model, gda_field_attributes_get_position (col));
+	}
+	return result;
+}
+
+/**
  * gda_data_model_foreach
  * @model: a #GdaDataModel object.
  * @func: callback function.
@@ -677,73 +852,75 @@
 }
 
 /**
- * gda_data_model_is_editing
+ * gda_data_model_is_updated
  * @model: a #GdaDataModel object.
  *
- * Checks whether this data model is in editing mode or not. Editing
- * mode is set to %TRUE when @gda_data_model_begin_edit has been
+ * Checks whether this data model is in updating mode or not. Updating
+ * mode is set to %TRUE when @gda_data_model_begin_update has been
  * called successfully, and is not set back to %FALSE until either
- * @gda_data_model_cancel_edit or @gda_data_model_end_edit have
+ * @gda_data_model_cancel_updating or @gda_data_model_end_update have
  * been called.
  *
- * Returns: %TRUE if editing mode, %FALSE otherwise.
+ * Returns: %TRUE if updating mode, %FALSE otherwise.
  */
 gboolean
-gda_data_model_is_editing (GdaDataModel *model)
+gda_data_model_is_updated (GdaDataModel *model)
 {
 	g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
-	return model->priv->editing;
+	return model->priv->updating;
 }
 
 /**
- * gda_data_model_begin_edit
+ * gda_data_model_begin_update
  * @model: a #GdaDataModel object.
  *
- * Starts edition of this data model. This function should be the
+ * Starts update of this data model. This function should be the
  * first called when modifying the data model.
  *
  * Returns: %TRUE on success, %FALSE if there was an error.
  */
 gboolean
-gda_data_model_begin_edit (GdaDataModel *model)
+gda_data_model_begin_update (GdaDataModel *model)
 {
 	g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
-	g_return_val_if_fail (model->priv->editing == FALSE, FALSE);
+	g_return_val_if_fail (model->priv->updating == FALSE, FALSE);
 
-	if (!gda_data_model_is_editable (model)) {
-		gda_log_error (_("Data model %p is not editable"), model);
+	if (!gda_data_model_is_updatable (model)) {
+		gda_log_error (_("Data model %p is not updatable"), model);
 		return FALSE;
 	}
 
-	model->priv->editing = TRUE;
-	g_signal_emit (G_OBJECT (model), gda_data_model_signals[BEGIN_EDIT], 0);
+	model->priv->updating = TRUE;
+	g_signal_emit (G_OBJECT (model),
+		       gda_data_model_signals[BEGIN_UPDATE], 0);
 
-	return model->priv->editing;
+	return model->priv->updating;
 }
 
 /**
- * gda_data_model_cancel_edit
+ * gda_data_model_cancel_update
  * @model: a #GdaDataModel object.
  *
- * Cancels edition of this data model. This means that all changes
+ * Cancels update of this data model. This means that all changes
  * will be discarded, and the old data put back in the model.
  *
  * Returns: %TRUE on success, %FALSE if there was an error.
  */
 gboolean
-gda_data_model_cancel_edit (GdaDataModel *model)
+gda_data_model_cancel_update (GdaDataModel *model)
 {
 	g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
-	g_return_val_if_fail (model->priv->editing, FALSE);
+	g_return_val_if_fail (model->priv->updating, FALSE);
 
-	g_signal_emit (G_OBJECT (model), gda_data_model_signals[CANCEL_EDIT], 0);
-	model->priv->editing = FALSE;
+	g_signal_emit (G_OBJECT (model),
+		       gda_data_model_signals[CANCEL_UPDATE], 0);
+	model->priv->updating = FALSE;
 
 	return TRUE;
 }
 
 /**
- * gda_data_model_end_edit
+ * gda_data_model_end_update
  * @model: a #GdaDataModel object.
  *
  * Approves all modifications and send them to the underlying
@@ -752,13 +929,13 @@
  * Returns: %TRUE on success, %FALSE if there was an error.
  */
 gboolean
-gda_data_model_end_edit (GdaDataModel *model)
+gda_data_model_end_update (GdaDataModel *model)
 {
 	g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
-	g_return_val_if_fail (model->priv->editing, FALSE);
+	g_return_val_if_fail (model->priv->updating, FALSE);
 
-	g_signal_emit (G_OBJECT (model), gda_data_model_signals[END_EDIT], 0);
-	model->priv->editing = FALSE;
+	g_signal_emit (G_OBJECT (model), gda_data_model_signals[END_UPDATE], 0);
+	model->priv->updating = FALSE;
 
 	return TRUE;
 }
Index: libgda/gda-data-model.h
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-data-model.h,v
retrieving revision 1.22
diff -u -r1.22 gda-data-model.h
--- libgda/gda-data-model.h	18 Oct 2003 23:03:52 -0000	1.22
+++ libgda/gda-data-model.h	2 Dec 2003 16:41:03 -0000
@@ -54,10 +54,13 @@
 	void (* row_inserted) (GdaDataModel *model, gint row);
 	void (* row_updated) (GdaDataModel *model, gint row);
 	void (* row_removed) (GdaDataModel *model, gint row);
-
-	void (* begin_edit) (GdaDataModel *model);
-	void (* cancel_edit) (GdaDataModel *model);
-	void (* end_edit) (GdaDataModel *model);
+	void (* column_inserted) (GdaDataModel *model, gint col);
+	void (* column_updated) (GdaDataModel *model, gint col);
+	void (* column_removed) (GdaDataModel *model, gint col);
+
+	void (* begin_update) (GdaDataModel *model);
+	void (* cancel_update) (GdaDataModel *model);
+	void (* end_update) (GdaDataModel *model);
 
 	/* virtual methods */
 	gint (* get_n_rows) (GdaDataModel *model);
@@ -66,10 +69,16 @@
 	const GdaRow * (* get_row) (GdaDataModel *model, gint row);
 	const GdaValue * (* get_value_at) (GdaDataModel *model, gint col, gint row);
 
-	gboolean (* is_editable) (GdaDataModel *model);
+	gboolean (* is_updatable) (GdaDataModel *model);
 	const GdaRow * (* append_row) (GdaDataModel *model, const GList *values);
 	gboolean (* remove_row) (GdaDataModel *model, const GdaRow *row);
 	gboolean (* update_row) (GdaDataModel *model, const GdaRow *row);
+	gboolean (* append_column) (GdaDataModel *model,
+				    GdaFieldAttributes *col);
+	gboolean (* update_column) (GdaDataModel *model,
+				    const GdaFieldAttributes *col);
+	gboolean (* remove_column) (GdaDataModel *model,
+				    const GdaFieldAttributes *col);
 };
 
 GType               gda_data_model_get_type (void);
@@ -78,6 +87,9 @@
 void                gda_data_model_row_inserted (GdaDataModel *model, gint row);
 void                gda_data_model_row_updated (GdaDataModel *model, gint row);
 void                gda_data_model_row_removed (GdaDataModel *model, gint row);
+void                gda_data_model_column_inserted (GdaDataModel *model, gint col);
+void                gda_data_model_column_updated (GdaDataModel *model, gint col);
+void                gda_data_model_column_removed (GdaDataModel *model, gint col);
 void                gda_data_model_freeze (GdaDataModel *model);
 void                gda_data_model_thaw (GdaDataModel *model);
 
@@ -90,10 +102,16 @@
 const GdaRow       *gda_data_model_get_row (GdaDataModel *model, gint row);
 const GdaValue     *gda_data_model_get_value_at (GdaDataModel *model, gint col, gint row);
 
-gboolean            gda_data_model_is_editable (GdaDataModel *model);
+gboolean            gda_data_model_is_updatable (GdaDataModel *model);
 const GdaRow       *gda_data_model_append_row (GdaDataModel *model, const GList *values);
 gboolean            gda_data_model_remove_row (GdaDataModel *model, const GdaRow *row);
 gboolean            gda_data_model_update_row (GdaDataModel *model, const GdaRow *row);
+gboolean	    gda_data_model_append_column (GdaDataModel *model,
+						  GdaFieldAttributes *col);
+gboolean	    gda_data_model_update_column (GdaDataModel *model,
+						  const GdaFieldAttributes *col);
+gboolean	    gda_data_model_remove_column (GdaDataModel *model,
+						  const GdaFieldAttributes *col);
 
 typedef gboolean (* GdaDataModelForeachFunc) (GdaDataModel *model,
 					      GdaRow *row,
@@ -103,10 +121,10 @@
 					    GdaDataModelForeachFunc func,
 					    gpointer user_data);
 
-gboolean            gda_data_model_is_editing (GdaDataModel *model);
-gboolean            gda_data_model_begin_edit (GdaDataModel *model);
-gboolean            gda_data_model_cancel_edit (GdaDataModel *model);
-gboolean            gda_data_model_end_edit (GdaDataModel *model);
+gboolean            gda_data_model_is_updated (GdaDataModel *model);
+gboolean            gda_data_model_begin_update (GdaDataModel *model);
+gboolean            gda_data_model_cancel_update (GdaDataModel *model);
+gboolean            gda_data_model_end_update (GdaDataModel *model);
 
 gchar              *gda_data_model_to_comma_separated (GdaDataModel *model);
 gchar              *gda_data_model_to_tab_separated (GdaDataModel *model);
Index: libgda/gda-select.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-select.c,v
retrieving revision 1.13
diff -u -r1.13 gda-select.c
--- libgda/gda-select.c	16 Nov 2003 01:28:36 -0000	1.13
+++ libgda/gda-select.c	2 Dec 2003 16:41:04 -0000
@@ -91,7 +91,7 @@
 }
 
 static gboolean
-gda_select_is_editable (GdaDataModel *model)
+gda_select_is_updatable (GdaDataModel *model)
 {
 	GdaSelect *sel = (GdaSelect *) model;
 
@@ -123,7 +123,7 @@
 	model_class->describe_column = gda_select_describe_column;
 	model_class->get_row = gda_select_get_row;
 	/* we use the get_value_at of the base class */
-	model_class->is_editable = gda_select_is_editable;
+	model_class->is_updatable = gda_select_is_updatable;
 	model_class->append_row = gda_select_append_row;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]