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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArsentiy Milchakov <a.milchakov@corp.mail.ru>2016-07-15 20:16:41 +0300
committerArsentiy Milchakov <a.milchakov@corp.mail.ru>2016-07-19 14:43:41 +0300
commitfe4ccf09c2c21d9b1499429f5531b765d9c928e2 (patch)
tree96aab836723ffd13cf44e4adf954c63a02513c26 /indexer/editable_map_object.hpp
parent751e6ea7a91f0ba8e9248206a61721137504946c (diff)
Direct editing of default name is locked, editing of multilingual names is allowed, changes for android are included
Diffstat (limited to 'indexer/editable_map_object.hpp')
-rw-r--r--indexer/editable_map_object.hpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/indexer/editable_map_object.hpp b/indexer/editable_map_object.hpp
index 365b23d20b..e89aa543ad 100644
--- a/indexer/editable_map_object.hpp
+++ b/indexer/editable_map_object.hpp
@@ -46,6 +46,18 @@ struct LocalizedName
string const m_name;
};
+// Class which contains vector of localized names with following priority:
+// 1. Names for Mwm languages
+// 2. User`s language name
+// 3. International name
+// 4. Other names
+// and mandatoryNamesCount - count of names which should be always shown.
+struct NamesDataSource
+{
+ vector<LocalizedName> names;
+ size_t mandatoryNamesCount = 0;
+};
+
struct LocalizedStreet
{
string m_defaultName;
@@ -67,7 +79,8 @@ public:
vector<feature::Metadata::EType> const & GetEditableFields() const;
StringUtf8Multilang const & GetName() const;
- vector<LocalizedName> GetLocalizedNames() const;
+ // See comment for NamesDataSource class.
+ NamesDataSource GetNamesDataSource() const;
LocalizedStreet const & GetStreet() const;
vector<LocalizedStreet> const & GetNearbyStreets() const;
string const & GetHouseNumber() const;
@@ -117,6 +130,24 @@ public:
static bool ValidateWebsite(string const & site);
static bool ValidateEmail(string const & email);
+ // TODO dummy, should be removed.
+ static vector<string> const & GetMwmLanguages()
+ {
+ static vector<string> const kNativelanguagesForMwm = {"de", "fr"};
+
+ return kNativelanguagesForMwm;
+ }
+ // TODO dummy, should be removed.
+
+ // Check whether langCode can be used as default name.
+ static bool CanUseAsDefaultName(int8_t const langCode, StringUtf8Multilang const & name,
+ vector<string> const & nativeMwmLanguages);
+
+ // See comment for NamesDataSource class.
+ static NamesDataSource GetNamesDataSource(StringUtf8Multilang const & source,
+ vector<string> const & nativeMwmLanguages,
+ string const & userLanguage);
+
private:
string m_houseNumber;
LocalizedStreet m_street;