1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4; coding: utf-8 -*- */
2 
3 /* anjuta-tree-combo.h
4  *
5  * Copyright (C) 2011  Sébastien Granjoux
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public
18  * License along with this program; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  */
23 
24 #ifndef _ANJUTA_TREE_COMBO_H_
25 #define _ANJUTA_TREE_COMBO_H_
26 
27 #include <gtk/gtk.h>
28 
29 G_BEGIN_DECLS
30 
31 #define ANJUTA_TYPE_TREE_COMBO_BOX            (anjuta_tree_combo_box_get_type ())
32 #define ANJUTA_TREE_COMBO_BOX(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_TREE_COMBO_BOX, AnjutaTreeComboBox))
33 #define ANJUTA_TREE_COMBO_BOX_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_TREE_COMBO_BOX, AnjutaTreeComboBoxClass))
34 #define ANJUTA_IS_TREE_COMBO_BOX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_TREE_COMBO_BOX))
35 #define ANJUTA_IS_TREE_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_TREE_COMBO_BOX))
36 #define ANJUTA_TREE_COMBO_BOX_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_TREE_COMBO_BOX, AnjutaTreeComboBoxClass))
37 
38 typedef struct _AnjutaTreeComboBox        AnjutaTreeComboBox;
39 typedef struct _AnjutaTreeComboBoxPrivate AnjutaTreeComboBoxPrivate;
40 typedef struct _AnjutaTreeComboBoxClass   AnjutaTreeComboBoxClass;
41 
42 struct _AnjutaTreeComboBox
43 {
44   GtkToggleButton parent;
45 
46   /*< private >*/
47   AnjutaTreeComboBoxPrivate *priv;
48 };
49 
50 struct _AnjutaTreeComboBoxClass
51 {
52   /*< private >*/
53   GtkToggleButtonClass parent_class;
54 
55   /* signals */
56   void     (* changed)           (AnjutaTreeComboBox *combo);
57 };
58 
59 
60 GType			anjuta_tree_combo_box_get_type         (void) G_GNUC_CONST;
61 GtkWidget *		anjuta_tree_combo_box_new              (void);
62 
63 void			anjuta_tree_combo_box_set_model			(AnjutaTreeComboBox *combo,
64 						                                    GtkTreeModel *model);
65 GtkTreeModel*	anjuta_tree_combo_box_get_model			(AnjutaTreeComboBox *combo);
66 
67 void			anjuta_tree_combo_box_set_active 		(AnjutaTreeComboBox *combo,
68 					                                      gint index);
69 void			anjuta_tree_combo_box_set_active_iter	(AnjutaTreeComboBox *combo,
70                                                          GtkTreeIter *iter);
71 gboolean		anjuta_tree_combo_box_get_active_iter	(AnjutaTreeComboBox *combo,
72 					                                     GtkTreeIter *iter);
73 
74 void			anjuta_tree_combo_box_set_valid_function(AnjutaTreeComboBox *combo,
75                                                          GtkTreeModelFilterVisibleFunc func,
76                                                          gpointer data,
77                                                          GDestroyNotify destroy);
78 void			anjuta_tree_combo_box_set_invalid_text	(AnjutaTreeComboBox *combo,
79                                                          const gchar *str);
80 
81 
82 G_END_DECLS
83 
84 #endif /* _ANJUTA_TREE_COMBO_H_ */
85