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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#pragma once
#include "geometry/rect2d.hpp"
#include "base/base.hpp"
struct FeatureID;
class StringUtf8Multilang;
namespace feature
{
class TypesHolder;
class RegionData;
/// Get viewport scale to show given feature. Used in search.
int GetFeatureViewportScale(TypesHolder const & types);
/// When the language of the device is equal to one of the languages of the MWM
/// (or similar to device languages) only single name scheme is used. See GetReadableName method.
/// Primary name using priority:
/// - device language name;
/// - similar to device languages if provided;
/// - international name;
/// - english name;
/// - transliterated name (if allowed).
/// Secondary name using priority:
/// - default name;
/// - international name;
/// - country language name;
/// - english name.
/// In case when primary name is empty it will be propagated from secondary and secondary will be
/// cleared. In case when primary name contains secondary name then secondary will be cleared.
void GetPreferredNames(RegionData const & regionData, StringUtf8Multilang const & src,
int8_t const deviceLang, bool allowTranslit, string & primary, string & secondary);
/// When MWM contains user's language (or similar to device languages if provided),
/// the priority is the following:
/// - device language name;
/// - default name;
/// - similar to device languages if provided;
/// - international name;
/// - english name;
/// - transliterated name (if allowed);
/// - country language name.
/// When MWM does not contain user's language (or similar to device languages),
/// the priority is the following:
/// - device language name;
/// - similar to device languages if provided;
/// - international name;
/// - english name;
/// - transliterated name (if allowed);
/// - default name;
/// - country language name.
void GetReadableName(RegionData const & regionData, StringUtf8Multilang const & src,
int8_t const deviceLang, bool allowTranslit, string & out);
/// Returns language id as return result and name for search on booking in the @name parameter,
/// the priority is the following:
/// - default name;
/// - country language name;
/// - english name.
int8_t GetNameForSearchOnBooking(RegionData const & regionData, StringUtf8Multilang const & src,
string & name);
} // namespace feature
|