Add:Core:Added a selection feature to search.c
[navit-package] / navit / search.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 #ifndef NAVIT_SEARCH_H
21 #define NAVIT_SEARCH_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 struct search_list_common {
27         struct item item;
28         int selected;
29         struct pcoord *c;
30 };
31
32 struct search_list_country {
33         struct item item;
34         int selected;
35         struct pcoord *c;
36         char *car;
37         char *iso2;
38         char *iso3;
39         char *name;
40         char *flag;
41 };
42
43 struct search_list_town {
44         struct item item;
45         int selected;
46         struct pcoord *c;
47         struct item itemt;
48         char *postal;
49         char *name;
50         char *district;
51 };
52
53 struct search_list_street {
54         struct item item;
55         int selected;
56         struct pcoord *c;
57         char *name;
58 };
59
60 struct search_list_result {
61         int id;
62         struct pcoord *c;
63         struct search_list_country *country;
64         struct search_list_town *town;
65         struct search_list_street *street;
66 };
67
68 /* prototypes */
69 struct attr;
70 struct mapset;
71 struct search_list;
72 struct search_list_result;
73 struct search_list *search_list_new(struct mapset *ms);
74 void search_list_search(struct search_list *this_, struct attr *search_attr, int partial);
75 struct search_list_result *search_list_get_result(struct search_list *this_);
76 void search_list_destroy(struct search_list *this_);
77 /* end of prototypes */
78 #ifdef __cplusplus
79 }
80 #endif
81
82 #endif
83