#pragma once #include "indexer/feature_meta.hpp" #include #include #include "3party/pugixml/src/pugixml.hpp" class Reader; namespace editor { struct TypeAggregatedDescription { using EType = feature::Metadata::EType; using FeatureFields = std::vector; bool IsEmpty() const { return IsNameEditable() || IsAddressEditable() || !m_editableFields.empty(); } FeatureFields const & GetEditableFields() const { return m_editableFields; } bool IsNameEditable() const { return m_name; } bool IsAddressEditable() const { return m_address; } FeatureFields m_editableFields; bool m_name = false; bool m_address = false; }; class EditorConfig { public: EditorConfig() = default; // TODO(mgsergio): Reduce overhead by matching uint32_t types instead of strings. bool GetTypeDescription(std::vector classificatorTypes, TypeAggregatedDescription & outDesc) const; std::vector GetTypesThatCanBeAdded() const; void SetConfig(pugi::xml_document const & doc); // TODO(mgsergio): Implement this getter to avoid hard-code in XMLFeature::ApplyPatch. // It should return [[phone, contact:phone], [website, contact:website, url], ...]. //vector> GetAlternativeFields() const; private: pugi::xml_document m_document; }; } // namespace editor