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);
82 * HildonTouchSelectorSelectionMode:
83 * @HILDON_TOUCH_SELECTOR_SELECTION_MODE_SINGLE: Users can select one item
84 * @HILDON_TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE: Users can select one to many items
86 * Describes the selection mode of a #HildonTouchSelector.
90 HILDON_TOUCH_SELECTOR_SELECTION_MODE_SINGLE,
91 HILDON_TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE
92 } HildonTouchSelectorSelectionMode;
96 hildon_touch_selector_get_type (void) G_GNUC_CONST;
99 hildon_touch_selector_new (void);
101 /* Simple (and recommended) API for one-text-column selectors. */
103 hildon_touch_selector_new_text (void);
106 hildon_touch_selector_append_text (HildonTouchSelector *selector,
109 hildon_touch_selector_prepend_text (HildonTouchSelector *selector,
112 hildon_touch_selector_insert_text (HildonTouchSelector *selector,
117 HildonTouchSelectorColumn*
118 hildon_touch_selector_append_text_column (HildonTouchSelector *selector,
119 GtkTreeModel * model,
122 HildonTouchSelectorColumn*
123 hildon_touch_selector_append_column (HildonTouchSelector *selector,
125 GtkCellRenderer *cell_renderer,
127 #ifndef HILDON_DISABLE_DEPRECATED
129 hildon_touch_selector_set_column_attributes (HildonTouchSelector *selector,
131 GtkCellRenderer *cell_renderer,
136 hildon_touch_selector_remove_column (HildonTouchSelector *selector,
140 hildon_touch_selector_get_num_columns (HildonTouchSelector *selector);
143 hildon_touch_selector_set_column_selection_mode (HildonTouchSelector *selector,
144 HildonTouchSelectorSelectionMode mode);
146 HildonTouchSelectorSelectionMode
147 hildon_touch_selector_get_column_selection_mode (HildonTouchSelector *selector);
149 HildonTouchSelectorColumn *
150 hildon_touch_selector_get_column (HildonTouchSelector *selector,
153 /* get/set active item */
155 hildon_touch_selector_set_active (HildonTouchSelector *selector,
159 hildon_touch_selector_get_active (HildonTouchSelector *selector,
163 hildon_touch_selector_get_selected (HildonTouchSelector *selector,
168 hildon_touch_selector_select_iter (HildonTouchSelector *selector,
174 hildon_touch_selector_unselect_iter (HildonTouchSelector *selector,
179 hildon_touch_selector_get_selected_rows (HildonTouchSelector *selector,
183 hildon_touch_selector_set_model (HildonTouchSelector *selector,
185 GtkTreeModel *model);
187 hildon_touch_selector_get_model (HildonTouchSelector *selector,
190 /* show the current element selected */
192 hildon_touch_selector_get_current_text (HildonTouchSelector *selector);
195 hildon_touch_selector_set_print_func (HildonTouchSelector *selector,
196 HildonTouchSelectorPrintFunc func);
198 HildonTouchSelectorPrintFunc
199 hildon_touch_selector_get_print_func (HildonTouchSelector *selector);
202 hildon_touch_selector_has_multiple_selection (HildonTouchSelector *selector);
206 #endif /* __HILDON_TOUCH_SELECTOR_H__ */