|
libosmscout 0.1
|
Singleton that provides access to high level modules of OSMScout library. More...
#include <OSMScoutQt.h>
Public Slots | |
| void | threadFinished () |
Public Member Functions | |
| QString | GetCacheLocation () const |
| DBThreadRef | GetDBThread () const |
| QString | GetEspeakDataDir () const |
| QString | GetIconDirectory () const |
| MapDownloaderRef | GetMapDownloader () |
| MapManagerRef | GetMapManager () const |
| QString | GetNavigationTranslationDir () const |
| size_t | GetOnlineTileCacheSize () const |
| SettingsRef | GetSettings () const |
| QString | GetUserAgent () const |
| VoiceManagerRef | GetVoiceManager () |
| ElevationModule * | MakeElevationModule () |
| IconLookup * | MakeIconLookup () |
| LookupModule * | MakeLookupModule () |
| MapRenderer * | MakeMapRenderer (RenderingType type) |
| NavigationModule * | MakeNavigation () |
| POILookupModule * | MakePOILookupModule () |
| Router * | MakeRouter () |
| SearchModule * | MakeSearchModule () |
| StyleModule * | MakeStyleModule () |
| QThread * | makeThread (QString name) |
| Create new background thread with given name. | |
| bool | waitForReleasingResources (unsigned long mSleep, unsigned long maxCount) const |
| Wait for releasing of dbThread shared pointer from other threads and terminating all created service threads. | |
| ~OSMScoutQt () override | |
Static Public Member Functions | |
| static void | FreeInstance () |
| static OSMScoutQt & | GetInstance () |
| static OSMScoutQtBuilder | NewInstance () |
| static void | RegisterQmlTypes (const char *uri="net.sf.libosmscout.map", int versionMajor=1, int versionMinor=0) |
Friends | |
| class | OSMScoutQtBuilder |
Singleton that provides access to high level modules of OSMScout library.
On application start should be registered Qt types by static method RegisterQmlTypes(). OSMScoutQt instance may be created by NewInstance() and accessed by GetInstance() then. To free resources should be called FreeInstance() before program exits.
Example:
|
override |
|
static |
References osmscout::log, and osmscout::osmScoutInstance.
Referenced by OSMScoutQtBuilder.
| QString osmscout::OSMScoutQt::GetCacheLocation | ( | ) | const |
Referenced by osmscout::TileLoaderThread::init(), and OSMScoutQtBuilder.
| DBThreadRef osmscout::OSMScoutQt::GetDBThread | ( | ) | const |
Referenced by osmscout::MapWidget::firstStylesheetErrorColumn(), osmscout::MapWidget::firstStylesheetErrorDescription(), osmscout::MapWidget::firstStylesheetErrorLine(), osmscout::MapWidget::GetStylesheetFilename(), osmscout::MapWidget::isDatabaseLoaded(), osmscout::MapWidget::isInDatabaseBoundingBox(), osmscout::MapWidget::MapWidget(), OSMScoutQtBuilder, osmscout::MapWidget::recenter(), osmscout::MapWidget::reloadStyle(), osmscout::MapWidget::reloadTmpStyle(), osmscout::LookupModule::requestLocationDescription(), osmscout::LookupModule::requestRegionLookup(), osmscout::SearchModule::SearchForLocations(), osmscout::MapWidget::stylesheetHasErrors(), osmscout::TiledMapOverlay::TiledMapOverlay(), and osmscout::MapWidget::toggleDaylight().
| QString osmscout::OSMScoutQt::GetEspeakDataDir | ( | ) | const |
Referenced by OSMScoutQtBuilder.
| QString osmscout::OSMScoutQt::GetIconDirectory | ( | ) | const |
Referenced by OSMScoutQtBuilder.
|
static |
References osmscout::osmScoutInstance.
Referenced by osmscout::AvailableMapsModel::AvailableMapsModel(), osmscout::AvailableVoicesModel::AvailableVoicesModel(), osmscout::OsmTileDownloader::download(), osmscout::ElevationChartWidget::ElevationChartWidget(), osmscout::MapWidget::firstStylesheetErrorColumn(), osmscout::MapWidget::firstStylesheetErrorDescription(), osmscout::MapWidget::firstStylesheetErrorLine(), osmscout::MapDownloadsModel::getLookupDirectories(), osmscout::MapStyleModel::getStyle(), osmscout::MapWidget::GetStylesheetFilename(), osmscout::TileLoaderThread::init(), osmscout::InstalledMapsModel::InstalledMapsModel(), osmscout::InstalledVoicesModel::InstalledVoicesModel(), osmscout::MapWidget::isDatabaseLoaded(), osmscout::MapWidget::isInDatabaseBoundingBox(), osmscout::AvailableVoicesModel::listDownloaded(), osmscout::LocationInfoModel::LocationInfoModel(), osmscout::LocationListModel::LocationListModel(), osmscout::MapDownloadsModel::MapDownloadsModel(), osmscout::MapObjectInfoModel::MapObjectInfoModel(), osmscout::MapStyleModel::MapStyleModel(), osmscout::MapWidget::MapWidget(), osmscout::NavigationModel::NavigationModel(), osmscout::NearPOIModel::NearPOIModel(), osmscout::OnlineTileProviderModel::OnlineTileProviderModel(), OSMScoutQtBuilder, osmscout::InstalledVoicesModel::playTTSSample(), osmscout::QmlSettings::QmlSettings(), osmscout::MapWidget::recenter(), osmscout::AvailableMapsModel::reload(), osmscout::AvailableVoicesModel::reload(), osmscout::VoiceManager::reload(), osmscout::MapWidget::reloadStyle(), osmscout::MapWidget::reloadTmpStyle(), osmscout::LookupModule::requestLocationDescription(), osmscout::LookupModule::requestRegionLookup(), osmscout::RoutingListModel::RoutingListModel(), osmscout::SearchModule::SearchForLocations(), osmscout::StyleFlagsModel::setFlag(), osmscout::MapWidget::setInteractiveIcons(), osmscout::MapStyleModel::setStyle(), osmscout::FileDownloader::startDownload(), osmscout::StyleFlagsModel::StyleFlagsModel(), osmscout::MapWidget::stylesheetHasErrors(), osmscout::MapDownloadsModel::suggestedDirectory(), osmscout::TiledMapOverlay::TiledMapOverlay(), osmscout::MapWidget::toggleDaylight(), and osmscout::VoiceManager::VoiceManager().
| MapDownloaderRef osmscout::OSMScoutQt::GetMapDownloader | ( | ) |
Referenced by osmscout::MapDownloadsModel::MapDownloadsModel(), and OSMScoutQtBuilder.
| MapManagerRef osmscout::OSMScoutQt::GetMapManager | ( | ) | const |
| QString osmscout::OSMScoutQt::GetNavigationTranslationDir | ( | ) | const |
Referenced by osmscout::AvailableVoicesModel::listDownloaded(), and OSMScoutQtBuilder.
| size_t osmscout::OSMScoutQt::GetOnlineTileCacheSize | ( | ) | const |
Referenced by OSMScoutQtBuilder.
| SettingsRef osmscout::OSMScoutQt::GetSettings | ( | ) | const |
Referenced by osmscout::AvailableMapsModel::AvailableMapsModel(), osmscout::AvailableVoicesModel::AvailableVoicesModel(), osmscout::ElevationChartWidget::ElevationChartWidget(), osmscout::TileLoaderThread::init(), osmscout::InstalledVoicesModel::InstalledVoicesModel(), osmscout::LocationInfoModel::LocationInfoModel(), osmscout::LocationListModel::LocationListModel(), osmscout::MapObjectInfoModel::MapObjectInfoModel(), osmscout::MapStyleModel::MapStyleModel(), osmscout::MapWidget::MapWidget(), osmscout::NearPOIModel::NearPOIModel(), OSMScoutQtBuilder, osmscout::QmlSettings::QmlSettings(), osmscout::VoiceManager::reload(), osmscout::StyleFlagsModel::setFlag(), osmscout::MapStyleModel::setStyle(), and osmscout::VoiceManager::VoiceManager().
| QString osmscout::OSMScoutQt::GetUserAgent | ( | ) | const |
Referenced by OSMScoutQtBuilder.
| VoiceManagerRef osmscout::OSMScoutQt::GetVoiceManager | ( | ) |
| ElevationModule * osmscout::OSMScoutQt::MakeElevationModule | ( | ) |
References makeThread().
Referenced by osmscout::ElevationChartWidget::ElevationChartWidget(), and OSMScoutQtBuilder.
| IconLookup * osmscout::OSMScoutQt::MakeIconLookup | ( | ) |
References makeThread().
Referenced by OSMScoutQtBuilder, and osmscout::MapWidget::setInteractiveIcons().
| LookupModule * osmscout::OSMScoutQt::MakeLookupModule | ( | ) |
| MapRenderer * osmscout::OSMScoutQt::MakeMapRenderer | ( | RenderingType | type | ) |
References makeThread(), and osmscout::TiledRendering.
Referenced by OSMScoutQtBuilder.
| NavigationModule * osmscout::OSMScoutQt::MakeNavigation | ( | ) |
References makeThread().
Referenced by osmscout::NavigationModel::NavigationModel(), and OSMScoutQtBuilder.
| POILookupModule * osmscout::OSMScoutQt::MakePOILookupModule | ( | ) |
Referenced by osmscout::NearPOIModel::NearPOIModel(), and OSMScoutQtBuilder.
| Router * osmscout::OSMScoutQt::MakeRouter | ( | ) |
References makeThread().
Referenced by OSMScoutQtBuilder, and osmscout::RoutingListModel::RoutingListModel().
| SearchModule * osmscout::OSMScoutQt::MakeSearchModule | ( | ) |
References MakeLookupModule(), and makeThread().
Referenced by osmscout::LocationListModel::LocationListModel(), and OSMScoutQtBuilder.
| StyleModule * osmscout::OSMScoutQt::MakeStyleModule | ( | ) |
References makeThread().
Referenced by osmscout::MapStyleModel::MapStyleModel(), OSMScoutQtBuilder, and osmscout::StyleFlagsModel::StyleFlagsModel().
| QThread * osmscout::OSMScoutQt::makeThread | ( | QString | name | ) |
Create new background thread with given name.
Usage:
QThread *t=OSMScoutQt::GetInstance().makeThread("OverlayTileLoader"); Service *service=new Service(t); service->moveToThread(thread); connect(thread, SIGNAL(started()), service, SLOT(init())); thread->start();
Service should stop thread in own destructor: QThread::quit()
| name |
References threadFinished().
Referenced by MakeElevationModule(), MakeIconLookup(), MakeLookupModule(), MakeMapRenderer(), MakeNavigation(), MakeRouter(), MakeSearchModule(), MakeStyleModule(), OSMScoutQtBuilder, and osmscout::TiledMapOverlay::TiledMapOverlay().
|
static |
References OSMScoutQtBuilder.
Referenced by OSMScoutQtBuilder.
|
static |
Referenced by OSMScoutQtBuilder.
|
slot |
Referenced by makeThread(), and OSMScoutQtBuilder.
| bool osmscout::OSMScoutQt::waitForReleasingResources | ( | unsigned long | mSleep, |
| unsigned long | maxCount ) const |
Wait for releasing of dbThread shared pointer from other threads and terminating all created service threads.
This waiting has configurable timeout, up to [mSleep * maxCount] milliseconds.
Note that on success, this method don't guarantee that dbThread is not used from another thread, see std::shared_ptr::use_count() documentation.
| mSleep | wait period between checks (in milliseconds) |
| maxCount | maximul count |
Referenced by OSMScoutQtBuilder.
|
friend |
References FreeInstance(), GetCacheLocation(), GetDBThread(), GetEspeakDataDir(), GetIconDirectory(), GetInstance(), GetMapDownloader(), GetMapManager(), GetNavigationTranslationDir(), GetOnlineTileCacheSize(), GetSettings(), GetUserAgent(), GetVoiceManager(), MakeElevationModule(), MakeIconLookup(), MakeLookupModule(), MakeMapRenderer(), MakeNavigation(), MakePOILookupModule(), MakeRouter(), MakeSearchModule(), MakeStyleModule(), makeThread(), NewInstance(), OSMScoutQtBuilder, RegisterQmlTypes(), threadFinished(), and waitForReleasingResources().
Referenced by NewInstance(), and OSMScoutQtBuilder.