navit 0.5.3-trunk
Loading...
Searching...
No Matches
backend.h
Go to the documentation of this file.
1#ifndef BACKEND_H
2#define BACKEND_H
3
4#include <QObject>
5#include <QQmlApplicationEngine>
6#include <QQmlListProperty>
7
8#include "qml_map.h"
9#include "qml_poi.h"
10#include "qml_bookmark.h"
11#include "qml_vehicle.h"
12
13#include "coord.h"
14#include "item.h"
15#include "attr.h"
16
17class Backend : public QObject
18{
19 Q_OBJECT
20 Q_PROPERTY(QQmlListProperty<QObject> pois READ getPois NOTIFY poisChanged)
21 Q_PROPERTY(QQmlListProperty<QObject> bookmarks READ getBookmarks NOTIFY bookmarksChanged)
22 Q_PROPERTY(QQmlListProperty<QObject> maps READ getMaps NOTIFY mapsChanged)
23 Q_PROPERTY(QQmlListProperty<QObject> vehicles READ getVehicles NOTIFY vehiclesChanged)
27 Q_PROPERTY(QQmlListProperty<QObject> searchresults READ getSearchResults NOTIFY searchResultsChanged)
28 // Search properties
29 Q_PROPERTY(QString currentCountry READ currentCountry NOTIFY currentCountryChanged)
31 Q_PROPERTY(QString currentTown READ currentTown NOTIFY currentTownChanged)
32 Q_PROPERTY(QString currentStreet READ currentStreet NOTIFY currentStreetChanged)
33
34public:
35 explicit Backend(QObject *parent = 0);
36
37 void showMenu(struct point* p);
38 void set_navit(struct navit* nav);
39 void set_engine(QQmlApplicationEngine* engine);
40
41 QList < PoiObject * > pois;
42 QQmlListProperty<QObject> getPois();
44 QQmlListProperty<QObject> getBookmarks();
45 QList < MapObject * > maps;
46 QQmlListProperty<QObject> getMaps();
47 QList < MapObject * > vehicles;
48 QQmlListProperty<QObject> getVehicles();
52 QQmlListProperty<QObject> getSearchResults();
53 QString currentCountry();
55 QString currentTown();
56 QString currentStreet();
57
58signals:
59 void displayMenu(QString source);
60 void hideMenu();
73
74public slots:
75 void get_maps();
76 void get_pois();
77 void get_bookmarks();
78 void get_vehicles();
79 QString get_icon_path();
80 QString get_country_icon(char * country_iso_code);
81 void setActivePoi(int index);
82 void setCurrentBookmark(int index);
83 void setCurrentVehicle(int index);
85 void updateSearch(QString text);
86 void searchValidateResult(int index);
87 void resize(int width, int height);
88 void setSearchContext(QString text);
89 void block_draw();
90
91private:
92 struct navit *nav;
93 struct point *p;
94 struct coord_geo g;
95 struct pcoord c;
96 int filter_pois(struct item *item);
97 QQmlApplicationEngine* engine;
98 QList<QObject *> _pois;
99 QList<QObject *> _bookmarks;
100 QList<QObject *> _maps;
101 QList<QObject *> _vehicles;
105 QList<QObject *> _search_results;
106 void set_default_country();
107 const char * _country_iso2;
108 const char * _current_country;
109 const char * _current_town;
110 const char * _current_street;
113};
114
115#endif // BACKEND_H
attr_type
Definition attr_type_def.h:11
Definition backend.h:18
struct pcoord c
Definition backend.h:95
QQmlListProperty< QObject > maps
Definition backend.h:22
void setCurrentVehicle(int index)
set the current vehicle. Used when clicking on a vehicle list to display one single vehicle
Definition backend.cpp:391
QQmlApplicationEngine * engine
Definition backend.h:97
void get_bookmarks()
update the private m_bookmarks list. Expected to be called from QML
Definition backend.cpp:170
QString currentStreet
Definition backend.h:32
QList< QObject * > _pois
Definition backend.h:98
QList< QObject * > _bookmarks
Definition backend.h:99
PoiObject * activePoi
get the active POI. Used when displaying the relevant menu
Definition backend.h:24
void setActivePoiAsDestination()
set the destination using the currently active POI's coordinates
Definition backend.cpp:410
void get_pois()
update the private m_pois list. Expected to be called from QML
Definition backend.cpp:201
QQmlListProperty< QObject > getPois()
get the POIs as a QList
Definition backend.cpp:260
void set_engine(QQmlApplicationEngine *engine)
set a pointer to the QQmlApplicationEngine * for local use
Definition backend.cpp:149
void resize(int width, int height)
set the canvas size to use when drawing the map
Definition backend.cpp:351
QQmlListProperty< QObject > vehicles
Definition backend.h:23
PoiObject * m_activePoi
Definition backend.h:102
void searchValidateResult(int index)
save the search result for the next search step
Definition backend.cpp:425
QString get_country_icon(char *country_iso_code)
get the icon that matches the country currently used for searches
Definition backend.cpp:452
struct search_param * search
Definition backend.h:111
void displayMenu(QString source)
void searchResultsChanged()
QQmlListProperty< QObject > getVehicles()
get the vehicles as a QList
Definition backend.cpp:288
struct navit * nav
Definition backend.h:92
void setCurrentBookmark(int index)
set the current bookmark. Used when clicking on a bookmark list to display one single bookmark
Definition backend.cpp:377
void vehiclesChanged()
void block_draw()
Definition backend.cpp:340
enum attr_type _search_context
Definition backend.h:112
QList< QObject * > _search_results
Definition backend.h:105
QString currentTown
Definition backend.h:31
void get_vehicles()
update the private m_vehicles list. Expected to be called from QML
Definition backend.cpp:100
const char * _current_country
Definition backend.h:108
struct coord_geo g
Definition backend.h:94
VehicleObject * currentVehicle
get the currently selected vehicle. Used when displaying the relevant menu
Definition backend.h:26
void currentBookmarkChanged()
void setSearchContext(QString text)
Definition backend.cpp:551
void get_maps()
update the private m_maps list. Expected to be called from QML
Definition backend.cpp:65
void mapsChanged()
void currentStreetChanged()
QQmlListProperty< QObject > searchresults
Definition backend.h:27
QString currentCountryIso2
Definition backend.h:30
void bookmarksChanged()
void hideMenu()
QQmlListProperty< QObject > getBookmarks()
get the Bookmarks as a QList
Definition backend.cpp:269
void updateSearch(QString text)
update the current search results according to new inputs. Currently only works to search for towns
Definition backend.cpp:486
const char * _current_town
Definition backend.h:109
const char * _current_street
Definition backend.h:110
const char * _country_iso2
Definition backend.h:107
int filter_pois(struct item *item)
apply search filters on one specific item
Definition backend.cpp:158
QList< QObject * > _maps
Definition backend.h:100
void poisChanged()
QList< QObject * > _vehicles
Definition backend.h:101
void set_default_country()
set the default country
Definition backend.cpp:475
QString get_icon_path()
returns the icon absolute path
Definition backend.cpp:401
BookmarkObject * m_currentBookmark
Definition backend.h:103
QQmlListProperty< QObject > getMaps()
get the maps as a QList
Definition backend.cpp:278
struct point * p
Definition backend.h:93
QQmlListProperty< QObject > pois
Definition backend.h:20
QQmlListProperty< QObject > getSearchResults()
get the search results as a QList
Definition backend.cpp:297
QString currentCountry
Definition backend.h:29
void showMenu(struct point *p)
Set some variables and display the main menu.
Definition backend.cpp:40
void currentCountryIso2Changed()
BookmarkObject * currentBookmark
get the current bookmark. Used when displaying the relevant menu
Definition backend.h:25
void setActivePoi(int index)
set the active POI. Used when clicking on a POI list to display one single POI
Definition backend.cpp:364
void currentVehicleChanged()
VehicleObject * m_currentVehicle
Definition backend.h:104
void activePoiChanged()
void currentTownChanged()
void currentCountryChanged()
void set_navit(struct navit *nav)
set a pointer to the struct navit * for local use
Definition backend.cpp:140
Definition qml_bookmark.h:8
Definition qml_map.h:7
Definition qml_poi.h:8
Definition qml_vehicle.h:9
unsigned short width
Definition garmin_img.c:3
unsigned short height
Definition garmin_img.c:4
Definition bookmarks.c:53
A WGS84 coordinate.
Definition coord.h:97
Represents an object on a map.
Definition item.h:124
Definition navit.c:112
Definition gpx2navit_txt.h:51
Definition coord.h:52
Definition point.h:23
Definition destination.c:41