Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::SdkSettings Class Reference

SdkSettings object. More...

Inheritance diagram for gem::SdkSettings:
Collaboration diagram for gem::SdkSettings:

Public Member Functions

 SdkSettings (const SdkSettings &)=delete
 SdkSettings (SdkSettings &&)=default
 Default move constructor noexcept is deduced.
SdkSettings & operator= (const SdkSettings &)=delete
SdkSettings & operator= (SdkSettings &&sdksettings)=default
 Default move assignment noexcept is deduced.
EUnitSystem getUnitSystem () const noexcept
 Get the unit system used by the SDK.
SdkSettings & setUnitSystem (EUnitSystem unitSystem) noexcept
 Set the unit system to be used by the SDK.
SdkSettings & setDecimalSeparator (char16_t sep) noexcept
 Set a custom decimal separator.
char16_t getDecimalSeparator () const noexcept
 Get the current decimal separator.
SdkSettings & setDigitGroupSeparator (char16_t sep) noexcept
 Set a custom digit group separator.
char16_t getDigitGroupSeparator () const noexcept
 Get the current digit group separator.
bool getAllowConnection () const noexcept
 Check if the connection is allowed or not.
SdkSettings & setAllowConnection (bool allow, OffboardListener listener) noexcept
 Allow/deny internet connection.
SdkSettings & setAllowOffboardServiceOnExtraChargedNetwork (EServiceGroupType serviceType, bool allow) noexcept
 Allow the given service type on the extra charged network type By default all are allowed.
bool getAllowOffboardServiceOnExtraChargedNetwork (EServiceGroupType serviceType) const noexcept
 Check if the given service type is allowed on the extra charged network.
int getOnlineServiceRestriction (EServiceGroupType svc) const noexcept
 Get online service restrictions.
int getTopicNotificationsServiceRestriction () const noexcept
 Get topic notifications service restrictions.
TransferStatisticsRef getTransferStatistics (EServiceGroupType serviceType)
 Get transfer statistics using extra charge network, for the given service type.
Language getLanguage () const noexcept
 Get the API language.
Language getBestLanguageMatch (const String &languageCode, const String &regionCode=String(), const String &scriptCode=String(), int variant=0) const noexcept
 Find the best language match for the provided input(language code, region code, variant and script code).
LanguageList getLanguageList () const noexcept
 Get the API language list.
SdkSettings & setLanguage (const Language &language) noexcept
 Set the API language.
SdkSettings & setLanguageByName (const String &languageName) noexcept
 Set the API language.
SdkSettings & setLanguage (const String &languageCode, const String &regionCode=String(), const String &scriptCode=String(), int variant=0) noexcept
 Set the API language based on language ISO.
EMapLanguage getMapLanguage () const noexcept
 Get the current setting for the map language selection.
SdkSettings & setMapLanguage (EMapLanguage mapLanguage) noexcept
 Set the map language selection method.
Voice getVoice () const noexcept
 Get the voice.
VoiceList getBestVoiceMatch (const String &languageCode, const String &regionCode) const noexcept
 Find the best voice match for the provided input (language code, region code).
SdkSettings & setNetworkProvider (NetworkProvider networkProvider) noexcept
 Set the network service provider.
SdkSettings & setTilesMaxSpace (int maxSpace) noexcept
 Set maximum cache size/storage space to use for downloaded tiles in kilobytes (Kb).
int getTilesMaxSpace () const noexcept
 Get maximum storage space/cache size to use for downloaded tiles in kilobytes (Kb).
SdkSettings & setApplicationName (const String &name) noexcept
 Set application name.
const StringRef getApplicationName () const noexcept
 Get application name.
SdkSettings & setApplicationVersion (int version, int subVersion, int revision) noexcept
 Set application version.
std::tuple< int, int, int > getApplicationVersion () const noexcept
 Get application version 0 -> version, 1 -> subVersion, 2 -> revision.
SdkSettings & setDeviceName (const String &deviceName) noexcept
 Set the device name.
const StringRef getDeviceName () const noexcept
 Get the device name.
SdkSettings & setDeviceModel (const String &deviceModel) noexcept
 Set the device model.
const StringRef getDeviceModel () const noexcept
 Get the device model.
SdkSettings & setVoiceByPath (const String &filePath, const Language &lang=Language()) noexcept
 Set the current voice by specifying the path to the voice file.
SdkSettings & setVoice (const Voice &voice, const Language &lang=Language()) noexcept
 Set the current voice.
NetworkProvider getNetworkProvider () noexcept
 Get the network service provider.
SdkSettings & setAppAuthorization (const String &token) noexcept
 Set the application authorization API token.
String getAppAuthorization () const noexcept
 Get the application authorization API token.
void verifyAppAuthorization (const String &token, ProgressListener listener) const noexcept
 Verify an app token.
int getStripeDonateSession (String &session, double amount, const String &currency, ProgressListener listener, bool dryRun=false) const noexcept
 Get Stripe secret for a donate session creation.
int getStripePublicKey (String &session, ProgressListener listener, bool dryRun=false) const noexcept
 Get Stripe public key.
ETheme getTheme () const noexcept
 Get the images & texts render theme.
ETheme getActualTheme () const noexcept
 Get the actual images & texts render theme.
void setTheme (ETheme sel) noexcept
 Set images & texts render theme.

Detailed Description

SdkSettings object.

Manages the settings regarding units, localization, network connection, tile space policy.

Implements share read/write Api object over ISdkSettings.

This behaves like a singleton, i.e. all instances are shared behind the same API interface

Member Function Documentation

◆ getActualTheme()

ETheme gem::SdkSettings::getActualTheme ( ) const
inlinenoexcept

Get the actual images & texts render theme.

This will return the actual used theme ( THEME_Dark / THEME_Light ) when SDK theme was set to THEME_Automatic

Returns
The actual render theme

◆ getAllowConnection()

bool gem::SdkSettings::getAllowConnection ( ) const
inlinenoexcept

Check if the connection is allowed or not.

Returns
True if the connection is allowed, false otherwise.

◆ getAllowOffboardServiceOnExtraChargedNetwork()

bool gem::SdkSettings::getAllowOffboardServiceOnExtraChargedNetwork ( EServiceGroupType serviceType) const
inlinenoexcept

Check if the given service type is allowed on the extra charged network.

Parameters
serviceTypeThe service type
Returns
True if the service is allowed on the extra charged network, false otherwise

◆ getAppAuthorization()

String gem::SdkSettings::getAppAuthorization ( ) const
inlinenoexcept

Get the application authorization API token.

Return empty if no valid authorization API token is used

Returns
Token.

◆ getApplicationName()

const StringRef gem::SdkSettings::getApplicationName ( ) const
inlinenoexcept

Get application name.

Returns
The application name

◆ getApplicationVersion()

std::tuple< int, int, int > gem::SdkSettings::getApplicationVersion ( ) const
inlinenoexcept

Get application version 0 -> version, 1 -> subVersion, 2 -> revision.

Returns
The application version

◆ getBestLanguageMatch()

Language gem::SdkSettings::getBestLanguageMatch ( const String & languageCode,
const String & regionCode = String(),
const String & scriptCode = String(),
int variant = 0 ) const
inlinenoexcept

Find the best language match for the provided input(language code, region code, variant and script code).

Parameters
[in]languageCodeISO 639-3 three-letter language code.
[in]regionCodeISO 3166-1_3 three-letter region code, can be empty
[in]scriptCodeISO 15924 four-letter script code, can be empty
[in]variantscript variant(
See also
TScriptVariant).
Returns
The best language match.

◆ getBestVoiceMatch()

VoiceList gem::SdkSettings::getBestVoiceMatch ( const String & languageCode,
const String & regionCode ) const
inlinenoexcept

Find the best voice match for the provided input (language code, region code).

Parameters
[in]languageCodeISO 639-3 three letters language code.
[in]regionCodeISO 3166-1 alpha 3 region code, can be empty
Returns
The best voice match as list.

◆ getDecimalSeparator()

char16_t gem::SdkSettings::getDecimalSeparator ( ) const
inlinenoexcept

Get the current decimal separator.

Returns
The decimal separator

◆ getDeviceModel()

const StringRef gem::SdkSettings::getDeviceModel ( ) const
inlinenoexcept

Get the device model.

Returns
The device model.

◆ getDeviceName()

const StringRef gem::SdkSettings::getDeviceName ( ) const
inlinenoexcept

Get the device name.

Returns
The device name.

◆ getDigitGroupSeparator()

char16_t gem::SdkSettings::getDigitGroupSeparator ( ) const
inlinenoexcept

Get the current digit group separator.

Returns
The digit group separator

◆ getLanguage()

Language gem::SdkSettings::getLanguage ( ) const
inlinenoexcept

Get the API language.

Returns
The language object.

◆ getLanguageList()

LanguageList gem::SdkSettings::getLanguageList ( ) const
inlinenoexcept

Get the API language list.

Returns
The language list.

◆ getMapLanguage()

EMapLanguage gem::SdkSettings::getMapLanguage ( ) const
inlinenoexcept

Get the current setting for the map language selection.

Returns
The map language selection method.

◆ getNetworkProvider()

NetworkProvider gem::SdkSettings::getNetworkProvider ( )
inlinenoexcept

Get the network service provider.

The network service provider interface enables the API client to customize the network access. If this is set then the SDK will use it for network access.

Returns
The network service provider.

◆ getOnlineServiceRestriction()

int gem::SdkSettings::getOnlineServiceRestriction ( EServiceGroupType svc) const
inlinenoexcept

Get online service restrictions.

Parameters
svcThe service group id
Returns
Service online restrictions as a bitwise OR of EOnlineRestrictions. Returns 0 if there are no online restriction

◆ getStripeDonateSession()

int gem::SdkSettings::getStripeDonateSession ( String & session,
double amount,
const String & currency,
ProgressListener listener,
bool dryRun = false ) const
inlinenoexcept

Get Stripe secret for a donate session creation.

Parameters
[out]sessionString where to return the Stripe pay session secret
[in]amountAmount of currency sent. If a too small value is provided, the server will return error:;KInvalidValue
[in]currencyThe currency of the amount value, e.g. "eur" for Euro
[in]listenerOperation progress listener
[in]dryRunEnables a dry run call for testing

Get stripe secret for donate operation. The secret is

Returns
The Error code

◆ getStripePublicKey()

int gem::SdkSettings::getStripePublicKey ( String & session,
ProgressListener listener,
bool dryRun = false ) const
inlinenoexcept

Get Stripe public key.

Parameters
[in]listenerOperation progress listener
[out]sessionIf the function succeeds, the Stripe session secret. If fails, the error code
[in]dryRunEnables a dry run call for testing

Get public key for stripe initialization

Returns
The Error code

◆ getTheme()

ETheme gem::SdkSettings::getTheme ( ) const
inlinenoexcept

Get the images & texts render theme.

Default is THEME_Automatic

Returns
The selected theme

◆ getTilesMaxSpace()

int gem::SdkSettings::getTilesMaxSpace ( ) const
inlinenoexcept

Get maximum storage space/cache size to use for downloaded tiles in kilobytes (Kb).

Returns
Size in Kb.

◆ getTopicNotificationsServiceRestriction()

int gem::SdkSettings::getTopicNotificationsServiceRestriction ( ) const
inlinenoexcept

Get topic notifications service restrictions.

Returns
Service restrictions as a bitwise OR of EOnlineRestrictions. Returns 0 if there are no restrictions ( aka online )

◆ getTransferStatistics()

TransferStatisticsRef gem::SdkSettings::getTransferStatistics ( EServiceGroupType serviceType)
inline

Get transfer statistics using extra charge network, for the given service type.

Parameters
serviceTypeThe service type
Returns
Transfer statistics object

◆ getUnitSystem()

EUnitSystem gem::SdkSettings::getUnitSystem ( ) const
inlinenoexcept

Get the unit system used by the SDK.

Returns
The unit system.

◆ getVoice()

Voice gem::SdkSettings::getVoice ( ) const
inlinenoexcept

Get the voice.

Returns
The voice object.

◆ operator=()

SdkSettings & gem::SdkSettings::operator= ( SdkSettings && sdksettings)
default

Default move assignment noexcept is deduced.

Returns
self
Parameters
sdksettingsSdkSettings object to move

◆ setAllowConnection()

SdkSettings & gem::SdkSettings::setAllowConnection ( bool allow,
OffboardListener listener )
inlinenoexcept

Allow/deny internet connection.

Parameters
allowAllow/deny value.
listenerOffboard listener that will get notifications regarding connection changes.
Returns
A reference to the object

◆ setAllowOffboardServiceOnExtraChargedNetwork()

SdkSettings & gem::SdkSettings::setAllowOffboardServiceOnExtraChargedNetwork ( EServiceGroupType serviceType,
bool allow )
inlinenoexcept

Allow the given service type on the extra charged network type By default all are allowed.

Parameters
serviceTypeThe service type
allowAllow/deny value
Returns
A reference to the object

◆ setAppAuthorization()

SdkSettings & gem::SdkSettings::setAppAuthorization ( const String & token)
inlinenoexcept

Set the application authorization API token.

Deprecated
Set the application activation token on SDK initialization instead.

The HTTP services are available through this API token

Parameters
tokenToken.
Returns
A reference to the object API error codes:
KInvalidInput if token format is invalid ( i.e. not a jwt token issued by Magic Lane ) KExist if token is already set by the auto-activation mechanism, where applicable.

◆ setApplicationName()

SdkSettings & gem::SdkSettings::setApplicationName ( const String & name)
inlinenoexcept

Set application name.

Parameters
[in]nameThe application name
Returns
A reference to the object

◆ setApplicationVersion()

SdkSettings & gem::SdkSettings::setApplicationVersion ( int version,
int subVersion,
int revision )
inlinenoexcept

Set application version.

Parameters
[in]versionThe application version
[in]subVersionThe application sub version
[in]revisionThe application revision
Returns
A reference to the object

◆ setDecimalSeparator()

SdkSettings & gem::SdkSettings::setDecimalSeparator ( char16_t sep)
inlinenoexcept

Set a custom decimal separator.

Parameters
sepThe decimal separator
Returns
A reference to the object

◆ setDeviceModel()

SdkSettings & gem::SdkSettings::setDeviceModel ( const String & deviceModel)
inlinenoexcept

Set the device model.

Parameters
[in]deviceModelThe device model.
Returns
A reference to the object

◆ setDeviceName()

SdkSettings & gem::SdkSettings::setDeviceName ( const String & deviceName)
inlinenoexcept

Set the device name.

Parameters
[in]deviceNameThe device name.
Returns
A reference to the object

◆ setDigitGroupSeparator()

SdkSettings & gem::SdkSettings::setDigitGroupSeparator ( char16_t sep)
inlinenoexcept

Set a custom digit group separator.

Parameters
sepThe digit group separator
Returns
A reference to the object

◆ setLanguage() [1/2]

SdkSettings & gem::SdkSettings::setLanguage ( const Language & language)
inlinenoexcept

Set the API language.

Parameters
[in]languageThe selected language from the SDK list
Returns
A reference to the object

◆ setLanguage() [2/2]

SdkSettings & gem::SdkSettings::setLanguage ( const String & languageCode,
const String & regionCode = String(),
const String & scriptCode = String(),
int variant = 0 )
inlinenoexcept

Set the API language based on language ISO.

Parameters
[in]languageCodeISO 639-3 three-letter language code.
[in]regionCodeISO 3166-1_3 three-letter region code, can be empty
[in]scriptCodeISO 15924 four-letter script code, can be empty
[in]variantscript variant(
See also
TScriptVariant).
Returns
A reference to the object

◆ setLanguageByName()

SdkSettings & gem::SdkSettings::setLanguageByName ( const String & languageName)
inlinenoexcept

Set the API language.

Parameters
[in]languageNameThe selected language name, see Language::getName for details
Returns
A reference to the object

◆ setMapLanguage()

SdkSettings & gem::SdkSettings::setMapLanguage ( EMapLanguage mapLanguage)
inlinenoexcept

Set the map language selection method.

Parameters
[in]mapLanguageLanguage type
Returns
A reference to the object

◆ setNetworkProvider()

SdkSettings & gem::SdkSettings::setNetworkProvider ( NetworkProvider networkProvider)
inlinenoexcept

Set the network service provider.

Parameters
networkProviderNetwork provider.

The network service provider interface enables the API client to customize the network access. If this is set then the SDK will use it for network access.

Returns
A reference to the object

◆ setTheme()

void gem::SdkSettings::setTheme ( ETheme sel)
inlinenoexcept

Set images & texts render theme.

Parameters
[in]selThe selected theme

◆ setTilesMaxSpace()

SdkSettings & gem::SdkSettings::setTilesMaxSpace ( int maxSpace)
inlinenoexcept

Set maximum cache size/storage space to use for downloaded tiles in kilobytes (Kb).

Parameters
maxSpaceSize in Kb. If maxSpace is 0 there are no restriction for tiles space
Returns
A reference to the object

◆ setUnitSystem()

SdkSettings & gem::SdkSettings::setUnitSystem ( EUnitSystem unitSystem)
inlinenoexcept

Set the unit system to be used by the SDK.

This setting will affect the text of the route / navigation instructions and the voice instructions.

Parameters
unitSystemThe unit system to be used.
Returns
A reference to the object

◆ setVoice()

SdkSettings & gem::SdkSettings::setVoice ( const Voice & voice,
const Language & lang = Language() )
inlinenoexcept

Set the current voice.

Parameters
[in]voiceThe voice object.
[in]langThe desired voice language. Used only in the case of TTS voice for accurate match in the underlying OS support
Returns
A reference to the object

◆ setVoiceByPath()

SdkSettings & gem::SdkSettings::setVoiceByPath ( const String & filePath,
const Language & lang = Language() )
inlinenoexcept

Set the current voice by specifying the path to the voice file.

The voice can be chosen from a VoiceList provided by getBestVoiceMatch method.

Parameters
[in]filePathThe voice file path. See Voice::getFileName for details.
[in]langThe desired voice language. Used only in the case of TTS voice for accurate match in the underlying OS support
Returns
A reference to the object

◆ verifyAppAuthorization()

void gem::SdkSettings::verifyAppAuthorization ( const String & token,
ProgressListener listener ) const
inlinenoexcept

Verify an app token.

Parameters
[in]tokenToken to be verified
[in]listenerOperation progress listener

Error codes come through progress listener on notifyComplete KInvalidInput if token format is invalid ( i.e. not a jwt token ) KExpired if token is expired KAccessDenied if token is blacklisted ( i.e. token jti or aud is blacklisted ) All other error codes are related to the validation process and should not be related to token validity ( e.g. KConnectionRequired, etc )