2 * This file is a part of hildon
4 * Copyright (C) 2005, 2008 Nokia Corporation.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __HILDON_TOUCH_PICKER_H__
22 #define __HILDON_TOUCH_PICKER_H__
28 #define HILDON_TYPE_TOUCH_PICKER (hildon_touch_picker_get_type ())
29 #define HILDON_TOUCH_PICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HILDON_TYPE_TOUCH_PICKER, HildonTouchPicker))
30 #define HILDON_TOUCH_PICKER_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), HILDON_TYPE_TOUCH_PICKER, HildonTouchPickerClass))
31 #define HILDON_IS_TOUCH_PICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_TOUCH_PICKER))
32 #define HILDON_IS_TOUCH_PICKER_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), HILDON_TYPE_TOUCH_PICKER))
33 #define HILDON_TOUCH_PICKER_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), HILDON_TYPE_TOUCH_PICKER, HildonTouchPickerClass))
35 typedef struct _HildonTouchPicker HildonTouchPicker;
36 typedef struct _HildonTouchPickerClass HildonTouchPickerClass;
37 typedef struct _HildonTouchPickerPrivate HildonTouchPickerPrivate;
39 typedef gchar *(*HildonTouchPickerPrintFunc) (HildonTouchPicker * picker);
41 struct _HildonTouchPicker
43 GtkHBox parent_instance;
46 HildonTouchPickerPrivate *priv;
49 struct _HildonTouchPickerClass
51 GtkHBoxClass parent_class;
54 void (*changed) (HildonTouchPicker * picker, gint column);
59 HILDON_TOUCH_PICKER_SELECTION_MODE_SINGLE,
60 HILDON_TOUCH_PICKER_SELECTION_MODE_MULTIPLE
61 } HildonTouchPickerSelectionMode;
64 GType hildon_touch_picker_get_type (void) G_GNUC_CONST;
65 GtkWidget *hildon_touch_picker_new (void);
68 gboolean hildon_touch_picker_append_text_column (HildonTouchPicker * picker,
69 GtkTreeModel * model);
71 gboolean hildon_touch_picker_append_column (HildonTouchPicker * picker,
73 GtkCellRenderer * cell_renderer,
76 void hildon_touch_picker_set_column_attributes (HildonTouchPicker * picker,
78 GtkCellRenderer * cell_renderer,
81 gboolean hildon_touch_picker_remove_column (HildonTouchPicker * picker,
84 gint hildon_touch_picker_get_num_columns (HildonTouchPicker * picker);
86 void hildon_touch_picker_set_column_selection_mode (HildonTouchPicker * picker,
87 HildonTouchPickerSelectionMode mode);
89 HildonTouchPickerSelectionMode
90 hildon_touch_picker_get_column_selection_mode (HildonTouchPicker * picker);
92 /* get/set active item */
93 gboolean hildon_touch_picker_get_active_iter (HildonTouchPicker * picker,
96 void hildon_touch_picker_set_active_iter (HildonTouchPicker * picker,
100 GList *hildon_touch_picker_get_selected_rows (HildonTouchPicker * picker,
103 void hildon_touch_picker_set_model (HildonTouchPicker * picker,
104 gint column, GtkTreeModel * model);
105 GtkTreeModel *hildon_touch_picker_get_model (HildonTouchPicker * picker,
108 /* show the current element selected */
109 gchar *hildon_touch_picker_get_current_text (HildonTouchPicker * picker);
111 void hildon_touch_picker_set_print_func (HildonTouchPicker * picker,
112 HildonTouchPickerPrintFunc func);
114 HildonTouchPickerPrintFunc
115 hildon_touch_picker_get_print_func (HildonTouchPicker * picker);
119 #endif /* __HILDON_TOUCH_PICKER_H__ */