]> Pileus Git - ~andy/gtk/blob - gtk/gtkcombobox.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkcombobox.h
1 /* gtkcombobox.h
2  * Copyright (C) 2002, 2003  Kristian Rietveld <kris@gtk.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #ifndef __GTK_COMBO_BOX_H__
19 #define __GTK_COMBO_BOX_H__
20
21 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22 #error "Only <gtk/gtk.h> can be included directly."
23 #endif
24
25 #include <gtk/gtkbin.h>
26 #include <gtk/gtktreemodel.h>
27 #include <gtk/gtktreeview.h>
28
29 G_BEGIN_DECLS
30
31 #define GTK_TYPE_COMBO_BOX             (gtk_combo_box_get_type ())
32 #define GTK_COMBO_BOX(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO_BOX, GtkComboBox))
33 #define GTK_COMBO_BOX_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
34 #define GTK_IS_COMBO_BOX(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO_BOX))
35 #define GTK_IS_COMBO_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_COMBO_BOX))
36 #define GTK_COMBO_BOX_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
37
38 typedef struct _GtkComboBox        GtkComboBox;
39 typedef struct _GtkComboBoxClass   GtkComboBoxClass;
40 typedef struct _GtkComboBoxPrivate GtkComboBoxPrivate;
41
42 struct _GtkComboBox
43 {
44   GtkBin parent_instance;
45
46   /*< private >*/
47   GtkComboBoxPrivate *priv;
48 };
49
50 struct _GtkComboBoxClass
51 {
52   GtkBinClass parent_class;
53
54   /* signals */
55   void     (* changed)           (GtkComboBox *combo_box);
56   gchar   *(* format_entry_text) (GtkComboBox *combo_box,
57                                   const gchar *path);
58
59   /* Padding for future expansion */
60   void (*_gtk_reserved1) (void);
61   void (*_gtk_reserved2) (void);
62   void (*_gtk_reserved3) (void);
63 };
64
65
66 /* construction */
67 GType         gtk_combo_box_get_type                 (void) G_GNUC_CONST;
68 GtkWidget    *gtk_combo_box_new                      (void);
69 GtkWidget    *gtk_combo_box_new_with_area            (GtkCellArea  *area);
70 GtkWidget    *gtk_combo_box_new_with_area_and_entry  (GtkCellArea  *area);
71 GtkWidget    *gtk_combo_box_new_with_entry           (void);
72 GtkWidget    *gtk_combo_box_new_with_model           (GtkTreeModel *model);
73 GtkWidget    *gtk_combo_box_new_with_model_and_entry (GtkTreeModel *model);
74
75 /* grids */
76 gint          gtk_combo_box_get_wrap_width         (GtkComboBox *combo_box);
77 void          gtk_combo_box_set_wrap_width         (GtkComboBox *combo_box,
78                                                     gint         width);
79 gint          gtk_combo_box_get_row_span_column    (GtkComboBox *combo_box);
80 void          gtk_combo_box_set_row_span_column    (GtkComboBox *combo_box,
81                                                     gint         row_span);
82 gint          gtk_combo_box_get_column_span_column (GtkComboBox *combo_box);
83 void          gtk_combo_box_set_column_span_column (GtkComboBox *combo_box,
84                                                     gint         column_span);
85
86 gboolean      gtk_combo_box_get_add_tearoffs       (GtkComboBox *combo_box);
87 void          gtk_combo_box_set_add_tearoffs       (GtkComboBox *combo_box,
88                                                     gboolean     add_tearoffs);
89
90 const gchar * gtk_combo_box_get_title              (GtkComboBox *combo_box);
91 void          gtk_combo_box_set_title              (GtkComboBox *combo_box,
92                                                     const gchar *title);
93
94 gboolean      gtk_combo_box_get_focus_on_click     (GtkComboBox *combo);
95 void          gtk_combo_box_set_focus_on_click     (GtkComboBox *combo,
96                                                     gboolean     focus_on_click);
97
98 /* get/set active item */
99 gint          gtk_combo_box_get_active       (GtkComboBox     *combo_box);
100 void          gtk_combo_box_set_active       (GtkComboBox     *combo_box,
101                                               gint             index_);
102 gboolean      gtk_combo_box_get_active_iter  (GtkComboBox     *combo_box,
103                                               GtkTreeIter     *iter);
104 void          gtk_combo_box_set_active_iter  (GtkComboBox     *combo_box,
105                                               GtkTreeIter     *iter);
106
107 /* getters and setters */
108 void          gtk_combo_box_set_model        (GtkComboBox     *combo_box,
109                                               GtkTreeModel    *model);
110 GtkTreeModel *gtk_combo_box_get_model        (GtkComboBox     *combo_box);
111
112 GtkTreeViewRowSeparatorFunc gtk_combo_box_get_row_separator_func (GtkComboBox                *combo_box);
113 void                        gtk_combo_box_set_row_separator_func (GtkComboBox                *combo_box,
114                                                                   GtkTreeViewRowSeparatorFunc func,
115                                                                   gpointer                    data,
116                                                                   GDestroyNotify              destroy);
117
118 void               gtk_combo_box_set_button_sensitivity (GtkComboBox        *combo_box,
119                                                          GtkSensitivityType  sensitivity);
120 GtkSensitivityType gtk_combo_box_get_button_sensitivity (GtkComboBox        *combo_box);
121
122 gboolean           gtk_combo_box_get_has_entry          (GtkComboBox        *combo_box);
123 void               gtk_combo_box_set_entry_text_column  (GtkComboBox        *combo_box,
124                                                          gint                text_column);
125 gint               gtk_combo_box_get_entry_text_column  (GtkComboBox        *combo_box);
126
127 void               gtk_combo_box_set_popup_fixed_width  (GtkComboBox      *combo_box,
128                                                          gboolean          fixed);
129 gboolean           gtk_combo_box_get_popup_fixed_width  (GtkComboBox      *combo_box);
130
131 /* programmatic control */
132 void          gtk_combo_box_popup            (GtkComboBox     *combo_box);
133 void          gtk_combo_box_popup_for_device (GtkComboBox     *combo_box,
134                                               GdkDevice       *device);
135 void          gtk_combo_box_popdown          (GtkComboBox     *combo_box);
136 AtkObject*    gtk_combo_box_get_popup_accessible (GtkComboBox *combo_box);
137
138 gint          gtk_combo_box_get_id_column        (GtkComboBox *combo_box);
139 void          gtk_combo_box_set_id_column        (GtkComboBox *combo_box,
140                                                   gint         id_column);
141 const gchar * gtk_combo_box_get_active_id        (GtkComboBox *combo_box);
142 gboolean      gtk_combo_box_set_active_id        (GtkComboBox *combo_box,
143                                                   const gchar *active_id);
144
145 G_END_DECLS
146
147 #endif /* __GTK_COMBO_BOX_H__ */