* added ModestComboBox, convenience class for GtkComboBoxen
[modest] / src / widgets / modest-combo-box.h
1 /* modest-combo-box.h */
2 /* insert (c)/licensing information) */
3
4 #ifndef __MODEST_COMBO_BOX_H__
5 #define __MODEST_COMBO_BOX_H__
6
7 #include <gtk/gtk.h>
8 /* other include files */
9
10 G_BEGIN_DECLS
11
12 /* convenience macros */
13 #define MODEST_TYPE_COMBO_BOX             (modest_combo_box_get_type())
14 #define MODEST_COMBO_BOX(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_COMBO_BOX,ModestComboBox))
15 #define MODEST_COMBO_BOX_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_COMBO_BOX,GtkComboBox))
16 #define MODEST_IS_COMBO_BOX(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_COMBO_BOX))
17 #define MODEST_IS_COMBO_BOX_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_COMBO_BOX))
18 #define MODEST_COMBO_BOX_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_COMBO_BOX,ModestComboBoxClass))
19
20 typedef struct _ModestComboBox      ModestComboBox;
21 typedef struct _ModestComboBoxClass ModestComboBoxClass;
22
23 struct _ModestComboBox {
24          GtkComboBox parent;
25         /* insert public members, if any */
26 };
27
28 struct _ModestComboBoxClass {
29         GtkComboBoxClass parent_class;
30         /* insert signal callback declarations, eg. */
31         /* void (* my_event) (ModestComboBox* obj); */
32 };
33
34
35 struct _ModestComboBoxLemma {
36         const gchar *display_name;
37         gpointer id;
38 };
39 typedef struct _ModestComboBoxLemma ModestComboBoxLemma;
40
41 /**
42  * modest_combo_box_get_type
43  *
44  * Returns: the id of the ModestComboBox type
45  */
46 GType        modest_combo_box_get_type    (void) G_GNUC_CONST;
47
48 /**
49  * modest_combo_box_new
50  * @lemmas: a ptr to a NULL terminated list of ModestComboBox lemmas,
51  * each corresponding to a display_name, and the corresponding value
52  * create a new modest combo box,
53  *
54  * create a new modest combo box
55  * 
56  * Returns: a new ModestComboBox instance, or NULL in case of failure
57  */
58 GtkWidget*   modest_combo_box_new         (ModestComboBoxLemma *lemmas);
59
60
61 /**
62  * modest_combo_box_get_active_id
63  * @self: a valid ModestComboBox instance 
64  * 
65  * get the id for the currently active lemma, or NULL if there's nothing chosen
66  * 
67  * Returns: the id or NULL if there's nothing chosen.
68  */
69 gpointer   modest_combo_box_get_active_id       (ModestComboBox *self);
70
71
72
73 G_END_DECLS
74
75 #endif /* __MODEST_COMBO_BOX_H__ */
76