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/gtkwidget.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 | |
41 | struct _GtkComboBox |
42 | { |
43 | GtkWidget parent_instance; |
44 | }; |
45 | |
46 | /** |
47 | * GtkComboBoxClass: |
48 | * @parent_class: The parent class. |
49 | * @changed: Signal is emitted when the active item is changed. |
50 | * @format_entry_text: Signal which allows you to change how the text |
51 | * displayed in a combo box’s entry is displayed. |
52 | */ |
53 | struct _GtkComboBoxClass |
54 | { |
55 | GtkWidgetClass parent_class; |
56 | |
57 | /*< public >*/ |
58 | |
59 | /* signals */ |
60 | void (* changed) (GtkComboBox *combo_box); |
61 | char *(* format_entry_text) (GtkComboBox *combo_box, |
62 | const char *path); |
63 | void (* activate) (GtkComboBox *combo_box); |
64 | |
65 | /*< private >*/ |
66 | |
67 | gpointer padding[7]; |
68 | }; |
69 | |
70 | |
71 | /* construction */ |
72 | GDK_AVAILABLE_IN_ALL |
73 | GType gtk_combo_box_get_type (void) G_GNUC_CONST; |
74 | GDK_AVAILABLE_IN_ALL |
75 | GtkWidget *gtk_combo_box_new (void); |
76 | GDK_AVAILABLE_IN_ALL |
77 | GtkWidget *gtk_combo_box_new_with_entry (void); |
78 | GDK_AVAILABLE_IN_ALL |
79 | GtkWidget *gtk_combo_box_new_with_model (GtkTreeModel *model); |
80 | GDK_AVAILABLE_IN_ALL |
81 | GtkWidget *gtk_combo_box_new_with_model_and_entry (GtkTreeModel *model); |
82 | |
83 | /* get/set active item */ |
84 | GDK_AVAILABLE_IN_ALL |
85 | int gtk_combo_box_get_active (GtkComboBox *combo_box); |
86 | GDK_AVAILABLE_IN_ALL |
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box, |
88 | int index_); |
89 | GDK_AVAILABLE_IN_ALL |
90 | gboolean gtk_combo_box_get_active_iter (GtkComboBox *combo_box, |
91 | GtkTreeIter *iter); |
92 | GDK_AVAILABLE_IN_ALL |
93 | void gtk_combo_box_set_active_iter (GtkComboBox *combo_box, |
94 | GtkTreeIter *iter); |
95 | |
96 | /* getters and setters */ |
97 | GDK_AVAILABLE_IN_ALL |
98 | void gtk_combo_box_set_model (GtkComboBox *combo_box, |
99 | GtkTreeModel *model); |
100 | GDK_AVAILABLE_IN_ALL |
101 | GtkTreeModel *gtk_combo_box_get_model (GtkComboBox *combo_box); |
102 | |
103 | GDK_AVAILABLE_IN_ALL |
104 | GtkTreeViewRowSeparatorFunc gtk_combo_box_get_row_separator_func (GtkComboBox *combo_box); |
105 | GDK_AVAILABLE_IN_ALL |
106 | void gtk_combo_box_set_row_separator_func (GtkComboBox *combo_box, |
107 | GtkTreeViewRowSeparatorFunc func, |
108 | gpointer data, |
109 | GDestroyNotify destroy); |
110 | |
111 | GDK_AVAILABLE_IN_ALL |
112 | void gtk_combo_box_set_button_sensitivity (GtkComboBox *combo_box, |
113 | GtkSensitivityType sensitivity); |
114 | GDK_AVAILABLE_IN_ALL |
115 | GtkSensitivityType gtk_combo_box_get_button_sensitivity (GtkComboBox *combo_box); |
116 | |
117 | GDK_AVAILABLE_IN_ALL |
118 | gboolean gtk_combo_box_get_has_entry (GtkComboBox *combo_box); |
119 | GDK_AVAILABLE_IN_ALL |
120 | void gtk_combo_box_set_entry_text_column (GtkComboBox *combo_box, |
121 | int text_column); |
122 | GDK_AVAILABLE_IN_ALL |
123 | int gtk_combo_box_get_entry_text_column (GtkComboBox *combo_box); |
124 | |
125 | GDK_AVAILABLE_IN_ALL |
126 | void (GtkComboBox *combo_box, |
127 | gboolean fixed); |
128 | GDK_AVAILABLE_IN_ALL |
129 | gboolean (GtkComboBox *combo_box); |
130 | |
131 | /* programmatic control */ |
132 | GDK_AVAILABLE_IN_ALL |
133 | void (GtkComboBox *combo_box); |
134 | GDK_AVAILABLE_IN_ALL |
135 | void (GtkComboBox *combo_box, |
136 | GdkDevice *device); |
137 | GDK_AVAILABLE_IN_ALL |
138 | void gtk_combo_box_popdown (GtkComboBox *combo_box); |
139 | |
140 | GDK_AVAILABLE_IN_ALL |
141 | int gtk_combo_box_get_id_column (GtkComboBox *combo_box); |
142 | GDK_AVAILABLE_IN_ALL |
143 | void gtk_combo_box_set_id_column (GtkComboBox *combo_box, |
144 | int id_column); |
145 | GDK_AVAILABLE_IN_ALL |
146 | const char * gtk_combo_box_get_active_id (GtkComboBox *combo_box); |
147 | GDK_AVAILABLE_IN_ALL |
148 | gboolean gtk_combo_box_set_active_id (GtkComboBox *combo_box, |
149 | const char *active_id); |
150 | |
151 | GDK_AVAILABLE_IN_ALL |
152 | void gtk_combo_box_set_child (GtkComboBox *combo_box, |
153 | GtkWidget *child); |
154 | GDK_AVAILABLE_IN_ALL |
155 | GtkWidget * gtk_combo_box_get_child (GtkComboBox *combo_box); |
156 | |
157 | |
158 | G_END_DECLS |
159 | |
160 | #endif /* __GTK_COMBO_BOX_H__ */ |
161 | |