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

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

#include "search/result.hpp"

#include "anim/task.hpp"
#include "anim/controller.hpp"

#include "graphics/depth_constants.hpp"
#include "graphics/opengl/base_texture.hpp"
#include "graphics/display_list.hpp"
#include "graphics/icon.hpp"

#include "geometry/transformations.hpp"

#include "gui/controller.hpp"


PinClickManager::PinClickManager(Framework & f)
  : m_f(f)
{}

void PinClickManager::Hide()
{
  m_f.Invalidate();
}

void PinClickManager::OnShowMark(UserMark const * mark)
{
  if (mark != nullptr && m_userMarkListener != nullptr)
    m_userMarkListener(mark->Copy());
  SetBalloonVisible(mark != nullptr);
}

void PinClickManager::SetBalloonVisible(bool isVisible)
{
  if (!isVisible && m_f.HasActiveUserMark())
    OnDismiss();

  m_f.Invalidate();
}

void PinClickManager::RemovePin()
{
  m_f.ActivateUserMark(NULL);
  m_f.Invalidate();
}

void PinClickManager::Dismiss()
{
  OnDismiss();
}

void PinClickManager::ClearListeners()
{
  m_userMarkListener = TUserMarkListener();
  m_dismissListener = TDismissListener();
}

void PinClickManager::OnDismiss()
{
  // Can be called before the listeners will be attached (clearing on activity start).
  if (m_dismissListener)
    m_dismissListener();
}