Parent Directory | Revision Log
Project setup adjustments
1 | /* |
2 | * Copyright (C) 2008 Till Harbaum <till@harbaum.org>. |
3 | * |
4 | * This file is part of OSM2Go. |
5 | * |
6 | * OSM2Go is free software: you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation, either version 3 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * OSM2Go 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 |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with OSM2Go. If not, see <http://www.gnu.org/licenses/>. |
18 | */ |
19 | |
20 | #ifndef LIST_H |
21 | #define LIST_H |
22 | |
23 | typedef enum { |
24 | LIST_BUTTON_NEW = 0, |
25 | LIST_BUTTON_EDIT, |
26 | LIST_BUTTON_REMOVE, |
27 | LIST_BUTTON_USER0, |
28 | LIST_BUTTON_USER1, |
29 | LIST_BUTTON_USER2 |
30 | } list_button_t; |
31 | |
32 | /* list item flags */ |
33 | #define LIST_FLAG_EXPAND (1<<0) /* column expands with dialog size */ |
34 | #define LIST_FLAG_ELLIPSIZE (1<<1) /* column expands and text is ellipsized */ |
35 | #define LIST_FLAG_CAN_HIGHLIGHT (1<<2) /* column can be highlighted */ |
36 | #define LIST_FLAG_STOCK_ICON (1<<3) /* column contains stock icons */ |
37 | #define LIST_FLAG_TOGGLE (1<<4) /* column contains a toggle item */ |
38 | |
39 | #ifdef USE_HILDON |
40 | |
41 | /* on hildon a list may be system default (LIST_HILDON_WITHOUT_HEADERS), */ |
42 | /* forced to have headers (LIST_HILDON_WITH_HEADERS) or only be forced */ |
43 | /* on MAEMO5 (LIST_HILDON_WITH_HEADERS_ON_MAEMO5) */ |
44 | |
45 | #define LIST_HILDON_WITH_HEADERS TRUE |
46 | #define LIST_HILDON_WITHOUT_HEADERS FALSE |
47 | |
48 | #if MAEMO_VERSION_MAJOR <= 4 |
49 | #define LIST_HILDON_WITH_HEADERS_ON_MAEMO5 FALSE |
50 | #else |
51 | #define LIST_HILDON_WITH_HEADERS_ON_MAEMO5 TRUE |
52 | #endif |
53 | |
54 | GtkWidget *list_new(gboolean show_headers); |
55 | #else |
56 | #define LIST_HILDON_WITH_HEADERS |
57 | #define LIST_HILDON_WITHOUT_HEADERS |
58 | #define LIST_HILDON_WITH_HEADERS_ON_MAEMO5 |
59 | GtkWidget *list_new(void); |
60 | #endif |
61 | |
62 | GtkWidget *list_get_view(GtkWidget *list); |
63 | void list_set_user_buttons(GtkWidget *list, ...); |
64 | void list_set_columns(GtkWidget *list, ...); |
65 | void list_button_connect(GtkWidget *list, list_button_t id, |
66 | GCallback cb, gpointer data); |
67 | void list_set_custom_user_button(GtkWidget *list, list_button_t id, |
68 | GtkWidget *widget); |
69 | GtkTreeSelection *list_get_selection(GtkWidget *list); |
70 | void list_button_enable(GtkWidget *list, list_button_t id, gboolean enable); |
71 | void list_set_store(GtkWidget *list, GtkListStore *store); |
72 | void list_set_selection_function(GtkWidget *list, GtkTreeSelectionFunc func, |
73 | gpointer data); |
74 | void list_set_static_buttons(GtkWidget *list, gboolean first_new, |
75 | GCallback cb_new, GCallback cb_edit, GCallback cb_remove, |
76 | gpointer data); |
77 | GtkTreeModel *list_get_model(GtkWidget *list); |
78 | void list_pre_inplace_edit_tweak (GtkTreeModel *model); |
79 | void list_focus_on(GtkWidget *list, GtkTreeIter *iter, gboolean highlight); |
80 | |
81 | #endif // LIST_H |