*** Plucked rev 3f699c081b38f9d19632fcee1c23cbc96fce3092 (sulabh@soc.pidgin.im):
[pidgin-git.git] / pidgin / pidgincombobox.h
blobc82fd6a0383092db2458860eedf6a63a40f222f1
1 /* gtkcombobox.h
2 * Copyright (C) 2002, 2003 Kristian Rietveld <kris@gtk.org>
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.
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.
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., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02111-1301, USA.
20 #ifndef __PIDGIN_COMBO_BOX_H__
21 #define __PIDGIN_COMBO_BOX_H__
23 #ifndef __GTK_COMBO_BOX_H__
24 #define __GTK_COMBO_BOX_H__
26 #include <gtk/gtkbin.h>
27 #include <gtk/gtktreemodel.h>
28 #include <gtk/gtktreeview.h>
30 G_BEGIN_DECLS
32 #define GTK_TYPE_COMBO_BOX (gtk_combo_box_get_type ())
33 #define GTK_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO_BOX, GtkComboBox))
34 #define GTK_COMBO_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
35 #define GTK_IS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO_BOX))
36 #define GTK_IS_COMBO_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_COMBO_BOX))
37 #define GTK_COMBO_BOX_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
39 typedef struct _GtkComboBox GtkComboBox;
40 typedef struct _GtkComboBoxClass GtkComboBoxClass;
41 typedef struct _GtkComboBoxPrivate GtkComboBoxPrivate;
43 struct _GtkComboBox
45 GtkBin parent_instance;
47 /*< private >*/
48 GtkComboBoxPrivate *priv;
51 struct _GtkComboBoxClass
53 GtkBinClass parent_class;
55 /* signals */
56 void (* changed) (GtkComboBox *combo_box);
58 /* Padding for future expansion */
59 void (*_gtk_reserved0) (void);
60 void (*_gtk_reserved1) (void);
61 void (*_gtk_reserved2) (void);
62 void (*_gtk_reserved3) (void);
66 /* construction */
67 GType gtk_combo_box_get_type (void);
68 GtkWidget *gtk_combo_box_new (void);
69 GtkWidget *gtk_combo_box_new_with_model (GtkTreeModel *model);
71 /* grids */
72 void gtk_combo_box_set_wrap_width (GtkComboBox *combo_box,
73 gint width);
74 void gtk_combo_box_set_row_span_column (GtkComboBox *combo_box,
75 gint row_span);
76 void gtk_combo_box_set_column_span_column (GtkComboBox *combo_box,
77 gint column_span);
79 /* get/set active item */
80 gint gtk_combo_box_get_active (GtkComboBox *combo_box);
81 void gtk_combo_box_set_active (GtkComboBox *combo_box,
82 gint index_);
83 gboolean gtk_combo_box_get_active_iter (GtkComboBox *combo_box,
84 GtkTreeIter *iter);
85 void gtk_combo_box_set_active_iter (GtkComboBox *combo_box,
86 GtkTreeIter *iter);
88 /* getters and setters */
89 void gtk_combo_box_set_model (GtkComboBox *combo_box,
90 GtkTreeModel *model);
91 GtkTreeModel *gtk_combo_box_get_model (GtkComboBox *combo_box);
93 /* convenience -- text */
94 GtkWidget *gtk_combo_box_new_text (void);
95 void gtk_combo_box_append_text (GtkComboBox *combo_box,
96 const gchar *text);
97 void gtk_combo_box_insert_text (GtkComboBox *combo_box,
98 gint position,
99 const gchar *text);
100 void gtk_combo_box_prepend_text (GtkComboBox *combo_box,
101 const gchar *text);
102 void gtk_combo_box_remove_text (GtkComboBox *combo_box,
103 gint position);
104 /* programmatic control */
105 void gtk_combo_box_popup (GtkComboBox *combo_box);
106 void gtk_combo_box_popdown (GtkComboBox *combo_box);
108 G_END_DECLS
110 #endif /* __GTK_COMBO_BOX_H__ */
112 gchar *gtk_combo_box_get_active_text (GtkComboBox *combo_box);
114 #endif /* __PIDGIN_COMBOX_BOX_H__ */