]> Pileus Git - ~andy/gtk/blob - gtk/gtkcombobox.h
GtkComboBox: Add the format-entry-text signal.
[~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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
21 #error "Only <gtk/gtk.h> can be included directly."
22 #endif
23
24 #ifndef __GTK_COMBO_BOX_H__
25 #define __GTK_COMBO_BOX_H__
26
27 #include <gtk/gtkbin.h>
28 #include <gtk/gtktreemodel.h>
29 #include <gtk/gtktreeview.h>
30
31 G_BEGIN_DECLS
32
33 #define GTK_TYPE_COMBO_BOX             (gtk_combo_box_get_type ())
34 #define GTK_COMBO_BOX(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO_BOX, GtkComboBox))
35 #define GTK_COMBO_BOX_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
36 #define GTK_IS_COMBO_BOX(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO_BOX))
37 #define GTK_IS_COMBO_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_COMBO_BOX))
38 #define GTK_COMBO_BOX_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
39
40 typedef struct _GtkComboBox        GtkComboBox;
41 typedef struct _GtkComboBoxClass   GtkComboBoxClass;
42 typedef struct _GtkComboBoxPrivate GtkComboBoxPrivate;
43
44 struct _GtkComboBox
45 {
46   GtkBin parent_instance;
47
48   /*< private >*/
49   GtkComboBoxPrivate *priv;
50 };
51
52 struct _GtkComboBoxClass
53 {
54   GtkBinClass parent_class;
55
56   /* signals */
57   void     (* changed)           (GtkComboBox *combo_box);
58   gchar   *(* format_entry_text) (GtkComboBox *combo_box,
59                                   const gchar *path);
60
61   /* Padding for future expansion */
62   void (*_gtk_reserved1) (void);
63   void (*_gtk_reserved2) (void);
64   void (*_gtk_reserved3) (void);
65 };
66
67
68 /* construction */
69 GType         gtk_combo_box_get_type                 (void) G_GNUC_CONST;
70 GtkWidget    *gtk_combo_box_new                      (void);
71 GtkWidget    *gtk_combo_box_new_with_area            (GtkCellArea  *area);
72 GtkWidget    *gtk_combo_box_new_with_area_and_entry  (GtkCellArea  *area);
73 GtkWidget    *gtk_combo_box_new_with_entry           (void);
74 GtkWidget    *gtk_combo_box_new_with_model           (GtkTreeModel *model);
75 GtkWidget    *gtk_combo_box_new_with_model_and_entry (GtkTreeModel *model);
76
77 /* grids */
78 gint          gtk_combo_box_get_wrap_width         (GtkComboBox *combo_box);
79 void          gtk_combo_box_set_wrap_width         (GtkComboBox *combo_box,
80                                                     gint         width);
81 gint          gtk_combo_box_get_row_span_column    (GtkComboBox *combo_box);
82 void          gtk_combo_box_set_row_span_column    (GtkComboBox *combo_box,
83                                                     gint         row_span);
84 gint          gtk_combo_box_get_column_span_column (GtkComboBox *combo_box);
85 void          gtk_combo_box_set_column_span_column (GtkComboBox *combo_box,
86                                                     gint         column_span);
87
88 gboolean      gtk_combo_box_get_add_tearoffs       (GtkComboBox *combo_box);
89 void          gtk_combo_box_set_add_tearoffs       (GtkComboBox *combo_box,
90                                                     gboolean     add_tearoffs);
91
92 const gchar * gtk_combo_box_get_title              (GtkComboBox *combo_box);
93 void          gtk_combo_box_set_title              (GtkComboBox *combo_box,
94                                                     const gchar *title);
95
96 gboolean      gtk_combo_box_get_focus_on_click     (GtkComboBox *combo);
97 void          gtk_combo_box_set_focus_on_click     (GtkComboBox *combo,
98                                                     gboolean     focus_on_click);
99
100 /* get/set active item */
101 gint          gtk_combo_box_get_active       (GtkComboBox     *combo_box);
102 void          gtk_combo_box_set_active       (GtkComboBox     *combo_box,
103                                               gint             index_);
104 gboolean      gtk_combo_box_get_active_iter  (GtkComboBox     *combo_box,
105                                               GtkTreeIter     *iter);
106 void          gtk_combo_box_set_active_iter  (GtkComboBox     *combo_box,
107                                               GtkTreeIter     *iter);
108
109 /* getters and setters */
110 void          gtk_combo_box_set_model        (GtkComboBox     *combo_box,
111                                               GtkTreeModel    *model);
112 GtkTreeModel *gtk_combo_box_get_model        (GtkComboBox     *combo_box);
113
114 GtkTreeViewRowSeparatorFunc gtk_combo_box_get_row_separator_func (GtkComboBox                *combo_box);
115 void                        gtk_combo_box_set_row_separator_func (GtkComboBox                *combo_box,
116                                                                   GtkTreeViewRowSeparatorFunc func,
117                                                                   gpointer                    data,
118                                                                   GDestroyNotify              destroy);
119
120 void               gtk_combo_box_set_button_sensitivity (GtkComboBox        *combo_box,
121                                                          GtkSensitivityType  sensitivity);
122 GtkSensitivityType gtk_combo_box_get_button_sensitivity (GtkComboBox        *combo_box);
123
124 gboolean           gtk_combo_box_get_has_entry          (GtkComboBox        *combo_box);
125 void               gtk_combo_box_set_entry_text_column  (GtkComboBox        *combo_box,
126                                                          gint                text_column);
127 gint               gtk_combo_box_get_entry_text_column  (GtkComboBox        *combo_box);
128
129 void               gtk_combo_box_set_popup_fixed_width  (GtkComboBox      *combo_box,
130                                                          gboolean          fixed);
131 gboolean           gtk_combo_box_get_popup_fixed_width  (GtkComboBox      *combo_box);
132
133 /* programmatic control */
134 void          gtk_combo_box_popup            (GtkComboBox     *combo_box);
135 void          gtk_combo_box_popup_for_device (GtkComboBox     *combo_box,
136                                               GdkDevice       *device);
137 void          gtk_combo_box_popdown          (GtkComboBox     *combo_box);
138 AtkObject*    gtk_combo_box_get_popup_accessible (GtkComboBox *combo_box);
139
140 gint          gtk_combo_box_get_id_column        (GtkComboBox *combo_box);
141 void          gtk_combo_box_set_id_column        (GtkComboBox *combo_box,
142                                                   gint         id_column);
143 const gchar * gtk_combo_box_get_active_id        (GtkComboBox *combo_box);
144 gboolean      gtk_combo_box_set_active_id        (GtkComboBox *combo_box,
145                                                   const gchar *active_id);
146
147 G_END_DECLS
148
149 #endif /* __GTK_COMBO_BOX_H__ */