Files
evolution/widgets/table/e-table-selection-model.h
Christopher James Lahey 7d1cbbaa10 Made this conform to the new prototype for e_popup_menu_run.
2001-01-21  Christopher James Lahey  <clahey@helixcode.com>

	* e-table-header-item.c (ethi_header_context_menu): Made this
	conform to the new prototype for e_popup_menu_run.

	* e-table-item.c, e-table-item.h: Documented.
	(e_table_item_is_row_selected): Removed this function.
	(eti_draw): Changed this so that if the ETableItem is in
	cursor-mode="row", the cursor is draw all the way across the row.
	(eti_cursor_move_up, eti_cursor_move_down): Commented these out
	since they're no longer used.
	(_do_tooltip, eti_event): Commented out tooltips.
	(eti_event): Made it so that we call the key_press function in the
	%ETableSelectionModel on each key press.

	* e-table-selection-model.c, e-table-selection-model.h:
	Documented.  Added a function e_table_selection_model_key_press
	that does whatever behavior is correct for the user having pressed
	the given key.  Changed the behavior of this to better match
	windows (use selection-mode="browse").

	* e-table-specification.c, e-table-specification.h: Added a
	draw_focus variable.

	* e-table.c: Decide whether to draw the focus based on the
	ETableSpecification.  Removed the argument for setting whether to
	draw the focus.

svn path=/trunk/; revision=7673
2001-01-21 05:46:49 +00:00

77 lines
2.9 KiB
C

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef _E_TABLE_SELECTION_MODEL_H_
#define _E_TABLE_SELECTION_MODEL_H_
#include <gtk/gtkobject.h>
#include <gal/e-table/e-table-model.h>
#include <gal/e-table/e-table-defines.h>
#include <gal/e-table/e-table-sorter.h>
#define E_TABLE_SELECTION_MODEL_TYPE (e_table_selection_model_get_type ())
#define E_TABLE_SELECTION_MODEL(o) (GTK_CHECK_CAST ((o), E_TABLE_SELECTION_MODEL_TYPE, ETableSelectionModel))
#define E_TABLE_SELECTION_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TABLE_SELECTION_MODEL_TYPE, ETableSelectionModelClass))
#define E_IS_TABLE_SELECTION_MODEL(o) (GTK_CHECK_TYPE ((o), E_TABLE_SELECTION_MODEL_TYPE))
#define E_IS_TABLE_SELECTION_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TABLE_SELECTION_MODEL_TYPE))
typedef struct {
GtkObject base;
ETableModel *model;
ETableSorter *sorter;
gint row_count;
guint32 *selection;
gint cursor_row;
gint cursor_col;
gint selection_start_row;
guint model_changed_id;
guint model_row_inserted_id, model_row_deleted_id;
guint frozen : 1;
guint selection_model_changed : 1;
guint group_info_changed : 1;
GtkSelectionMode mode;
} ETableSelectionModel;
typedef struct {
GtkObjectClass parent_class;
/*
* Signals
*/
void (*cursor_changed) (ETableSelectionModel *selection, int row, int col);
void (*selection_changed) (ETableSelectionModel *selection);
} ETableSelectionModelClass;
GtkType e_table_selection_model_get_type (void);
gboolean e_table_selection_model_is_row_selected (ETableSelectionModel *selection,
gint n);
void e_table_selection_model_foreach (ETableSelectionModel *selection,
ETableForeachFunc callback,
gpointer closure);
void e_table_selection_model_do_something (ETableSelectionModel *selection,
guint row,
guint col,
GdkModifierType state);
void e_table_selection_model_maybe_do_something (ETableSelectionModel *selection,
guint row,
guint col,
GdkModifierType state);
gint e_table_selection_model_key_press (ETableSelectionModel *selection,
GdkEventKey *key);
void e_table_selection_model_clear (ETableSelectionModel *selection);
gint e_table_selection_model_selected_count (ETableSelectionModel *selection);
void e_table_selection_model_select_all (ETableSelectionModel *selection);
void e_table_selection_model_invert_selection (ETableSelectionModel *selection);
ETableSelectionModel *e_table_selection_model_new (void);
#endif /* _E_TABLE_SELECTION_MODEL_H_ */