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

MWMPlacePageData.h « PlacePage « UI « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b75f480eb613179cea04d4610a96ff9a46d18f4a (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#import "MWMPlacePageActionBar.h"

#include "partners_api/taxi_provider.hpp"

#include "storage/index.hpp"

#include "map/routing_mark.hpp"

#include <vector>

@class MWMPlacePageData;
@class MWMUGCReviewVM;
@class MWMCianItemModel;

struct BookmarkAndCategory;
struct FeatureID;

namespace ugc
{
struct Review;
}  // ugc

namespace local_ads
{
enum class EventType;
}  // local_ads

namespace booking
{
struct HotelReview;
struct HotelFacility;
}  // namespace booking

namespace place_page
{
class Info;

enum class Sections
{
  Preview,
  Bookmark,
  HotelPhotos,
  HotelDescription,
  HotelFacilities,
  HotelReviews,
  SpecialProjects,
  Metainfo,
  Ad,
  UGC,
  Buttons
};

enum class PreviewRows
{
  Title,
  ExternalTitle,
  Subtitle,
  Schedule,
  Booking,
  Address,
  Space,
  Banner
};

enum class HotelDescriptionRow
{
  Regular,
  ShowMore
};

enum class HotelPhotosRow
{
  Regular
};

enum class HotelFacilitiesRow
{
  Regular,
  ShowMore
};

enum class HotelReviewsRow
{
  Header,
  Regular,
  ShowMore
};

enum class SpecialProject
{
  Viator,
  Cian
};

enum class MetainfoRows
{
  OpeningHours,
  ExtendedOpeningHours,
  Phone,
  Address,
  Website,
  Email,
  Cuisine,
  Operator,
  Internet,
  Coordinate,
  LocalAdsCandidate,
  LocalAdsCustomer
};

enum class AdRows
{
  Taxi
};

enum class UGCRow
{
  SelectImpression,
  Comment,
  ShowMore
};

enum class ButtonsRows
{
  AddBusiness,
  EditPlace,
  AddPlace,
  HotelDescription,
  Other
};

enum class OpeningHours
{
  AllDay,
  Open,
  Closed,
  Unknown
};

using NewSectionsAreReady = void (^)(NSRange const & range, MWMPlacePageData * data, BOOL isSection);
using CianIsReady = void (^)(NSArray<MWMCianItemModel *> * items);

}  // namespace place_page

@class MWMGalleryItemModel;
@class MWMViatorItemModel;
@class MWMCianItemModel;
@protocol MWMBanner;

/// ViewModel for place page.
@interface MWMPlacePageData : NSObject<MWMActionBarSharedData>

@property(copy, nonatomic) place_page::NewSectionsAreReady sectionsAreReadyCallback;
@property(copy, nonatomic) MWMVoidBlock bannerIsReadyCallback;
@property(copy, nonatomic) place_page::CianIsReady cianIsReadyCallback;

// ready callback will be called from main queue.
- (instancetype)initWithPlacePageInfo:(place_page::Info const &)info;

- (void)fillSections;

- (void)updateBookmarkStatus:(BOOL)isBookmark;

/// Country id for changing place page's fields which depend on application state.
- (storage::TCountryId const &)countryId;
- (FeatureID const &)featureId;

// Regular
- (NSString *)title;
- (NSString *)subtitle;
- (place_page::OpeningHours)schedule;
- (NSString *)address;

// Booking
- (void)fillOnlineBookingSections;
- (NSString *)bookingRating;
- (NSString *)bookingApproximatePricing;
- (NSURL *)sponsoredURL;
- (NSURL *)sponsoredDescriptionURL;
- (NSURL *)bookingSearchURL;
- (NSString *)sponsoredId;
- (void)assignOnlinePriceToLabel:(UILabel *)label;
- (NSString *)hotelDescription;
- (vector<booking::HotelFacility> const &)facilities;
- (vector<booking::HotelReview> const &)hotelReviews;
- (NSUInteger)numberOfHotelReviews;
- (NSURL *)URLToAllReviews;
- (NSArray<MWMGalleryItemModel *> *)photos;

// Viator
- (void)fillOnlineViatorSection;
- (NSArray<MWMViatorItemModel *> *)viatorItems;

// CIAN
- (void)fillOnlineCianSection;

// UGC
- (MWMUGCReviewVM *)reviewViewModel;
- (std::vector<ugc::Review> const &)ugcReviews;

// Route points
- (RouteMarkType)routeMarkType;
- (int8_t)intermediateIndex;

// Taxi
- (std::vector<taxi::Provider::Type> const &)taxiProviders;

// Banner
- (id<MWMBanner>)nativeAd;

// API
- (NSString *)apiURL;

// Bookmark
- (NSString *)externalTitle;
- (NSString *)bookmarkColor;
- (NSString *)bookmarkDescription;
- (NSString *)bookmarkCategory;
- (BookmarkAndCategory)bookmarkAndCategory;

// Local Ads
- (NSString *)localAdsURL;
- (void)logLocalAdsEvent:(local_ads::EventType)type;

// Table view's data
- (std::vector<place_page::Sections> const &)sections;
- (std::vector<place_page::PreviewRows> const &)previewRows;
- (std::vector<place_page::HotelPhotosRow> const &)photosRows;
- (std::vector<place_page::HotelDescriptionRow> const &)descriptionRows;
- (std::vector<place_page::HotelFacilitiesRow> const &)hotelFacilitiesRows;
- (std::vector<place_page::HotelReviewsRow> const &)hotelReviewsRows;
- (std::vector<place_page::MetainfoRows> const &)metainfoRows;
- (std::vector<place_page::SpecialProject> const &)specialProjectRows;
- (std::vector<place_page::AdRows> const &)adRows;
- (std::vector<place_page::UGCRow> const &)ugcRows;
- (std::vector<place_page::ButtonsRows> const &)buttonsRows;

// Table view metainfo rows
- (NSString *)stringForRow:(place_page::MetainfoRows)row;

// Helpers
- (NSString *)phoneNumber;
- (BOOL)isBookmark;
- (BOOL)isApi;
- (BOOL)isBooking;
- (BOOL)isOpentable;
- (BOOL)isViator;
- (BOOL)isCian;
- (BOOL)isBookingSearch;
- (BOOL)isHTMLDescription;
- (BOOL)isMyPosition;
- (BOOL)isRoutePoint;

// Coordinates
- (m2::PointD const &)mercator;
- (ms::LatLon)latLon;

- (NSString *)statisticsTags;

// TODO(Vlad): Use MWMSettings to store coordinate format.
+ (void)toggleCoordinateSystem;

@end