navit  0.5.3-trunk
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
 
PoiObjectactivePoi
 get the active POI. Used when displaying the relevant menu More...
 
BookmarkObjectcurrentBookmark
 get the current bookmark. Used when displaying the relevant menu More...
 
VehicleObjectcurrentVehicle
 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
 
const char * _country_iso2
 
const char * _current_country
 
const char * _current_town
 
const char * _current_street
 
struct search_paramsearch
 
enum attr_type _search_context
 

Constructor & Destructor Documentation

◆ Backend()

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

Member Function Documentation

◆ activePoi()

PoiObject* Backend::activePoi ( )

◆ activePoiChanged

void Backend::activePoiChanged ( )
signal

Referenced by setActivePoi().

◆ block_draw

void Backend::block_draw ( )
slot

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

◆ bookmarksChanged

void Backend::bookmarksChanged ( )
signal

Referenced by get_bookmarks().

◆ currentBookmark()

BookmarkObject* Backend::currentBookmark ( )

◆ currentBookmarkChanged

void Backend::currentBookmarkChanged ( )
signal

Referenced by setCurrentBookmark().

◆ currentCountry()

QString Backend::currentCountry ( )

◆ currentCountryChanged

void Backend::currentCountryChanged ( )
signal

◆ currentCountryIso2()

QString Backend::currentCountryIso2 ( )

◆ currentCountryIso2Changed

void Backend::currentCountryIso2Changed ( )
signal

◆ currentStreet()

QString Backend::currentStreet ( )

◆ currentStreetChanged

void Backend::currentStreetChanged ( )
signal

◆ currentTown()

QString Backend::currentTown ( )

◆ currentTownChanged

void Backend::currentTownChanged ( )
signal

◆ currentVehicle()

VehicleObject* Backend::currentVehicle ( )

◆ currentVehicleChanged

void Backend::currentVehicleChanged ( )
signal

Referenced by setCurrentVehicle().

◆ displayMenu

void Backend::displayMenu ( QString  source)
signal

Referenced by searchValidateResult(), and showMenu().

◆ filter_pois()

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, and type.

Referenced by get_pois().

◆ get_bookmarks

void Backend::get_bookmarks ( )
slot

◆ get_country_icon

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().

◆ get_icon_path

QString Backend::get_icon_path ( )
slot

returns the icon absolute path

Parameters
none
Returns
the icon absolute path as a QString

◆ get_maps

void Backend::get_maps ( )
slot

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

Parameters
none
Returns
nothing

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

◆ get_pois

◆ get_vehicles

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().

◆ getBookmarks()

QQmlListProperty< QObject > Backend::getBookmarks ( )

get the Bookmarks as a QList

Parameters
none
Returns
the bookmarks QList

References _bookmarks.

◆ getMaps()

QQmlListProperty< QObject > Backend::getMaps ( )

get the maps as a QList

Parameters
none
Returns
the maps QList

References _maps.

◆ getPois()

QQmlListProperty< QObject > Backend::getPois ( )

get the POIs as a QList

Parameters
none
Returns
the pois QList

References _pois.

◆ getSearchResults()

QQmlListProperty< QObject > Backend::getSearchResults ( )

get the search results as a QList

Parameters
none
Returns
the search results QList

References _search_results.

◆ getVehicles()

QQmlListProperty< QObject > Backend::getVehicles ( )

get the vehicles as a QList

Parameters
none
Returns
the vehicles QList

References _vehicles.

◆ hideMenu

void Backend::hideMenu ( )
signal

◆ mapsChanged

void Backend::mapsChanged ( )
signal

Referenced by get_maps().

◆ poisChanged

void Backend::poisChanged ( )
signal

Referenced by get_pois().

◆ resize

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

set the canvas size to use when drawing the map

Parameters
intwidth
intheight
Returns
nothing

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

Referenced by setActivePoi(), and setCurrentBookmark().

◆ searchResultsChanged

void Backend::searchResultsChanged ( )
signal

Referenced by updateSearch().

◆ searchValidateResult

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.

◆ set_default_country()

void Backend::set_default_country ( )
private

set the default country

Parameters
nonereturns nothing

References _country_iso2, and _current_country.

Referenced by Backend().

◆ set_engine()

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().

◆ set_navit()

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().

◆ setActivePoi

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(), c, PoiObject::coords, m_activePoi, nav, navit_set_center(), and resize().

◆ setActivePoiAsDestination

void Backend::setActivePoiAsDestination ( )
slot

set the destination using the currently active POI's coordinates

Parameters
none
Returns
nothing

References c, PoiObject::coords, dbg, hideMenu(), lvl_debug, m_activePoi, PoiObject::name, nav, navit_set_destination(), pcoord::pro, pcoord::x, and pcoord::y.

◆ setCurrentBookmark

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, c, BookmarkObject::coords, currentBookmarkChanged(), m_currentBookmark, nav, navit_set_center(), and resize().

◆ setCurrentVehicle

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.

◆ setSearchContext

void Backend::setSearchContext ( QString  text)
slot

◆ showMenu()

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(), p, pcoord::pro, transform_get_projection(), transform_reverse(), transform_to_geo(), coord::x, pcoord::x, point::x, coord::y, pcoord::y, and point::y.

Referenced by gui_qt5_qml_button().

◆ updateSearch

◆ vehiclesChanged

void Backend::vehiclesChanged ( )
signal

Referenced by get_vehicles().

Field Documentation

◆ _bookmarks

QList<QObject *> Backend::_bookmarks
private

◆ _country_iso2

const char* Backend::_country_iso2
private

◆ _current_country

const char* Backend::_current_country
private

◆ _current_street

const char* Backend::_current_street
private

Referenced by Backend(), and searchValidateResult().

◆ _current_town

const char* Backend::_current_town
private

Referenced by Backend(), and searchValidateResult().

◆ _maps

QList<QObject *> Backend::_maps
private

Referenced by get_maps(), and getMaps().

◆ _pois

QList<QObject *> Backend::_pois
private

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

◆ _search_context

enum attr_type Backend::_search_context
private

◆ _search_results

QList<QObject *> Backend::_search_results
private

◆ _vehicles

QList<QObject *> Backend::_vehicles
private

◆ bookmarks

QList< BookmarkObject * > Backend::bookmarks

◆ c

◆ engine

QQmlApplicationEngine* Backend::engine
private

Referenced by set_engine().

◆ g

struct coord_geo Backend::g
private

Referenced by showMenu().

◆ m_activePoi

PoiObject* Backend::m_activePoi
private

◆ m_currentBookmark

BookmarkObject* Backend::m_currentBookmark
private

Referenced by setCurrentBookmark().

◆ m_currentVehicle

VehicleObject* Backend::m_currentVehicle
private

Referenced by setCurrentVehicle().

◆ maps

QList< MapObject * > Backend::maps

◆ nav

◆ p

struct point* Backend::p
private

Referenced by showMenu().

◆ pois

QList< PoiObject * > Backend::pois

◆ search

struct search_param* Backend::search
private

Referenced by Backend(), and updateSearch().

◆ vehicles

QList< MapObject * > Backend::vehicles

Property Documentation

◆ activePoi

PoiObject * Backend::activePoi
read

get the active POI. Used when displaying the relevant menu

Parameters
none
Returns
the active POI

◆ bookmarks

QQmlListProperty<QObject> Backend::bookmarks
read

◆ currentBookmark

BookmarkObject * Backend::currentBookmark
read

get the current bookmark. Used when displaying the relevant menu

Parameters
none
Returns
the current bookmark

◆ currentCountry

QString Backend::currentCountry
read

◆ currentCountryIso2

QString Backend::currentCountryIso2
read

◆ currentStreet

QString Backend::currentStreet
read

◆ currentTown

QString Backend::currentTown
read

◆ currentVehicle

VehicleObject * Backend::currentVehicle
read

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

Parameters
none
Returns
the active POI

◆ maps

QQmlListProperty<QObject> Backend::maps
read

◆ pois

QQmlListProperty<QObject> Backend::pois
read

◆ searchresults

QQmlListProperty<QObject> Backend::searchresults
read

◆ vehicles

QQmlListProperty<QObject> Backend::vehicles
read

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