navit  0.5.3-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
Backend Class Reference

#include <backend.h>

Inheritance diagram for Backend:

Public Slots

void get_maps ()
 update the private m_maps list. Expected to be called from QML More...
 
void get_pois ()
 update the private m_pois list. Expected to be called from QML More...
 
void get_bookmarks ()
 update the private m_bookmarks list. Expected to be called from QML More...
 
void get_vehicles ()
 update the private m_vehicles list. Expected to be called from QML More...
 
QString get_icon_path ()
 returns the icon absolute path More...
 
QString get_country_icon (char *country_iso_code)
 get the icon that matches the country currently used for searches More...
 
void setActivePoi (int index)
 set the active POI. Used when clicking on a POI list to display one single POI More...
 
void setCurrentBookmark (int index)
 set the current bookmark. Used when clicking on a bookmark list to display one single bookmark More...
 
void setCurrentVehicle (int index)
 set the current vehicle. Used when clicking on a vehicle list to display one single vehicle More...
 
void setActivePoiAsDestination ()
 set the destination using the currently active POI's coordinates More...
 
void updateSearch (QString text)
 update the current search results according to new inputs. Currently only works to search for towns More...
 
void searchValidateResult (int index)
 save the search result for the next search step More...
 
void resize (int width, int height)
 set the canvas size to use when drawing the map More...
 
void setSearchContext (QString text)
 
void block_draw ()
 

Signals

void displayMenu (QString source)
 
void hideMenu ()
 
void poisChanged ()
 
void bookmarksChanged ()
 
void activePoiChanged ()
 
void currentBookmarkChanged ()
 
void currentVehicleChanged ()
 
void mapsChanged ()
 
void vehiclesChanged ()
 
void searchResultsChanged ()
 
void currentCountryChanged ()
 
void currentCountryIso2Changed ()
 
void currentTownChanged ()
 
void currentStreetChanged ()
 

Public Member Functions

 Backend (QObject *parent=0)
 
void showMenu (struct point *p)
 Set some variables and display the main menu. More...
 
void set_navit (struct navit *nav)
 set a pointer to the struct navit * for local use More...
 
void set_engine (QQmlApplicationEngine *engine)
 set a pointer to the QQmlApplicationEngine * for local use More...
 
QQmlListProperty< QObject > getPois ()
 get the POIs as a QList More...
 
QQmlListProperty< QObject > getBookmarks ()
 get the Bookmarks as a QList More...
 
QQmlListProperty< QObject > getMaps ()
 get the maps as a QList More...
 
QQmlListProperty< QObject > getVehicles ()
 get the vehicles as a QList More...
 
PoiObjectactivePoi ()
 
BookmarkObjectcurrentBookmark ()
 
VehicleObjectcurrentVehicle ()
 
QQmlListProperty< QObject > getSearchResults ()
 get the search results as a QList More...
 
QString currentCountry ()
 
QString currentCountryIso2 ()
 
QString currentTown ()
 
QString currentStreet ()
 

Data Fields

QList< PoiObject * > pois
 
QList< BookmarkObject * > bookmarks
 
QList< MapObject * > maps
 
QList< MapObject * > vehicles
 

Properties

QQmlListProperty< QObject > pois
 
QQmlListProperty< QObject > bookmarks
 
QQmlListProperty< QObject > maps
 
QQmlListProperty< QObject > vehicles
 
PoiObject activePoi
 get the active POI. Used when displaying the relevant menu More...
 
BookmarkObject currentBookmark
 get the current bookmark. Used when displaying the relevant menu More...
 
VehicleObject currentVehicle
 get the currently selected vehicle. Used when displaying the relevant menu More...
 
QQmlListProperty< QObject > searchresults
 
QString currentCountry
 
QString currentCountryIso2
 
QString currentTown
 
QString currentStreet
 

Private Member Functions

int filter_pois (struct item *item)
 apply search filters on one specific item More...
 
void set_default_country ()
 set the default country More...
 

Private Attributes

struct navitnav
 
struct pointp
 
struct coord_geo g
 
struct pcoord c
 
QQmlApplicationEngine * engine
 
QList< QObject * > _pois
 
QList< QObject * > _bookmarks
 
QList< QObject * > _maps
 
QList< QObject * > _vehicles
 
PoiObjectm_activePoi
 
BookmarkObjectm_currentBookmark
 
VehicleObjectm_currentVehicle
 
QList< QObject * > _search_results
 
char * _country_iso2
 
char * _current_country
 
char * _current_town
 
char * _current_street
 
struct search_paramsearch
 
enum attr_type _search_context
 

Constructor & Destructor Documentation

Backend::Backend ( QObject *  parent = 0)
explicit

Member Function Documentation

PoiObject* Backend::activePoi ( )
void Backend::activePoiChanged ( )
signal

Referenced by setActivePoi().

void Backend::block_draw ( )
slot

References dbg, lvl_debug, nav, and navit_block().

void Backend::bookmarksChanged ( )
signal

Referenced by get_bookmarks().

BookmarkObject* Backend::currentBookmark ( )
void Backend::currentBookmarkChanged ( )
signal

Referenced by setCurrentBookmark().

QString Backend::currentCountry ( )
void Backend::currentCountryChanged ( )
signal
QString Backend::currentCountryIso2 ( )
void Backend::currentCountryIso2Changed ( )
signal
QString Backend::currentStreet ( )
void Backend::currentStreetChanged ( )
signal
QString Backend::currentTown ( )
void Backend::currentTownChanged ( )
signal
VehicleObject* Backend::currentVehicle ( )
void Backend::currentVehicleChanged ( )
signal

Referenced by setCurrentVehicle().

void Backend::displayMenu ( QString  source)
signal

Referenced by searchValidateResult(), and showMenu().

int Backend::filter_pois ( struct item item)
private

apply search filters on one specific item

Parameters
structitem * the item to filter
Returns
0 if the item should be discarded, 1 otherwise

References item::type, type, and types.

Referenced by get_pois().

void Backend::get_bookmarks ( )
slot
QString Backend::get_country_icon ( char *  country_iso_code)
slot

get the icon that matches the country currently used for searches

Parameters
none
Returns
an absolute path for the country icon

Referenced by updateSearch().

QString Backend::get_icon_path ( )
slot

returns the icon absolute path

Parameters
none
Returns
the icon absolute path as a QString
void Backend::get_maps ( )
slot

update the private m_maps list. Expected to be called from QML

Parameters
none
Returns
nothing

References _maps, attr_iter::iter, label, attr::map, map_get_attr(), mapsChanged(), nav, navit_attr_iter_new(), navit_get_attr(), attr::num, attr::str, attr::type, and attr::u.

void Backend::get_vehicles ( )
slot

update the private m_vehicles list. Expected to be called from QML

Parameters
none
Returns
nothing

References _vehicles, dbg, attr_iter::iter, lvl_debug, nav, navit_attr_iter_destroy(), navit_attr_iter_new(), navit_get_attr(), attr::str, attr::u, attr::vehicle, vehicle_get_attr(), and vehiclesChanged().

QQmlListProperty< QObject > Backend::getBookmarks ( )

get the Bookmarks as a QList

Parameters
none
Returns
the bookmarks QList

References _bookmarks.

QQmlListProperty< QObject > Backend::getMaps ( )

get the maps as a QList

Parameters
none
Returns
the maps QList

References _maps.

QQmlListProperty< QObject > Backend::getPois ( )

get the POIs as a QList

Parameters
none
Returns
the pois QList

References _pois.

QQmlListProperty< QObject > Backend::getSearchResults ( )

get the search results as a QList

Parameters
none
Returns
the search results QList

References _search_results.

QQmlListProperty< QObject > Backend::getVehicles ( )

get the vehicles as a QList

Parameters
none
Returns
the vehicles QList

References _vehicles.

void Backend::hideMenu ( )
signal
void Backend::mapsChanged ( )
signal

Referenced by get_maps().

void Backend::poisChanged ( )
signal

Referenced by get_pois().

void Backend::resize ( int  width,
int  height 
)
slot

set the canvas size to use when drawing the map

Parameters
intwidth
intheight
Returns
nothing

References nav, navit_block(), and navit_handle_resize().

Referenced by setActivePoi(), and setCurrentBookmark().

void Backend::searchResultsChanged ( )
signal

Referenced by updateSearch().

void Backend::searchValidateResult ( int  index)
slot

save the search result for the next search step

Parameters
intindex the index of the result in the m_search_results list
Returns
nothing

References _current_country, _current_street, _current_town, _search_context, _search_results, dbg, displayMenu(), SearchObject::getCoords(), lvl_debug, lvl_error, SearchObject::name, pcoord::x, and pcoord::y.

void Backend::set_default_country ( )
private

set the default country

Parameters
nonereturns nothing

References _country_iso2, and _current_country.

Referenced by Backend().

void Backend::set_engine ( QQmlApplicationEngine *  engine)

set a pointer to the QQmlApplicationEngine * for local use

Parameters
none
Returns
nothing

References engine.

Referenced by gui_qt5_qml_set_graphics().

void Backend::set_navit ( struct navit nav)

set a pointer to the struct navit * for local use

Parameters
none
Returns
nothing

References nav.

Referenced by gui_qt5_qml_set_graphics().

void Backend::setActivePoi ( int  index)
slot

set the active POI. Used when clicking on a POI list to display one single POI

Parameters
intindex the index of the POI in the m_pois list
Returns
nothing

References _pois, activePoiChanged(), m_activePoi, nav, navit_set_center(), and resize().

void Backend::setActivePoiAsDestination ( )
slot

set the destination using the currently active POI's coordinates

Parameters
none
Returns
nothing

References PoiObject::coords(), dbg, hideMenu(), lvl_debug, m_activePoi, PoiObject::name, nav, and navit_set_destination().

void Backend::setCurrentBookmark ( int  index)
slot

set the current bookmark. Used when clicking on a bookmark list to display one single bookmark

Parameters
intindex the index of the bookmark in the m_bookmarks list
Returns
nothing

References _bookmarks, currentBookmarkChanged(), m_currentBookmark, nav, navit_set_center(), and resize().

void Backend::setCurrentVehicle ( int  index)
slot

set the current vehicle. Used when clicking on a vehicle list to display one single vehicle

Parameters
intindex the index of the vehicle in the m_vehicles list
Returns
nothing

References _vehicles, currentVehicleChanged(), and m_currentVehicle.

void Backend::setSearchContext ( QString  text)
slot

References _search_context, dbg, and lvl_error.

void Backend::showMenu ( struct point p)

Set some variables and display the main menu.

Parameters
structpoint *p the point coordinate where we clicked on the screen
Returns
nothing

References c, dbg, displayMenu(), g, coord_geo::lat, lvl_debug, nav, navit_block(), navit_get_trans(), navit_set_position(), pcoord::pro, transform_get_projection(), transform_reverse(), transform_to_geo(), point::x, coord::x, pcoord::x, point::y, coord::y, and pcoord::y.

Referenced by gui_qt5_qml_button().

void Backend::vehiclesChanged ( )
signal

Referenced by get_vehicles().

Field Documentation

QList<QObject *> Backend::_bookmarks
private
char* Backend::_country_iso2
private
char* Backend::_current_country
private
char* Backend::_current_street
private

Referenced by Backend(), and searchValidateResult().

char* Backend::_current_town
private

Referenced by Backend(), and searchValidateResult().

QList<QObject *> Backend::_maps
private

Referenced by get_maps(), and getMaps().

QList<QObject *> Backend::_pois
private

Referenced by get_pois(), getPois(), and setActivePoi().

enum attr_type Backend::_search_context
private
QList<QObject *> Backend::_search_results
private
QList<QObject *> Backend::_vehicles
private
QList< BookmarkObject * > Backend::bookmarks
struct pcoord Backend::c
private

Referenced by showMenu().

QQmlApplicationEngine* Backend::engine
private

Referenced by set_engine().

struct coord_geo Backend::g
private

Referenced by showMenu().

PoiObject* Backend::m_activePoi
private
BookmarkObject* Backend::m_currentBookmark
private

Referenced by setCurrentBookmark().

VehicleObject* Backend::m_currentVehicle
private

Referenced by setCurrentVehicle().

QList< MapObject * > Backend::maps
struct point* Backend::p
private
QList< PoiObject * > Backend::pois
struct search_param* Backend::search
private

Referenced by Backend(), and updateSearch().

QList< MapObject * > Backend::vehicles

Property Documentation

PoiObject * Backend::activePoi
read

get the active POI. Used when displaying the relevant menu

Parameters
none
Returns
the active POI
QQmlListProperty<QObject> Backend::bookmarks
read
BookmarkObject * Backend::currentBookmark
read

get the current bookmark. Used when displaying the relevant menu

Parameters
none
Returns
the current bookmark
QString Backend::currentCountry
read
QString Backend::currentCountryIso2
read
QString Backend::currentStreet
read
QString Backend::currentTown
read
VehicleObject * Backend::currentVehicle
read

get the currently selected vehicle. Used when displaying the relevant menu

Parameters
none
Returns
the active POI
QQmlListProperty<QObject> Backend::maps
read
QQmlListProperty<QObject> Backend::pois
read
QQmlListProperty<QObject> Backend::searchresults
read
QQmlListProperty<QObject> Backend::vehicles
read

The documentation for this class was generated from the following files: