Add:gui_internal:Improved osd keyboard
[navit-package] / navit / route.h
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2008 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public License
7  * version 2 as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA  02110-1301, USA.
18  */
19
20 /** @file
21  * 
22  * @brief Contains exported code for route.c
23  *
24  * This file contains code that works together with route.c and that is exported to
25  * other modules.
26  */
27
28 #ifndef NAVIT_ROUTE_H
29 #define NAVIT_ROUTE_H
30
31 enum route_status {
32         route_status_no_destination=0,
33         route_status_not_found=1|2,
34         route_status_building_path=1|4,
35         route_status_building_graph=1|4|8,
36         route_status_path_done_new=1|16,
37         route_status_path_done_incremental=1|32,
38 };
39
40 struct route_crossing {
41         long segid;
42         int dir;
43 };
44
45 struct route_crossings {
46         int count;
47         struct route_crossing crossing[0];
48 };
49
50 /**
51  * @brief Information about a street
52  *
53  * This contains information about a certain street
54  */
55 struct street_data {
56         struct item item;       /**< The map item for this street */
57         int count;                      /**< Number of coordinates this street has */
58         int flags;
59         int maxspeed;           /**< Maximum speed allowed on this street. */
60         struct coord c[0];      /**< Pointer to the coordinates of this street.
61                                                  *   DO NOT INSERT FIELDS AFTER THIS. */
62 };
63
64 /* prototypes */
65 enum item_type;
66 struct coord;
67 struct displaylist;
68 struct item;
69 struct map_selection;
70 struct mapset;
71 struct route;
72 struct route_info;
73 struct route_info_handle;
74 struct route_path_coord_handle;
75 struct route_path_handle;
76 struct route_path_segment;
77 struct route_preferences;
78 struct street_data;
79 struct tracking;
80 struct transformation;
81 struct route *route_new(struct attr *parent, struct attr **attrs);
82 void route_set_mapset(struct route *this, struct mapset *ms);
83 void route_set_profile(struct route *this, struct vehicleprofile *prof);
84 struct mapset *route_get_mapset(struct route *this);
85 struct route_info *route_get_pos(struct route *this);
86 struct route_info *route_get_dst(struct route *this);
87 int *route_get_speedlist(struct route *this);
88 int route_get_path_set(struct route *this);
89 int route_set_speed(struct route *this, enum item_type type, int value);
90 int route_contains(struct route *this, struct item *item);
91 void route_set_position(struct route *this, struct pcoord *pos);
92 void route_set_position_from_tracking(struct route *this, struct tracking *tracking, enum projection pro);
93 struct map_selection *route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs);
94 void route_set_destination(struct route *this, struct pcoord *dst, int async);
95 struct route_path_handle *route_path_open(struct route *this);
96 struct route_path_segment *route_path_get_segment(struct route_path_handle *h);
97 struct coord *route_path_segment_get_start(struct route_path_segment *s);
98 struct coord *route_path_segment_get_end(struct route_path_segment *s);
99 struct item *route_path_segment_get_item(struct route_path_segment *s);
100 int route_path_segment_get_length(struct route_path_segment *s);
101 int route_path_segment_get_time(struct route_path_segment *s);
102 void route_path_close(struct route_path_handle *h);
103 struct route_path_coord_handle *route_path_coord_open(struct route *this);
104 struct coord *route_path_coord_get(struct route_path_coord_handle *h);
105 void route_path_coord_close(struct route_path_coord_handle *h);
106 int route_time(struct route_preferences *preferences, struct item *item, int len, int maxspeed);
107 int route_info_length(struct route_info *pos, struct route_info *dst, int dir);
108 struct street_data *street_get_data(struct item *item);
109 struct street_data *street_data_dup(struct street_data *orig);
110 void street_data_free(struct street_data *sd);
111 void route_info_free(struct route_info *inf);
112 struct street_data *route_info_street(struct route_info *rinf);
113 struct coord *route_info_point(struct route_info *rinf, int point);
114 struct route_info_handle *route_info_open(struct route_info *start, struct route_info *end, int dir);
115 struct coord *route_info_get(struct route_info_handle *h);
116 void route_info_close(struct route_info_handle *h);
117 void route_draw(struct route *this, struct transformation *t, struct displaylist *dsp);
118 struct map *route_get_map(struct route *route);
119 struct map *route_get_graph_map(struct route *route);
120 void route_set_projection(struct route *this_, enum projection pro);
121 int route_destination_reached(struct route *this);
122 int route_set_attr(struct route *this_, struct attr *attr);
123 int route_add_attr(struct route *this_, struct attr *attr);
124 int route_remove_attr(struct route *this_, struct attr *attr);
125 int route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
126 void route_init(void);
127 int route_pos_contains(struct route *this, struct item *item);
128 struct coord route_get_coord_dist(struct route *this_, int dist);
129
130 /* end of prototypes */
131
132 #endif
133