2008-06-06 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / tests / dummyatk / my-atk-table.h
1 #ifndef MY_ATK_TABLE_H
2 #define MY_ATK_TABLE_H
3
4 #include <glib-object.h>
5 #include <atk/atk.h> 
6 #include <my-atk-object.h>
7     
8 #define MY_TYPE_ATK_TABLE             (my_atk_table_get_type ())
9 #define MY_ATK_TABLE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), MY_TYPE_ATK_TABLE, MyAtkTable))
10 #define MY_ATK_TABLE_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), MY_TYPE_ATK_TABLE, MyAtkTableClass))
11 #define MY_IS_ATK_TABLE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MY_TYPE_ATK_TABLE))
12 #define MY_IS_ATK_TABLE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MY_TYPE_ATK_TABLE))
13 #define MY_ATK_TABLE_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), MY_TYPE_ATK_TABLE, MyAtkTableClass))
14
15 #define NROWS 4     /* row count */
16 #define NCOLS 5     /* column count */
17
18 static gint ids[NROWS][NCOLS] = 
19     { {0,  1,  2,  2,  3},
20       {4,  5,  6,  7,  8},
21       {9,  9, 10, 11, 12},
22       {9,  9, 13, 14, -1} };
23       
24 static gint row_ext[NROWS][NCOLS] = 
25     { {1,  1,  1,  1,  1},
26       {1,  1,  1,  1,  1},
27       {2,  2,  1,  1,  1},
28       {2,  2,  1,  1,  1} };
29
30 static gint col_ext[NROWS][NCOLS] = 
31     { {1,  1,  2,  2,  1},
32       {1,  1,  1,  1,  1},
33       {2,  2,  1,  1,  1},
34       {2,  2,  1,  1,  1} };
35
36 #define NCHILDREN 16    /* child object count */
37
38 // default string values
39 #define DEF_CAPTION_TEXT    "Default table caption"
40 #define DEF_SUMMARY_TEXT    "Default table summary"
41 #define DEF_ROW_DESCR_TPL   "Row No%d"
42 #define DEF_COL_DESCR_TPL   "Column No%d"
43
44 /* row and column headers */
45 typedef struct
46 {
47     AtkObject* hdr;
48     gboolean selected;  /* TRUE if the row/column is selected, FALSE otherwise */
49 } TestSimpleHeaderStruct;
50
51 /* This struct represents a table cell */
52 typedef struct
53 {
54     MyAtkObject* elem;   /* the element */
55     guint ext_row;           /* its row extent */
56     guint ext_col;           /* its column extent */
57 } TestSimpleCell;
58
59 typedef struct _MyAtkTable MyAtkTable;
60 typedef struct _MyAtkTableClass MyAtkTableClass;
61
62 struct _MyAtkTable 
63 {
64     MyAtkObject parent;
65         
66     gboolean disposed;
67     
68     MyAtkObject* child[NCHILDREN];
69     MyAtkObject* not_a_child;
70     TestSimpleHeaderStruct row[NROWS];
71     TestSimpleHeaderStruct col[NCOLS];
72     guint nrows;
73     guint ncols;
74     AtkObject* caption;
75     AtkObject* summary;
76 };
77
78 struct _MyAtkTableClass 
79 {
80     MyAtkObjectClass parent;
81 };
82
83 GType 
84 my_atk_table_get_type (void);
85
86 #endif /*MY_ATK_TABLE_H*/