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_SELECTOR_H__
22 #define __HILDON_TOUCH_SELECTOR_H__
25 #include "hildon-touch-selector-column.h"
29 #define HILDON_TYPE_TOUCH_SELECTOR \
30 (hildon_touch_selector_get_type ())
32 #define HILDON_TOUCH_SELECTOR(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
34 HILDON_TYPE_TOUCH_SELECTOR, HildonTouchSelector))
36 #define HILDON_TOUCH_SELECTOR_CLASS(vtable) \
37 (G_TYPE_CHECK_CLASS_CAST ((vtable), \
38 HILDON_TYPE_TOUCH_SELECTOR, HildonTouchSelectorClass))
40 #define HILDON_IS_TOUCH_SELECTOR(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
42 HILDON_TYPE_TOUCH_SELECTOR))
44 #define HILDON_IS_TOUCH_SELECTOR_CLASS(vtable) \
45 (G_TYPE_CHECK_CLASS_TYPE ((vtable), HILDON_TYPE_TOUCH_SELECTOR))
47 #define HILDON_TOUCH_SELECTOR_GET_CLASS(inst) \
48 (G_TYPE_INSTANCE_GET_CLASS ((inst), \
49 HILDON_TYPE_TOUCH_SELECTOR, HildonTouchSelectorClass))
51 typedef struct _HildonTouchSelector HildonTouchSelector;
52 typedef struct _HildonTouchSelectorClass HildonTouchSelectorClass;
53 typedef struct _HildonTouchSelectorPrivate HildonTouchSelectorPrivate;
55 typedef gchar *(*HildonTouchSelectorPrintFunc) (HildonTouchSelector * selector);
57 struct _HildonTouchSelector
59 GtkVBox parent_instance;
62 HildonTouchSelectorPrivate *priv;
65 struct _HildonTouchSelectorClass
67 GtkVBoxClass parent_class;
70 void (*changed) (HildonTouchSelector *selector,
74 void (*set_model) (HildonTouchSelector *selector,
78 gboolean (*has_multiple_selection) (HildonTouchSelector *selector);
83 HILDON_TOUCH_SELECTOR_SELECTION_MODE_SINGLE,
84 HILDON_TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE
85 } HildonTouchSelectorSelectionMode;
89 hildon_touch_selector_get_type (void) G_GNUC_CONST;
92 hildon_touch_selector_new (void);
94 /* Simple (and recommended) API for one-text-column selectors. */
96 hildon_touch_selector_new_text (void);
99 hildon_touch_selector_append_text (HildonTouchSelector *selector,
102 hildon_touch_selector_prepend_text (HildonTouchSelector *selector,
105 hildon_touch_selector_insert_text (HildonTouchSelector *selector,
110 HildonTouchSelectorColumn*
111 hildon_touch_selector_append_text_column (HildonTouchSelector *selector,
112 GtkTreeModel * model,
115 HildonTouchSelectorColumn*
116 hildon_touch_selector_append_column (HildonTouchSelector *selector,
118 GtkCellRenderer *cell_renderer,
120 #ifndef HILDON_DISABLE_DEPRECATED
122 hildon_touch_selector_set_column_attributes (HildonTouchSelector *selector,
124 GtkCellRenderer *cell_renderer,
129 hildon_touch_selector_remove_column (HildonTouchSelector *selector,
133 hildon_touch_selector_get_num_columns (HildonTouchSelector *selector);
136 hildon_touch_selector_set_column_selection_mode (HildonTouchSelector *selector,
137 HildonTouchSelectorSelectionMode mode);
139 HildonTouchSelectorSelectionMode
140 hildon_touch_selector_get_column_selection_mode (HildonTouchSelector *selector);
142 HildonTouchSelectorColumn *
143 hildon_touch_selector_get_column (HildonTouchSelector *selector,
146 /* get/set active item */
148 hildon_touch_selector_set_active (HildonTouchSelector *selector,
152 hildon_touch_selector_get_active (HildonTouchSelector *selector,
156 hildon_touch_selector_get_selected (HildonTouchSelector *selector,
161 hildon_touch_selector_select_iter (HildonTouchSelector *selector,
167 hildon_touch_selector_unselect_iter (HildonTouchSelector *selector,
172 hildon_touch_selector_get_selected_rows (HildonTouchSelector *selector,
176 hildon_touch_selector_set_model (HildonTouchSelector *selector,
178 GtkTreeModel *model);
180 hildon_touch_selector_get_model (HildonTouchSelector *selector,
183 /* show the current element selected */
185 hildon_touch_selector_get_current_text (HildonTouchSelector *selector);
188 hildon_touch_selector_set_print_func (HildonTouchSelector *selector,
189 HildonTouchSelectorPrintFunc func);
191 HildonTouchSelectorPrintFunc
192 hildon_touch_selector_get_print_func (HildonTouchSelector *selector);
195 hildon_touch_selector_has_multiple_selection (HildonTouchSelector *selector);
199 #endif /* __HILDON_TOUCH_SELECTOR_H__ */