]> err.no Git - mapper/blob - src/osm-db.h
Get rid of generated files
[mapper] / src / osm-db.h
1 /*
2  * This file is part of mapper
3  *
4  * Copyright (C) 2007 Kaj-Michael Lang
5  *
6  * This program 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 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program 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 along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef _OSM_DB_H
22 #define _OSM_DB_H
23
24 #include <glib.h>
25 #include "osm.h"
26
27 /** Generic search item list indexes */
28 typedef enum {
29         ITEM_ID,
30         ITEM_CATID,
31         ITEM_LAT,
32         ITEM_LON,
33         ITEM_DIST,
34         ITEM_LATLON,
35         ITEM_LABEL,
36         ITEM_DESC,
37         ITEM_CATLAB,
38         ITEM_ICON,
39         ITEM_COLOR,
40         ITEM_NUM_COLUMNS
41 } item_list_id;
42
43 typedef enum {
44         OSM_NODE_NEXT,
45         OSM_NODE_PREV,
46 } osm_node_direction;
47
48 gboolean osm_init(sqlite3 **db);
49 void osm_deinit(void);
50
51 gboolean osm_db_create(sqlite3 *db);
52
53 GSList *osm_get_route_node(guint nid, osm_node_direction d);
54
55 void osm_set_way_range_from_speed(gfloat speed);
56 void osm_set_way_range(guint sr);
57
58 gboolean osm_way_search(gdouble lat, gdouble lon, gchar *text, GtkListStore **store);
59
60 void osm_db_enable_mainloop(sqlite3 *db, gboolean eml);
61 void osm_progress_set_widget(sqlite3 *db, GtkProgressBar *w);
62
63 gboolean osm_way_search(gdouble lat, gdouble lon, gchar *text, GtkListStore **store);
64
65 gboolean osm_way_get_nodes(osm_way *w);
66 gboolean osm_way_get_name(osm_way *w);
67 gboolean osm_way_get_ref(osm_way *w);
68
69 gboolean osm_find_nearest_place(node_type_t type, gint lat, gint lon, osm_place **nr);
70 osm_way *osm_find_nearest_way(gint lat, gint lon);
71 gboolean osm_way_distance(gint lat, gint lon, osm_way_node *f, osm_way_node *t, gdouble *d);
72
73 gboolean osm_place_search(gdouble lat, gdouble lon, gchar *text, GtkListStore **store);
74 gboolean osm_place_get(guint32 id, gint lat, gint lon, osm_place **nr);
75
76 gboolean osm_check_location(osm_location *map_loc, gint lat, gint lon);
77 gboolean osm_get_location_data(gint lat, gint lon, gfloat heading, osm_location *map_loc);
78
79 osm_way_node *osm_way_node_new(guint id, gint lat, gint lon, gint flags);
80
81 void osm_way_node_free(osm_way_node *n);
82 void osm_way_free(osm_way *w);
83 void osm_way_nodes_free(osm_way *w);
84
85 #endif