diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-10-06 19:54:09 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:29:28 +0300 |
commit | 708210ddb49fdd29aea6a5c67e569b1370daedf1 (patch) | |
tree | 26a9607de9218a64f60a1c2ca0b6c150e1e9b39b /map/active_maps_layout.hpp | |
parent | 79d094372c43b1f9171757ad0936e82dabc928b0 (diff) |
[core] new methods for downloader interfaces
Diffstat (limited to 'map/active_maps_layout.hpp')
-rw-r--r-- | map/active_maps_layout.hpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/map/active_maps_layout.hpp b/map/active_maps_layout.hpp index 8e9d27ab33..6abb9fd972 100644 --- a/map/active_maps_layout.hpp +++ b/map/active_maps_layout.hpp @@ -1,6 +1,7 @@ #pragma once #include "../storage/storage_defines.hpp" +#include "../storage/guides.hpp" #include "../storage/index.hpp" #include "../std/string.hpp" @@ -17,9 +18,10 @@ class ActiveMapsLayout public: enum class TGroup { - ENewMap, - EOutOfDate, - EUpToDate + ENewMap = 0, + EOutOfDate = 1, + EUpToDate = 2, + EGroupCount = 3 }; class ActiveMapsListener @@ -47,9 +49,12 @@ public: string const & GetCountryName(TGroup const & group, int position) const; TStatus GetCountryStatus(TGroup const & group, int position) const; TMapOptions GetCountryOptions(TGroup const & group, int position) const; + LocalAndRemoteSizeT const GetCountrySize(TGroup const & group, int position) const; - /// set to nullptr when go out from ActiveMaps activity - void SetListener(ActiveMapsListener * listener); + int AddListener(ActiveMapsListener * listener); + void RemoveListener(int slotID); + + bool GetGuideInfo(TGroup const & group, int position, guides::GuideInfo & info) const; void DownloadMap(TIndex const & index, TMapOptions const & options); void DownloadMap(TGroup const & group, int position, TMapOptions const & options); @@ -60,11 +65,17 @@ public: bool IsDownloadingActive() const; void CancelDownloading(TGroup const & group, int position); + void ShowMap(TGroup const & group, int position); + private: friend class CountryTree; Storage const & GetStorage() const; Storage & GetStorage(); + bool GetGuideInfo(TIndex const & index, guides::GuideInfo & info) const; + + void ShowMap(TIndex const & index); + private: void StatusChangedCallback(TIndex const & index); void ProgressChangedCallback(TIndex const & index, LocalAndRemoteSizeT const & sizes); @@ -103,7 +114,9 @@ private: private: Framework & m_framework; int m_subscribeSlotID = 0; - ActiveMapsListener * m_listener = nullptr; + typedef pair<int, ActiveMapsListener *> TListenerNode; + map<int, ActiveMapsListener *> m_listeners; + int m_currentSlotID = 0; vector<Item> m_items; /// ENewMap - [0, TRangeSplit.first) |