blob: de011f908c4c5b0ab61cfa2ef56f06d371db10f0 (
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
|
#pragma once
#include "std/function.hpp"
#include "std/map.hpp"
#include "std/string.hpp"
#include "std/utility.hpp"
#include "std/vector.hpp"
namespace marketing
{
// Tags.
extern char const * const kMapVersion;
extern char const * const kMapListing;
extern char const * const kMapDownloadDiscovered;
extern char const * const kMapLastDownloaded;
extern char const * const kMapLastDownloadedTimestamp;
extern char const * const kRoutingP2PVehicleDiscovered;
extern char const * const kRoutingP2PPedestrianDiscovered;
extern char const * const kRoutingP2PBicycleDiscovered;
extern char const * const kRoutingP2PTaxiDiscovered;
extern char const * const kRoutingVehicleDiscovered;
extern char const * const kRoutingPedestrianDiscovered;
extern char const * const kRoutingBicycleDiscovered;
extern char const * const kRoutingTaxiDiscovered;
extern char const * const kEditorAddDiscovered;
extern char const * const kEditorEditDiscovered;
extern char const * const kTrafficDiscovered;
// Events.
extern char const * const kDownloaderMapActionFinished;
extern char const * const kSearchEmitResultsAndCoords;
extern char const * const kRoutingCalculatingRoute;
extern char const * const kBookmarksBookmarkAction;
extern char const * const kPlacepageHotelBook;
extern char const * const kEditorAddStart;
extern char const * const kEditorEditStart;
} // marketing
class MarketingService
{
public:
using PushWooshSenderFn = function<void(string const & tag, vector<string> const & values)>;
using MarketingSenderFn = function<void(string const & tag, map<string, string> const & params)>;
void ProcessFirstLaunch();
void SetPushWooshSender(PushWooshSenderFn const & fn) { m_pushwooshSender = fn; }
void SendPushWooshTag(string const & tag);
void SendPushWooshTag(string const & tag, string const & value);
void SendPushWooshTag(string const & tag, vector<string> const & values);
void SetMarketingSender(MarketingSenderFn const & fn) { m_marketingSender = fn; }
void SendMarketingEvent(string const & tag, map<string, string> const & params);
private:
/// Callback fucntion for setting PushWoosh tags.
PushWooshSenderFn m_pushwooshSender;
/// Callback fucntion for sending marketing events.
MarketingSenderFn m_marketingSender;
};
|