diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2016-06-06 15:56:18 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-06-23 18:58:26 +0300 |
commit | 7e9b9d96822d2710616a661eb69db70d3f1ecaa7 (patch) | |
tree | b3314f288a6bbf1a64482975c4718e6f21749783 /map | |
parent | d5ca510562669b185b43689d58c557b50d697923 (diff) |
[booking] Add API for booking and description urls
Diffstat (limited to 'map')
-rw-r--r-- | map/booking_api.cpp | 19 | ||||
-rw-r--r-- | map/booking_api.hpp | 14 | ||||
-rw-r--r-- | map/framework.hpp | 7 | ||||
-rw-r--r-- | map/map.pro | 2 |
4 files changed, 42 insertions, 0 deletions
diff --git a/map/booking_api.cpp b/map/booking_api.cpp new file mode 100644 index 0000000000..8dc1b17a9d --- /dev/null +++ b/map/booking_api.cpp @@ -0,0 +1,19 @@ +#include "booking_api.hpp" + + +#include "private.h" + + +BookingApi::BookingApi() : m_affiliateId(BOOKING_AFFILIATE_ID) +{} + +string BookingApi::GetBookingUrl(string const &baseUrl, string const & /* lang */) const +{ + return baseUrl + "#availability?affiliate_id=" + m_affiliateId; +} + +string BookingApi::GetDescriptionUrl(string const &baseUrl, string const & /* lang */) const +{ + return baseUrl + "?affiliate_id=" + m_affiliateId; +} + diff --git a/map/booking_api.hpp b/map/booking_api.hpp new file mode 100644 index 0000000000..8df44e0434 --- /dev/null +++ b/map/booking_api.hpp @@ -0,0 +1,14 @@ +#pragma once + +#include "std/string.hpp" + +class BookingApi +{ + string m_affiliateId; + +public: + BookingApi(); + string GetBookingUrl(string const &baseUrl, string const & lang = string()) const; + string GetDescriptionUrl(string const &baseUrl, string const & lang = string()) const; +}; + diff --git a/map/framework.hpp b/map/framework.hpp index 17a177a9e1..49486afe6c 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -1,6 +1,7 @@ #pragma once #include "map/api_mark_point.hpp" +#include "map/booking_api.hpp" #include "map/bookmark.hpp" #include "map/bookmark_manager.hpp" #include "map/place_page_info.hpp" @@ -139,6 +140,8 @@ protected: BookmarkManager m_bmManager; + BookingApi m_bookingApi; + bool m_isRenderingEnabled; /// This function will be called by m_storage when latest local files @@ -164,6 +167,10 @@ public: Framework(); virtual ~Framework(); + /// Get access to booking api helpers + BookingApi & GetBookingApi() { return m_bookingApi; } + BookingApi const & GetBookingApi() const { return m_bookingApi; } + /// Migrate to new version of very different data. bool IsEnoughSpaceForMigrate() const; storage::TCountryId PreMigrate(ms::LatLon const & position, storage::Storage::TChangeCountryFunction const & change, diff --git a/map/map.pro b/map/map.pro index 36db8dc214..73665af1a8 100644 --- a/map/map.pro +++ b/map/map.pro @@ -12,6 +12,7 @@ include($$ROOT_DIR/common.pri) HEADERS += \ api_mark_point.hpp \ + booking_api.hpp \ bookmark.hpp \ bookmark_manager.hpp \ feature_vec_model.hpp \ @@ -33,6 +34,7 @@ SOURCES += \ ../api/src/c/api-client.c \ address_finder.cpp \ api_mark_point.cpp \ + booking_api.cpp \ bookmark.cpp \ bookmark_manager.cpp \ feature_vec_model.cpp \ |