aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-selection-model.h
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-02-28 11:32:47 +0800
committerChris Lahey <clahey@src.gnome.org>2001-02-28 11:32:47 +0800
commit5a2e01a7af2f63f01ce96c6f82fd66bdbb7f9cea (patch)
treee8252dc240da56d1ffef75df3a866c0b60575c91 /widgets/misc/e-selection-model.h
parent6a66325bfab3748dd00d4aac8d1da85e832a034a (diff)
downloadgsoc2013-evolution-5a2e01a7af2f63f01ce96c6f82fd66bdbb7f9cea.tar
gsoc2013-evolution-5a2e01a7af2f63f01ce96c6f82fd66bdbb7f9cea.tar.gz
gsoc2013-evolution-5a2e01a7af2f63f01ce96c6f82fd66bdbb7f9cea.tar.bz2
gsoc2013-evolution-5a2e01a7af2f63f01ce96c6f82fd66bdbb7f9cea.tar.lz
gsoc2013-evolution-5a2e01a7af2f63f01ce96c6f82fd66bdbb7f9cea.tar.xz
gsoc2013-evolution-5a2e01a7af2f63f01ce96c6f82fd66bdbb7f9cea.tar.zst
gsoc2013-evolution-5a2e01a7af2f63f01ce96c6f82fd66bdbb7f9cea.zip
Added e-sorter.lo and e-selection-model.lo.
2001-02-27 Christopher James Lahey <clahey@ximian.com> * gal/Makefile.am: Added e-sorter.lo and e-selection-model.lo. * gal/util/Makefile.am: Added e-sorter.c and e-sorter.h. * gal/util/e-sorter.c, gal/util/e-sorter.h: New class. This is a new simple virtual class for use with ESelectionModel. It implements the same set of methods as ETableSorter but the default behavior is as if the sorting was a no-op. * gal/widgets/Makefile.am: Added e-selection-model.c and e-selection-model.h. * gal/widgets/e-selection-model.c, gal/widgets/e-selection-model.h: New class. Implements all of the semantics of ETableSelectionModel except for the connection to the ETableModel. svn path=/trunk/; revision=8421
Diffstat (limited to 'widgets/misc/e-selection-model.h')
-rw-r--r--widgets/misc/e-selection-model.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/widgets/misc/e-selection-model.h b/widgets/misc/e-selection-model.h
new file mode 100644
index 0000000000..564a3e6e50
--- /dev/null
+++ b/widgets/misc/e-selection-model.h
@@ -0,0 +1,100 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+#ifndef _E_SELECTION_MODEL_H_
+#define _E_SELECTION_MODEL_H_
+
+#include <gtk/gtkobject.h>
+#include <gal/util/e-sorter.h>
+#include <gdk/gdktypes.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define E_SELECTION_MODEL_TYPE (e_selection_model_get_type ())
+#define E_SELECTION_MODEL(o) (GTK_CHECK_CAST ((o), E_SELECTION_MODEL_TYPE, ESelectionModel))
+#define E_SELECTION_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_SELECTION_MODEL_TYPE, ESelectionModelClass))
+#define E_IS_SELECTION_MODEL(o) (GTK_CHECK_TYPE ((o), E_SELECTION_MODEL_TYPE))
+#define E_IS_SELECTION_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_SELECTION_MODEL_TYPE))
+
+typedef void (*EForeachFunc) (int model_row,
+ gpointer closure);
+
+/* list selection modes */
+typedef enum {
+ E_CURSOR_LINE,
+ E_CURSOR_SIMPLE,
+ E_CURSOR_SPREADSHEET,
+} ECursorMode;
+
+typedef struct {
+ GtkObject base;
+
+ ESorter *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;
+ ECursorMode cursor_mode;
+} ESelectionModel;
+
+typedef struct {
+ GtkObjectClass parent_class;
+
+ gint (*get_row_count) (ESelectionModel *selection);
+
+ /*
+ * Signals
+ */
+
+ void (*cursor_changed) (ESelectionModel *selection, int row, int col);
+ void (*cursor_activated) (ESelectionModel *selection, int row, int col);
+ void (*selection_changed) (ESelectionModel *selection);
+
+} ESelectionModelClass;
+
+GtkType e_selection_model_get_type (void);
+gboolean e_selection_model_is_row_selected (ESelectionModel *selection,
+ gint n);
+void e_selection_model_foreach (ESelectionModel *selection,
+ EForeachFunc callback,
+ gpointer closure);
+void e_selection_model_do_something (ESelectionModel *selection,
+ guint row,
+ guint col,
+ GdkModifierType state);
+void e_selection_model_maybe_do_something (ESelectionModel *selection,
+ guint row,
+ guint col,
+ GdkModifierType state);
+gint e_selection_model_key_press (ESelectionModel *selection,
+ GdkEventKey *key);
+void e_selection_model_clear (ESelectionModel *selection);
+gint e_selection_model_selected_count (ESelectionModel *selection);
+void e_selection_model_select_all (ESelectionModel *selection);
+void e_selection_model_invert_selection (ESelectionModel *selection);
+void e_selection_model_insert_row (ESelectionModel *esm,
+ int row);
+void e_selection_model_delete_row (ESelectionModel *esm,
+ int row);
+
+/* Virtual Function */
+gint e_selection_model_get_row_count (ESelectionModel *esm);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* _E_SELECTION_MODEL_H_ */