ETableModel

ETableModel

Types and Values

Object Hierarchy

    GInterface
    ╰── ETableModel

Description

Functions

e_table_model_column_count ()

gint
e_table_model_column_count (ETableModel *table_model);

Parameters

table_model

The e-table-model to operate on

 

Returns

the number of columns in the table model.


e_table_model_column_name ()

const gchar *
e_table_model_column_name (ETableModel *table_model,
                           gint col);

e_table_model_row_count ()

gint
e_table_model_row_count (ETableModel *table_model);

Parameters

table_model

the e-table-model to operate on

 

Returns

the number of rows in the Table model.


e_table_model_append_row ()

void
e_table_model_append_row (ETableModel *table_model,
                          ETableModel *source,
                          gint row);

Parameters

table_model

the table model to append the a row to.

 

e_table_model_value_at ()

gpointer
e_table_model_value_at (ETableModel *table_model,
                        gint col,
                        gint row);

e_table_model_set_value_at ()

void
e_table_model_set_value_at (ETableModel *table_model,
                            gint col,
                            gint row,
                            gconstpointer value);

This function instructs the model to store the value in data in the the table_model at column col and row row . The data typically comes from one of the ECell rendering objects.

There should be an agreement between the Table Model and the user of this function about the data being stored. Typically it will be a pointer to a set of data, or a datum that fits inside a gpointer .

Parameters

table_model

the table model to operate on.

 

col

the column where the data will be stored in the model.

 

row

the row where the data will be stored in the model.

 

value

the data to be stored.

 

e_table_model_is_cell_editable ()

gboolean
e_table_model_is_cell_editable (ETableModel *table_model,
                                gint col,
                                gint row);

Parameters

table_model

the table model to query.

 

col

column to query.

 

row

row to query.

 

Returns

TRUE if the cell in table_model at col ,row can be edited, FALSE otherwise


e_table_model_has_save_id ()

gboolean
e_table_model_has_save_id (ETableModel *table_model);

e_table_model_get_save_id ()

gchar *
e_table_model_get_save_id (ETableModel *table_model,
                           gint row);

e_table_model_has_change_pending ()

gboolean
e_table_model_has_change_pending (ETableModel *table_model);

e_table_model_duplicate_value ()

gpointer
e_table_model_duplicate_value (ETableModel *table_model,
                               gint col,
                               gconstpointer value);

e_table_model_free_value ()

void
e_table_model_free_value (ETableModel *table_model,
                          gint col,
                          gpointer value);

e_table_model_initialize_value ()

gpointer
e_table_model_initialize_value (ETableModel *table_model,
                                gint col);

e_table_model_value_is_empty ()

gboolean
e_table_model_value_is_empty (ETableModel *table_model,
                              gint col,
                              gconstpointer value);

e_table_model_value_to_string ()

gchar *
e_table_model_value_to_string (ETableModel *table_model,
                               gint col,
                               gconstpointer value);

e_table_model_pre_change ()

void
e_table_model_pre_change (ETableModel *table_model);

e_table_model_no_change ()

void
e_table_model_no_change (ETableModel *table_model);

Use this function to notify any views of this table model that the contents of the table model have changed. This will emit the signal "model_no_change" on the table_model object.

It is preferable to use the e_table_model_row_changed() and the e_table_model_cell_changed() to notify of smaller changes than to invalidate the entire model, as the views might have ways of caching the information they render from the model.

Parameters

table_model

the table model to notify of the lack of a change

 

e_table_model_changed ()

void
e_table_model_changed (ETableModel *table_model);

Use this function to notify any views of this table model that the contents of the table model have changed. This will emit the signal "model_changed" on the table_model object.

It is preferable to use the e_table_model_row_changed() and the e_table_model_cell_changed() to notify of smaller changes than to invalidate the entire model, as the views might have ways of caching the information they render from the model.

Parameters

table_model

the table model to notify of the change

 

e_table_model_row_changed ()

void
e_table_model_row_changed (ETableModel *table_model,
                           gint row);

Use this function to notify any views of the table model that the contents of row row have changed in model. This function will emit the "model_row_changed" signal on the table_model object

Parameters

table_model

the table model to notify of the change

 

row

the row that was changed in the model.

 

e_table_model_cell_changed ()

void
e_table_model_cell_changed (ETableModel *table_model,
                            gint col,
                            gint row);

Use this function to notify any views of the table model that contents of the cell at col ,row has changed. This will emit the "model_cell_changed" signal on the table_model object

Parameters

table_model

the table model to notify of the change

 

col

the column.

 

row

the row

 

e_table_model_rows_inserted ()

void
e_table_model_rows_inserted (ETableModel *table_model,
                             gint row,
                             gint count);

Use this function to notify any views of the table model that count rows at row row have been inserted into the model. This function will emit the "model_rows_inserted" signal on the table_model object

Parameters

table_model

the table model to notify of the change

 

row

the row that was inserted into the model.

 

count

The number of rows that were inserted.

 

e_table_model_rows_deleted ()

void
e_table_model_rows_deleted (ETableModel *table_model,
                            gint row,
                            gint count);

e_table_model_row_inserted ()

void
e_table_model_row_inserted (ETableModel *table_model,
                            gint row);

Use this function to notify any views of the table model that the row row has been inserted into the model. This function will emit the "model_rows_inserted" signal on the table_model object

Parameters

table_model

the table model to notify of the change

 

row

the row that was inserted into the model.

 

e_table_model_row_deleted ()

void
e_table_model_row_deleted (ETableModel *table_model,
                           gint row);

Use this function to notify any views of the table model that the row row has been deleted from the model. This function will emit the "model_rows_deleted" signal on the table_model object

Parameters

table_model

the table model to notify of the change

 

row

the row that was deleted

 

e_table_model_freeze ()

void
e_table_model_freeze (ETableModel *table_model);

e_table_model_thaw ()

void
e_table_model_thaw (ETableModel *table_model);

Types and Values

struct ETableModelInterface

struct ETableModelInterface {
	GTypeInterface parent_interface;

	gint		(*column_count)		(ETableModel *table_model);
	gint		(*row_count)		(ETableModel *table_model);
	void		(*append_row)		(ETableModel *table_model,
						 ETableModel *source,
						 gint row);

	gpointer (*value_at)		(ETableModel *table_model,
						 gint col,
						 gint row);
	void		(*set_value_at)		(ETableModel *table_model,
						 gint col,
						 gint row,
						 gconstpointer value);
	gboolean (*is_cell_editable) (ETableModel *table_model,
						 gint col,
						 gint row);

	gboolean (*has_save_id)		(ETableModel *table_model);
	gchar *		(*get_save_id)		(ETableModel *table_model,
						 gint row);

	gboolean (*has_change_pending) (ETableModel *table_model);

	/* Allocate a copy of the given value. */
	gpointer (*duplicate_value) (ETableModel *table_model,
						 gint col,
						 gconstpointer value);
	/* Free an allocated value. */
	void		(*free_value)		(ETableModel *table_model,
						 gint col,
						 gpointer value);
	/* Return an allocated empty value. */
	gpointer (*initialize_value) (ETableModel *table_model,
						 gint col);
	/* Return TRUE if value is equivalent to an empty cell. */
	gboolean (*value_is_empty) (ETableModel *table_model,
						 gint col,
						 gconstpointer value);
	/* Return an allocated string. */
	gchar *		(*value_to_string) (ETableModel *table_model,
						 gint col,
						 gconstpointer value);

	/*
	 * Signals
	 */

	/*
	 * These all come after the change has been made.
	 * No changes, cancel pre_change: no_change
	 * Major structural changes: model_changed
	 * Changes only in a row: row_changed
	 * Only changes in a cell: cell_changed
	 * A row inserted: row_inserted
	 * A row deleted: row_deleted
	 */
	void		(*model_pre_change) (ETableModel *table_model);

	void		(*model_no_change) (ETableModel *table_model);
	void		(*model_changed) (ETableModel *table_model);
	void		(*model_row_changed) (ETableModel *table_model,
						 gint row);
	void		(*model_cell_changed) (ETableModel *table_model,
						 gint col,
						 gint row);
	void		(*model_rows_inserted) (ETableModel *table_model,
						 gint row,
						 gint count);
	void		(*model_rows_deleted) (ETableModel *table_model,
						 gint row,
						 gint count);
};

Signal Details

The “model-cell-changed” signal

void
user_function (ETableModel *etablemodel,
               gint         arg1,
               gint         arg2,
               gpointer     user_data)

Flags: Run Last


The “model-changed” signal

void
user_function (ETableModel *etablemodel,
               gpointer     user_data)

Flags: Run Last


The “model-no-change” signal

void
user_function (ETableModel *etablemodel,
               gpointer     user_data)

Flags: Run Last


The “model-pre-change” signal

void
user_function (ETableModel *etablemodel,
               gpointer     user_data)

Flags: Run Last


The “model-row-changed” signal

void
user_function (ETableModel *etablemodel,
               gint         arg1,
               gpointer     user_data)

Flags: Run Last


The “model-rows-deleted” signal

void
user_function (ETableModel *etablemodel,
               gint         arg1,
               gint         arg2,
               gpointer     user_data)

Flags: Run Last


The “model-rows-inserted” signal

void
user_function (ETableModel *etablemodel,
               gint         arg1,
               gint         arg2,
               gpointer     user_data)

Flags: Run Last