Start of new branch involving major rewrite of lib/gtksheet/*
[pspp-builds.git] / lib / gtksheet / gsheet-column-iface.h
1 /* GSheetColumn --- an abstract model of the column geometry of a
2  * GSheet widget.
3  * Copyright (C) 2006 Free Software Foundation
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19
20 #ifndef __GSHEET_COLUMN_IFACE_H
21 #define __GSHEET_COLUMN_IFACE_H
22
23 #include <glib-object.h>
24 #include <gdk/gdk.h>
25 #include <gtk/gtk.h>
26
27 #include "gtkextra-sheet.h"
28
29
30 G_BEGIN_DECLS
31
32 #define G_TYPE_SHEET_COLUMN            (g_sheet_column_get_type ())
33 #define G_SHEET_COLUMN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_SHEET_COLUMN, GSheetColumn))
34 #define G_IS_SHEET_COLUMN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_SHEET_COLUMN))
35 #define G_SHEET_COLUMN_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_SHEET_COLUMN, GSheetColumnIface))
36
37
38 typedef struct _GSheetColumn        GSheetColumn;
39 typedef struct _GSheetColumnIface   GSheetColumnIface;
40 struct _GSheetColumnIface
41 {
42   GTypeInterface g_iface;
43
44
45   /* Signals */
46   void         (* columns_changed)     (GSheetColumn *geo,
47                                       glong col, glong n_columns);
48
49   /* Virtual Table */
50   gint (* get_width) (const GSheetColumn *gcolumn, glong col);
51   void (* set_width) (GSheetColumn *gcolumn, glong col, gint width);
52
53   gboolean (* get_visibility) (const GSheetColumn *gcolumn, glong col);
54   gboolean (* get_sensitivity) (const GSheetColumn *gcolumn, glong col);
55   const GtkSheetButton * (* get_button) (const GSheetColumn *gcolumn, glong col);
56   GtkJustification (* get_justification) (const GSheetColumn *gcolumn, glong col);
57
58   gint  (*get_left_text_column) (const GSheetColumn *gcolumn,
59                                  glong col);
60
61   gint  (*get_right_text_column) (const GSheetColumn *gcolumn,
62                                   glong col);
63
64   void (* set_left_text_column) (const GSheetColumn *gcolumn,
65                                  glong col, gint i);
66
67   void (* set_right_text_column) (const GSheetColumn *gcolumn,
68                                   glong col, gint i);
69
70   glong  (* get_column_count) (const GSheetColumn *geo);
71
72
73   GtkStateType  (*get_button_state)(const GSheetColumn *geo, glong col);
74   gchar * (*get_button_label)(const GSheetColumn *geo, glong col);
75   gchar * (*get_subtitle)(const GSheetColumn *geo, glong col);
76
77   gboolean      (*get_button_visibility)(const GSheetColumn *geo,
78                                         glong col);
79
80   GtkJustification * (*get_button_justification)(const GSheetColumn *geo,
81                                                 glong col);
82 };
83
84
85 inline GType g_sheet_column_get_type   (void) G_GNUC_CONST;
86
87
88 inline gint  g_sheet_column_get_width (const GSheetColumn *gcolumn,
89                                        glong col);
90
91
92 inline void  g_sheet_column_set_width (GSheetColumn *gcolumn,
93                                        glong col, gint size);
94
95
96 inline gboolean  g_sheet_column_get_visibility (const GSheetColumn *gcolumn,
97                                             glong col);
98
99 inline gboolean  g_sheet_column_get_sensitivity (const GSheetColumn *gcolumn,
100                                              glong col);
101
102
103 inline GtkSheetButton *g_sheet_column_get_button (const GSheetColumn *gcolumn,
104                                              glong col);
105
106 gchar *g_sheet_column_get_subtitle (const GSheetColumn *, glong);
107
108 inline GtkJustification g_sheet_column_get_justification (const GSheetColumn *gcolumn, glong col);
109
110
111 inline gint  g_sheet_column_get_left_text_column (const GSheetColumn *gcolumn,
112                                         glong col);
113
114 inline gint  g_sheet_column_get_right_text_column (const GSheetColumn *gcolumn,
115                                         glong col);
116
117 inline void g_sheet_column_set_left_text_column (const GSheetColumn *gcolumn,
118                                         glong col, gint i);
119
120
121 inline void g_sheet_column_set_right_text_column (const GSheetColumn *gcolumn,
122                                         glong col, gint i);
123
124
125 inline glong  g_sheet_column_get_column_count (const GSheetColumn *geo);
126
127 inline gint  g_sheet_column_start_pixel (const GSheetColumn *geo, glong col);
128
129 inline void g_sheet_column_columns_changed (GSheetColumn *geo,
130                                            glong first, glong n_columns);
131
132 G_END_DECLS
133
134 #endif /* __G_SHEET_COLUMN_IFACE_H__ */