gnumeric-canvas.h 2.59 KB
Newer Older
1 2 3
#ifndef GNUMERIC_SHEET_H
#define GNUMERIC_SHEET_H

Arturo Espinosa's avatar
Arturo Espinosa committed
4
#include "item-grid.h"
5
#include "item-cursor.h"
6
#include "item-bar.h"
7
#include "item-edit.h"
Arturo Espinosa's avatar
Arturo Espinosa committed
8

9 10
#define GNUMERIC_TYPE_SHEET     (gnumeric_sheet_get_type ())
#define GNUMERIC_SHEET(obj)     (GTK_CHECK_CAST((obj), GNUMERIC_TYPE_SHEET, GnumericSheet))
Arturo Espinosa's avatar
Arturo Espinosa committed
11
#define GNUMERIC_SHEET_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), GNUMERIC_TYPE_SHEET))
12 13
#define GNUMERIC_IS_SHEET(o)    (GTK_CHECK_TYPE((o), GNUMERIC_TYPE_SHEET))

14 15 16 17 18 19 20 21
#define GNUMERIC_SHEET_PATTERNS 13
typedef struct {
	char *name;
	char pattern [8];
} gnumeric_sheet_pattern_t;

extern gnumeric_sheet_pattern_t gnumeric_sheet_patterns [GNUMERIC_SHEET_PATTERNS];

22
typedef struct {
23
	GnomeCanvas   canvas;
24

25 26
	GtkWidget     *entry;
	SheetView     *sheet_view;
27
	
28 29
	ColType       top_col, last_visible_col, last_full_col;
	RowType       top_row, last_visible_row, last_full_row;
30

31 32 33
	ItemGrid      *item_grid;
	ItemCursor    *item_cursor;
	ItemBar       *item_bar_col;
34

35
	ItemEdit      *item_editor;
36

37 38
	SheetModeType mode;
	
39 40 41 42
	/* This flag keeps track of a cell selector
	 * (ie, when the user uses the cursor keys
	 * to select a cell for an expression).
	 */
43 44 45 46 47 48 49 50
	int           selecting_cell;
	int           sel_cursor_pos;
	int           sel_text_len;
	ItemCursor    *selection;
	ItemBar       *colbar;
	ItemBar       *rowbar;

	GdkPixmap     *patterns [GNUMERIC_SHEET_PATTERNS];
51 52
} GnumericSheet;

53
GtkType    gnumeric_sheet_get_type               (void);
54

Arturo Espinosa's avatar
Arturo Espinosa committed
55
GtkWidget *gnumeric_sheet_new            	 (SheetView *sheet, ItemBar *colbar, ItemBar *rowbar);
Arturo Espinosa's avatar
Arturo Espinosa committed
56 57
void       gnumeric_sheet_set_selection  	 (GnumericSheet *gsheet, SheetSelection *ss);
void       gnumeric_sheet_cursor_set     	 (GnumericSheet *gsheet,
58
					 	  int col, int row);
59 60
void       gnumeric_sheet_move_cursor            (GnumericSheet *gsheet,
						  int col, int row);
Arturo Espinosa's avatar
Arturo Espinosa committed
61 62 63
void       gnumeric_sheet_set_cursor_bounds      (GnumericSheet *gsheet,
						  int start_col, int start_row,
						  int end_col,   int end_row);
Arturo Espinosa's avatar
Arturo Espinosa committed
64
void       gnumeric_sheet_stop_editing           (GnumericSheet *sheet);
65
void       gnumeric_sheet_compute_visible_ranges (GnumericSheet *gsheet);
Arturo Espinosa's avatar
Arturo Espinosa committed
66 67
void       gnumeric_sheet_make_cell_visible      (GnumericSheet *gsheet,
						  int col, int row);
Arturo Espinosa's avatar
Arturo Espinosa committed
68 69 70 71 72 73
void       gnumeric_sheet_get_cell_bounds        (GnumericSheet *gsheet,
						  int col, int row,
						  int *x, int *y, int *w, int *h);
void       gnumeric_sheet_stop_cell_selection    (GnumericSheet *gsheet);
void       gnumeric_sheet_create_editing_cursor  (GnumericSheet *gsheet);
void       gnumeric_sheet_destroy_editing_cursor (GnumericSheet *gsheet);
74

75 76 77 78
typedef struct {
	GnomeCanvasClass parent_class;
} GnumericSheetClass;
#endif
Arturo Espinosa's avatar
Arturo Espinosa committed
79

Arturo Espinosa's avatar
Arturo Espinosa committed
80