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__
28 #define HILDON_TYPE_TOUCH_SELECTOR (hildon_touch_selector_get_type ())
29 #define HILDON_TOUCH_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HILDON_TYPE_TOUCH_SELECTOR, HildonTouchSelector))
30 #define HILDON_TOUCH_SELECTOR_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), HILDON_TYPE_TOUCH_SELECTOR, HildonTouchSelectorClass))
31 #define HILDON_IS_TOUCH_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_TOUCH_SELECTOR))
32 #define HILDON_IS_TOUCH_SELECTOR_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), HILDON_TYPE_TOUCH_SELECTOR))
33 #define HILDON_TOUCH_SELECTOR_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), HILDON_TYPE_TOUCH_SELECTOR, HildonTouchSelectorClass))
35 typedef struct _HildonTouchSelector HildonTouchSelector;
36 typedef struct _HildonTouchSelectorClass HildonTouchSelectorClass;
37 typedef struct _HildonTouchSelectorPrivate HildonTouchSelectorPrivate;
39 typedef gchar *(*HildonTouchSelectorPrintFunc) (HildonTouchSelector * selector);
41 struct _HildonTouchSelector
43 GtkHBox parent_instance;
46 HildonTouchSelectorPrivate *priv;
49 struct _HildonTouchSelectorClass
51 GtkHBoxClass parent_class;
54 void (*changed) (HildonTouchSelector * selector, gint column);
57 void (*set_model) (HildonTouchSelector *selector, gint column, GtkTreeModel *model);
62 HILDON_TOUCH_SELECTOR_SELECTION_MODE_SINGLE,
63 HILDON_TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE
64 } HildonTouchSelectorSelectionMode;
67 GType hildon_touch_selector_get_type (void) G_GNUC_CONST;
68 GtkWidget *hildon_touch_selector_new (void);
70 /* Simple (and recommended) API for one-text-column selectors. */
71 GtkWidget *hildon_touch_selector_new_text (void);
73 void hildon_touch_selector_append_text (HildonTouchSelector * selector,
75 void hildon_touch_selector_prepend_text (HildonTouchSelector * selector,
77 void hildon_touch_selector_insert_text (HildonTouchSelector * selector,
78 gint position, const gchar * text);
81 gboolean hildon_touch_selector_append_text_column (HildonTouchSelector * selector,
82 GtkTreeModel * model);
84 gboolean hildon_touch_selector_append_column (HildonTouchSelector * selector,
86 GtkCellRenderer * cell_renderer,
89 void hildon_touch_selector_set_column_attributes (HildonTouchSelector * selector,
91 GtkCellRenderer * cell_renderer,
94 gboolean hildon_touch_selector_remove_column (HildonTouchSelector * selector,
97 gint hildon_touch_selector_get_num_columns (HildonTouchSelector * selector);
99 void hildon_touch_selector_set_column_selection_mode (HildonTouchSelector * selector,
100 HildonTouchSelectorSelectionMode mode);
102 HildonTouchSelectorSelectionMode
103 hildon_touch_selector_get_column_selection_mode (HildonTouchSelector * selector);
105 /* get/set active item */
106 gboolean hildon_touch_selector_get_active_iter (HildonTouchSelector * selector,
109 void hildon_touch_selector_set_active_iter (HildonTouchSelector * selector,
113 GList *hildon_touch_selector_get_selected_rows (HildonTouchSelector * selector,
116 void hildon_touch_selector_set_model (HildonTouchSelector * selector,
117 gint column, GtkTreeModel * model);
118 GtkTreeModel *hildon_touch_selector_get_model (HildonTouchSelector * selector,
121 /* show the current element selected */
122 gchar *hildon_touch_selector_get_current_text (HildonTouchSelector * selector);
124 void hildon_touch_selector_set_print_func (HildonTouchSelector * selector,
125 HildonTouchSelectorPrintFunc func);
127 HildonTouchSelectorPrintFunc
128 hildon_touch_selector_get_print_func (HildonTouchSelector * selector);
132 #endif /* __HILDON_TOUCH_SELECTOR_H__ */