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

pin_click_manager.hpp « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 275043260786c26a2057f16be060bdff7a4458a7 (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
#pragma once
#include "map/bookmark.hpp"

#include "graphics/defines.hpp"

#include "geometry/point2d.hpp"

#include "std/function.hpp"
#include "std/shared_ptr.hpp"
#include "std/unique_ptr.hpp"


class Framework;
class PaintEvent;
namespace location { class GpsInfo; }
namespace gui { class Element; }
namespace url_scheme { struct ApiPoint; }

class PinClickManager
{
  Framework & m_f;

  void OnDismiss();

  void SetBalloonVisible(bool isVisible);

public:
  PinClickManager(Framework & f);

  void RenderPolicyCreated(graphics::EDensity density) {}
  void LocationChanged(location::GpsInfo const & info) {}

  void OnShowMark(UserMark const * mark);

  void Hide();

  void RemovePin();
  void Dismiss();

private:
  /// @name Platform dependent listeners to show special activities.
  //@{
  // You must delete UserMarkCopy obtained by this callback
  typedef function<void (unique_ptr<UserMarkCopy>)> TUserMarkListener;
  TUserMarkListener m_userMarkListener;
  typedef function<void (void)> TDismissListener;
  TDismissListener m_dismissListener;

public:
  template <class T> void ConnectUserMarkListener(T const & t)   { m_userMarkListener = t; }
  template <class T> void ConnectDismissListener(T const & t)    { m_dismissListener = t; }

  void ClearListeners();
  //@}
};