This class a helper for natural navigation management. More...


Classes | |
| struct | VgTranslatedInstruction |
| This structure holds the result of a instruciton translation. More... | |
Public Types | |
| enum | StringType { eStringFor, eStringThen, eStringAnd, eStringNear, eStringUsing, eStringCount } |
This enum is used as an identifier for localized versions of navigation texts. More... | |
Public Member Functions | |
| VgMyNavigationHelper (VgNavigationModule::VgINavigationModule *pNavModule) | |
| Class constructor. | |
| virtual | ~VgMyNavigationHelper () |
| Class destructor. | |
| void | createNavigation (VgNavigationModule::VgINavigationRequestParameters &pParameters) |
| Implementation of interface : VgMyNavigationCreator. | |
Static Public Member Functions | |
| static void | translateInstruction (VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &pInstruction, VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &pNavigation, VgTranslatedInstruction &pTranslated, VgMapModule::VgIMapModule &pMapModule, int pLang=0) |
| This static method is used to translate a navigation instruction into a detailed message, along with other instruction-related data. | |
| static int | getLangId (const std::string &pLangSr) |
| Thi static method is used to get the integer lang id corresponding to a named language. | |
Static Protected Member Functions | |
| static std::string | timeToText (float pTimeInMinutes, int pLang) |
| Utility static method to generate a natural language "fuzzy" string for instruction duration. | |
| static void | replaceTokens (std::string &pStringWithTokens, VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &pInstructionCurrent, VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &pInstructionNext) |
| Takes a language string with tokens, then replaces those tokens with contextual data. | |
Protected Attributes | |
| VgNavigationModule::VgINavigationModule * | mNavigationModule |
| The navigationModule this helper is built on. | |
Static Protected Attributes | |
| static const std::string | cLanguageStrings [2] |
| The language identifiers. | |
| static const size_t | cNumLanguages = sizeof(cLanguageStrings)/sizeof(std::string) |
| The number of supported languages. | |
| static const std::string | cActionStringTable [cNumLanguages][VgNavigationModule::eVgManeuverTypeMax] |
| Action string table for localization. | |
| static const std::string | cNextActionStringTable [cNumLanguages][VgNavigationModule::eVgManeuverTypeMax] |
| Next action string table for localization (fr/en) | |
| static const std::string | cTimeStringTable [cNumLanguages][3] |
| Time string table for localization (fr/en) | |
| static const std::string | cStringTable [cNumLanguages][eStringCount] |
| Link words string table for localization (fr/en) | |
This class a helper for natural navigation management.
This enum is used as an identifier for localized versions of navigation texts.
| VgMyNavigationHelper::VgMyNavigationHelper | ( | VgNavigationModule::VgINavigationModule * | pNavModule ) |
Class constructor.
| pNavModule | The valid navigation module that will be used. |
| virtual VgMyNavigationHelper::~VgMyNavigationHelper | ( | ) | [virtual] |
Class destructor.
| void VgMyNavigationHelper::createNavigation | ( | VgNavigationModule::VgINavigationRequestParameters & | pParameters ) | [virtual] |
Implementation of interface : VgMyNavigationCreator.
Implements VgMyNavigationCreator.
| static int VgMyNavigationHelper::getLangId | ( | const std::string & | pLangSr ) | [static] |
Thi static method is used to get the integer lang id corresponding to a named language.
| pLangStr | The string identifying the language. Possible values (as of today) are "fr" or "en" or "fr_XX" or "en_XX" |
| static void VgMyNavigationHelper::replaceTokens | ( | std::string & | pStringWithTokens, |
| VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const & | pInstructionCurrent, | ||
| VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const & | pInstructionNext | ||
| ) | [static, protected] |
Takes a language string with tokens, then replaces those tokens with contextual data.
| pStringWithTokens | The language string containing the tokens. |
| pInstructionCurrent | The current isntruction. |
| pInstructionNext | The next instruction. |
| static std::string VgMyNavigationHelper::timeToText | ( | float | pTimeInMinutes, |
| int | pLang | ||
| ) | [static, protected] |
Utility static method to generate a natural language "fuzzy" string for instruction duration.
| static void VgMyNavigationHelper::translateInstruction | ( | VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const & | pInstruction, |
| VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const & | pNavigation, | ||
| VgTranslatedInstruction & | pTranslated, | ||
| VgMapModule::VgIMapModule & | pMapModule, | ||
| int | pLang = 0 |
||
| ) | [static] |
This static method is used to translate a navigation instruction into a detailed message, along with other instruction-related data.
| pInstruction | The instruction to translate. |
| pNavigation | The navigation object the instruction comes from. |
| pTranslated | A reference to the structure to feed with details. |
| pMapModule | The application's VgMapModule (needed for near places and floor heights). |
| pLang | The index of the language to use (see getLangId). |
const std::string VgMyNavigationHelper::cActionStringTable[cNumLanguages][VgNavigationModule::eVgManeuverTypeMax] [static, protected] |
Action string table for localization.
const std::string VgMyNavigationHelper::cLanguageStrings[2] [static, protected] |
The language identifiers.
const std::string VgMyNavigationHelper::cNextActionStringTable[cNumLanguages][VgNavigationModule::eVgManeuverTypeMax] [static, protected] |
Next action string table for localization (fr/en)
const size_t VgMyNavigationHelper::cNumLanguages = sizeof(cLanguageStrings)/sizeof(std::string) [static, protected] |
The number of supported languages.
const std::string VgMyNavigationHelper::cStringTable[cNumLanguages][eStringCount] [static, protected] |
Link words string table for localization (fr/en)
const std::string VgMyNavigationHelper::cTimeStringTable[cNumLanguages][3] [static, protected] |
Time string table for localization (fr/en)
VgNavigationModule::VgINavigationModule* VgMyNavigationHelper::mNavigationModule [protected] |
The navigationModule this helper is built on.