sheet.h 1.39 KB
Newer Older
Arturo Espinosa's avatar
Arturo Espinosa committed
1
2
#ifndef SHEET_H
#define SHEET_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16

typedef GList ColStyleList;

struct Workbook;

typedef struct {
	RowType    row;
	int        height;
	Style      *style;		/* if existant, this row style */
} RowInfo;

typedef struct {
	ColType    col;
	int        width;
17
	Style      *style;		/* if existant, this column style */
18
19
20
} ColInfo;

typedef struct {
Arturo Espinosa's avatar
Arturo Espinosa committed
21
22
23
24
25
26
27
28
29
30
	GtkWidget  *toplevel;
	GtkWidget  *notebook;
	
	Style      style;
	GHashTable *sheets;	/* keeps a list of the Sheets on this workbook */
} Workbook;

typedef struct {
	Workbook   *parent_workbook;
	GtkWidget  *sheet_view;
31
32
33
	char       *name;
		   
	Style      style;
34
35

	ColInfo    default_col_style;
36
	GList      *cols_info;
37
38

	RowInfo    default_row_style;
39
40
41
42
	GList      *rows_info;
	void       *contents;
} Sheet;

Arturo Espinosa's avatar
Arturo Espinosa committed
43
Sheet    *sheet_new                (Workbook *wb, char *name);
44
45
ColInfo  *sheet_get_col_info       (Sheet *, int col);
RowInfo  *sheet_get_row_info       (Sheet *, int row);
46
47
48
int       sheet_col_get_distance   (Sheet *sheet, int from_col, int to_col);
int       sheet_row_get_distance   (Sheet *sheet, int from_row, int to_row);

Arturo Espinosa's avatar
Arturo Espinosa committed
49
50
51
52
53

Workbook *workbook_new             (void);
Workbook *workbook_new_with_sheets (int sheet_count);
void      workbook_attach_sheet    (Workbook *, Sheet *);

54
55
56
57
58
59
/*
 * Callback routine: invoked when the first view ItemGrid
 * is realized to allocate the default styles
 */
void     workbook_realized         (Workbook *, GdkWindow *);

60
#endif