pidgincombobox.h

00001 /* gtkcombobox.h
00002  * Copyright (C) 2002, 2003  Kristian Rietveld <kris@gtk.org>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02111-1301, USA.
00018  */
00019 
00020 #ifndef __PIDGIN_COMBO_BOX_H__
00021 #define __PIDGIN_COMBO_BOX_H__
00022 
00023 #ifndef __GTK_COMBO_BOX_H__
00024 #define __GTK_COMBO_BOX_H__
00025 
00026 #include <gtk/gtkbin.h>
00027 #include <gtk/gtktreemodel.h>
00028 #include <gtk/gtktreeview.h>
00029 
00030 G_BEGIN_DECLS
00031 
00032 #define GTK_TYPE_COMBO_BOX             (gtk_combo_box_get_type ())
00033 #define GTK_COMBO_BOX(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO_BOX, GtkComboBox))
00034 #define GTK_COMBO_BOX_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
00035 #define GTK_IS_COMBO_BOX(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO_BOX))
00036 #define GTK_IS_COMBO_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_COMBO_BOX))
00037 #define GTK_COMBO_BOX_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_TYPE_COMBO_BOX, GtkComboBoxClass))
00038 
00039 typedef struct _GtkComboBox        GtkComboBox;
00040 typedef struct _GtkComboBoxClass   GtkComboBoxClass;
00041 typedef struct _GtkComboBoxPrivate GtkComboBoxPrivate;
00042 
00043 struct _GtkComboBox
00044 {
00045   GtkBin parent_instance;
00046 
00047   /*< private >*/
00048   GtkComboBoxPrivate *priv;
00049 };
00050 
00051 struct _GtkComboBoxClass
00052 {
00053   GtkBinClass parent_class;
00054 
00055   /* signals */
00056   void     (* changed)          (GtkComboBox *combo_box);
00057 
00058   /* Padding for future expansion */
00059   void (*_gtk_reserved0) (void);
00060   void (*_gtk_reserved1) (void);
00061   void (*_gtk_reserved2) (void);
00062   void (*_gtk_reserved3) (void);
00063 };
00064 
00065 
00066 /* construction */
00067 GType         gtk_combo_box_get_type         (void);
00068 GtkWidget    *gtk_combo_box_new              (void);
00069 GtkWidget    *gtk_combo_box_new_with_model   (GtkTreeModel    *model);
00070 
00071 /* grids */
00072 void          gtk_combo_box_set_wrap_width         (GtkComboBox *combo_box,
00073                                                     gint         width);
00074 void          gtk_combo_box_set_row_span_column    (GtkComboBox *combo_box,
00075                                                     gint         row_span);
00076 void          gtk_combo_box_set_column_span_column (GtkComboBox *combo_box,
00077                                                     gint         column_span);
00078 
00079 /* get/set active item */
00080 gint          gtk_combo_box_get_active       (GtkComboBox     *combo_box);
00081 void          gtk_combo_box_set_active       (GtkComboBox     *combo_box,
00082                                               gint             index_);
00083 gboolean      gtk_combo_box_get_active_iter  (GtkComboBox     *combo_box,
00084                                               GtkTreeIter     *iter);
00085 void          gtk_combo_box_set_active_iter  (GtkComboBox     *combo_box,
00086                                               GtkTreeIter     *iter);
00087 
00088 /* getters and setters */
00089 void          gtk_combo_box_set_model        (GtkComboBox     *combo_box,
00090                                               GtkTreeModel    *model);
00091 GtkTreeModel *gtk_combo_box_get_model        (GtkComboBox     *combo_box);
00092 
00093 /* convenience -- text */
00094 GtkWidget    *gtk_combo_box_new_text         (void);
00095 void          gtk_combo_box_append_text      (GtkComboBox     *combo_box,
00096                                               const gchar     *text);
00097 void          gtk_combo_box_insert_text      (GtkComboBox     *combo_box,
00098                                               gint             position,
00099                                               const gchar     *text);
00100 void          gtk_combo_box_prepend_text     (GtkComboBox     *combo_box,
00101                                               const gchar     *text);
00102 void          gtk_combo_box_remove_text      (GtkComboBox     *combo_box,
00103                                               gint             position);
00104 /* programmatic control */
00105 void          gtk_combo_box_popup            (GtkComboBox     *combo_box);
00106 void          gtk_combo_box_popdown          (GtkComboBox     *combo_box);
00107 
00108 G_END_DECLS
00109 
00110 #endif /* __GTK_COMBO_BOX_H__ */
00111 
00112 gchar        *gtk_combo_box_get_active_text  (GtkComboBox     *combo_box);
00113 
00114 #endif /* __PIDGIN_COMBOX_BOX_H__ */