sheet.h 1.17 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
34
35
36
37
38
	char       *name;
		   
	Style      style;
	GList      *cols_info;
	GList      *rows_info;
	void       *contents;
} Sheet;

Arturo Espinosa's avatar
Arturo Espinosa committed
39
Sheet    *sheet_new                (Workbook *wb, char *name);
40
41
ColInfo  *sheet_get_col_info       (Sheet *, int col);
RowInfo  *sheet_get_row_info       (Sheet *, int row);
Arturo Espinosa's avatar
Arturo Espinosa committed
42
43
44
45
46

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

47
48
49
50
51
52
/*
 * Callback routine: invoked when the first view ItemGrid
 * is realized to allocate the default styles
 */
void     workbook_realized         (Workbook *, GdkWindow *);

53
#endif