Files
evolution/widgets/table/e-table-model.h
Christopher James Lahey c3e3a85f28 Changed the license announcement at the top of these files.
2001-10-26  Christopher James Lahey  <clahey@ximian.com>

	* e-cell-checkbox.c, e-cell-checkbox.h, e-cell-combo.c,
	e-cell-combo.h, e-cell-date.c, e-cell-date.h, e-cell-number.c,
	e-cell-number.h, e-cell-pixbuf.c, e-cell-pixbuf.h, e-cell-popup.c,
	e-cell-popup.h, e-cell-size.c, e-cell-size.h,
	e-cell-spin-button.c, e-cell-spin-button.h, e-cell-string.c,
	e-cell-text.c, e-cell-text.h, e-cell-toggle.c, e-cell-toggle.h,
	e-cell-tree.c, e-cell-tree.h, e-cell.c, e-cell.h,
	e-table-click-to-add.c, e-table-click-to-add.h, e-table-col-dnd.h,
	e-table-col.c, e-table-col.h, e-table-column-specification.c,
	e-table-column-specification.h, e-table-column.c,
	e-table-config-field.c, e-table-config-field.h, e-table-config.c,
	e-table-config.h, e-table-defines.h, e-table-example-1.c,
	e-table-example-2.c, e-table-extras.c, e-table-extras.h,
	e-table-field-chooser-dialog.c, e-table-field-chooser-dialog.h,
	e-table-field-chooser-item.c, e-table-field-chooser-item.h,
	e-table-field-chooser.c, e-table-field-chooser.h,
	e-table-group-container.c, e-table-group-container.h,
	e-table-group-leaf.c, e-table-group-leaf.h, e-table-group.c,
	e-table-group.h, e-table-header-item.c, e-table-header-item.h,
	e-table-header-utils.c, e-table-header-utils.h, e-table-header.c,
	e-table-header.h, e-table-item.c, e-table-item.h,
	e-table-memory-callbacks.c, e-table-memory-callbacks.h,
	e-table-memory.c, e-table-memory.h, e-table-model.c,
	e-table-model.h, e-table-one.c, e-table-one.h, e-table-scrolled.c,
	e-table-scrolled.h, e-table-selection-model.c,
	e-table-selection-model.h, e-table-simple.c, e-table-simple.h,
	e-table-size-test.c, e-table-sort-info.c, e-table-sort-info.h,
	e-table-sorted-variable.c, e-table-sorted-variable.h,
	e-table-sorted.c, e-table-sorted.h, e-table-sorter.c,
	e-table-sorter.h, e-table-sorting-utils.c,
	e-table-sorting-utils.h, e-table-specification.c,
	e-table-specification.h, e-table-state.c, e-table-state.h,
	e-table-subset-variable.c, e-table-subset-variable.h,
	e-table-subset.c, e-table-subset.h, e-table-tooltip.h,
	e-table-tree.h, e-table-utils.c, e-table-utils.h,
	e-table-without.c, e-table-without.h, e-table.c, e-table.h,
	e-tree-memory-callbacks.c, e-tree-memory-callbacks.h,
	e-tree-memory.c, e-tree-memory.h, e-tree-model.c, e-tree-model.h,
	e-tree-scrolled.c, e-tree-scrolled.h, e-tree-selection-model.c,
	e-tree-selection-model.h, e-tree-simple.c, e-tree-simple.h,
	e-tree-sorted-variable.c, e-tree-sorted-variable.h,
	e-tree-sorted.c, e-tree-sorted.h, e-tree-table-adapter.c,
	e-tree-table-adapter.h, e-tree.c, e-tree.h, table-test.c,
	table-test.h, test-check.c, test-cols.c, test-table.c: Changed the
	license announcement at the top of these files.

	* e-cell-string.c: Removed unused file.

svn path=/trunk/; revision=14154
2001-10-26 18:25:47 +00:00

171 lines
6.1 KiB
C

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* e-table-model.h
* Copyright 2000, 2001, Ximian, Inc.
*
* Authors:
* Chris Lahey <clahey@ximian.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License, version 2, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _E_TABLE_MODEL_H_
#define _E_TABLE_MODEL_H_
#include <gtk/gtkobject.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define E_TABLE_MODEL_TYPE (e_table_model_get_type ())
#define E_TABLE_MODEL(o) (GTK_CHECK_CAST ((o), E_TABLE_MODEL_TYPE, ETableModel))
#define E_TABLE_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_MODEL_TYPE, ETableModelClass))
#define E_IS_TABLE_MODEL(o) (GTK_CHECK_TYPE ((o), E_TABLE_MODEL_TYPE))
#define E_IS_TABLE_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_MODEL_TYPE))
typedef struct {
GtkObject base;
} ETableModel;
typedef struct {
GtkObjectClass parent_class;
/*
* Virtual methods
*/
int (*column_count) (ETableModel *etm);
int (*row_count) (ETableModel *etm);
void (*append_row) (ETableModel *etm, ETableModel *source, int row);
void *(*value_at) (ETableModel *etm, int col, int row);
void (*set_value_at) (ETableModel *etm, int col, int row, const void *value);
gboolean (*is_cell_editable) (ETableModel *etm, int col, int row);
gboolean (*has_save_id) (ETableModel *etm);
char *(*get_save_id) (ETableModel *etm, int row);
gboolean (*has_change_pending) (ETableModel *etm);
/* Allocate a copy of the given value. */
void *(*duplicate_value) (ETableModel *etm, int col, const void *value);
/* Free an allocated value. */
void (*free_value) (ETableModel *etm, int col, void *value);
/* Return an allocated empty value. */
void *(*initialize_value) (ETableModel *etm, int col);
/* Return TRUE if value is equivalent to an empty cell. */
gboolean (*value_is_empty) (ETableModel *etm, int col, const void *value);
/* Return an allocated string. */
char *(*value_to_string) (ETableModel *etm, int col, const void *value);
/*
* Signals
*/
/*
* These all come after the change has been made.
* 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 *etm);
void (*model_changed) (ETableModel *etm);
void (*model_row_changed) (ETableModel *etm, int row);
void (*model_cell_changed) (ETableModel *etm, int col, int row);
void (*model_rows_inserted) (ETableModel *etm, int row, int count);
void (*model_rows_deleted) (ETableModel *etm, int row, int count);
} ETableModelClass;
GtkType e_table_model_get_type (void);
/**/
int e_table_model_column_count (ETableModel *e_table_model);
const char *e_table_model_column_name (ETableModel *e_table_model,
int col);
int e_table_model_row_count (ETableModel *e_table_model);
void e_table_model_append_row (ETableModel *e_table_model,
ETableModel *source,
int row);
/**/
void *e_table_model_value_at (ETableModel *e_table_model,
int col,
int row);
void e_table_model_set_value_at (ETableModel *e_table_model,
int col,
int row,
const void *value);
gboolean e_table_model_is_cell_editable (ETableModel *e_table_model,
int col,
int row);
/**/
gboolean e_table_model_has_save_id (ETableModel *etm);
char *e_table_model_get_save_id (ETableModel *etm,
int row);
/**/
gboolean e_table_model_has_change_pending (ETableModel *etm);
/**/
void *e_table_model_duplicate_value (ETableModel *e_table_model,
int col,
const void *value);
void e_table_model_free_value (ETableModel *e_table_model,
int col,
void *value);
void *e_table_model_initialize_value (ETableModel *e_table_model,
int col);
gboolean e_table_model_value_is_empty (ETableModel *e_table_model,
int col,
const void *value);
char *e_table_model_value_to_string (ETableModel *e_table_model,
int col,
const void *value);
/*
* Routines for emitting signals on the e_table
*/
void e_table_model_pre_change (ETableModel *e_table_model);
void e_table_model_changed (ETableModel *e_table_model);
void e_table_model_row_changed (ETableModel *e_table_model,
int row);
void e_table_model_cell_changed (ETableModel *e_table_model,
int col,
int row);
void e_table_model_rows_inserted (ETableModel *e_table_model,
int row,
int count);
void e_table_model_rows_deleted (ETableModel *e_table_model,
int row,
int count);
/**/
void e_table_model_row_inserted (ETableModel *e_table_model,
int row);
void e_table_model_row_deleted (ETableModel *e_table_model,
int row);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _E_TABLE_MODEL_H_ */