Fix:core:Made route.h vehicle.h C++ friendly
[profile/ivi/navit.git] / navit / 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 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 enum route_status {
35         route_status_no_destination=0,
36         route_status_destination_set=1,
37         route_status_not_found=1|2,
38         route_status_building_path=1|4,
39         route_status_building_graph=1|4|8,
40         route_status_path_done_new=1|16,
41         route_status_path_done_incremental=1|32,
42 };
43
44 struct route_crossing {
45         long segid;
46         int dir;
47 };
48
49 struct route_crossings {
50         int count;
51         struct route_crossing crossing[0];
52 };
53
54 /**
55  * @brief Information about a street
56  *
57  * This contains information about a certain street
58  */
59 struct street_data {
60         struct item item;       /**< The map item for this street */
61         int count;                      /**< Number of coordinates this street has */
62         int flags;
63         int maxspeed;           /**< Maximum speed allowed on this street. */
64         struct coord c[0];      /**< Pointer to the coordinates of this street.
65                                                  *   DO NOT INSERT FIELDS AFTER THIS. */
66 };
67
68 /* prototypes */
69 enum attr_type;
70 enum projection;
71 struct attr;
72 struct attr_iter;
73 struct coord;
74 struct item;
75 struct map;
76 struct map_selection;
77 struct mapset;
78 struct pcoord;
79 struct route;
80 struct route_info;
81 struct street_data;
82 struct tracking;
83 struct vehicleprofile;
84 struct route *route_new(struct attr *parent, struct attr **attrs);
85 void route_set_mapset(struct route *this_, struct mapset *ms);
86 void route_set_profile(struct route *this_, struct vehicleprofile *prof);
87 struct mapset *route_get_mapset(struct route *this_);
88 struct route_info *route_get_pos(struct route *this_);
89 struct route_info *route_get_dst(struct route *this_);
90 int route_get_path_set(struct route *this_);
91 int route_contains(struct route *this_, struct item *item);
92 int route_destination_reached(struct route *this_);
93 void route_set_position(struct route *this_, struct pcoord *pos);
94 void route_set_position_from_tracking(struct route *this_, struct tracking *tracking, enum projection pro);
95 struct map_selection *route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs);
96 void route_set_destinations(struct route *this_, struct pcoord *dst, int count, int async);
97 int route_get_destinations(struct route *this_, struct pcoord *pc, int count);
98 void route_set_destination(struct route *this_, struct pcoord *dst, int async);
99 void route_remove_waypoint(struct route *this_);
100 struct coord route_get_coord_dist(struct route *this_, int dist);
101 struct street_data *street_get_data(struct item *item);
102 struct street_data *street_data_dup(struct street_data *orig);
103 void street_data_free(struct street_data *sd);
104 void route_info_free(struct route_info *inf);
105 struct street_data *route_info_street(struct route_info *rinf);
106 struct map *route_get_map(struct route *this_);
107 struct map *route_get_graph_map(struct route *this_);
108 void route_set_projection(struct route *this_, enum projection pro);
109 void route_set_destinations(struct route *this_, struct pcoord *dst, int count, int async);
110 int route_set_attr(struct route *this_, struct attr *attr);
111 int route_add_attr(struct route *this_, struct attr *attr);
112 int route_remove_attr(struct route *this_, struct attr *attr);
113 struct attr_iter * route_attr_iter_new(void);
114 void route_attr_iter_destroy(struct attr_iter *iter);
115 int route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
116 void route_init(void);
117 void route_destroy(struct route *this_);
118 /* end of prototypes */
119 #ifdef __cplusplus
120 }
121 #endif
122
123 #endif
124