Welcome to mirror list, hosted at ThFree Co, Russian Federation.

turns_tts_text.hpp « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a160d27a057575bf1ecb00d8fe8c11b83fb3621d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once

#include "platform/get_text_by_id.hpp"

#include "std/string.hpp"
#include "std/unique_ptr.hpp"


namespace routing
{
namespace turns
{
namespace sound
{
struct Notification;

/// GetTtsText is responsible for generating text message for TTS in a specified locale
/// by notification. To get this message use operator().
/// If the message is not available for specified locale GetTtsText tries to find it in
/// English locale.
class GetTtsText
{
public:
  string operator()(Notification const & notification) const;
  /// TODO(vbykoianko) Check if locale is available. If not use default (en) locale.
  void SetLocale(string const & locale);
  inline string GetLocale() const { return m_locale; }
  /// SetLocaleWithJson is used for writing unit tests only.
  void SetLocaleWithJson(string const & jsonBuffer);

private:
  string GetTextById(string const & textId) const;

  unique_ptr<platform::GetTextById> m_getCurLang;
  string m_locale;
};

/// Generates text message id about the distance of the notification. For example: In 300 meters.
string GetDistanceTextId(Notification const & notification);
/// Generates text message id about the direction of the notification. For example: Make a right
/// turn.
string GetDirectionTextId(Notification const & notification);
}  // namespace sound
}  // namespace turns
}  // namespace routing