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
|
#pragma once
#include "gui/button.hpp"
#include "graphics/font_desc.hpp"
#include "storage/index.hpp"
#include "geometry/point2d.hpp"
#include "geometry/rect2d.hpp"
#include "base/timer.hpp"
#include "std/shared_ptr.hpp"
namespace location
{
class State;
}
class Drawer;
namespace gui
{
class Button;
class Controller;
class CachedTextView;
}
class Framework;
class CountryStatusDisplay;
class CompassArrow;
class Ruler;
/// Class, which displays additional information on the primary layer like:
/// rules, coordinates, GPS position and heading, compass, Download button, etc.
class InformationDisplay
{
Framework * m_framework;
graphics::FontDesc m_fontDesc;
shared_ptr<Ruler> m_ruler;
gui::Controller * m_controller;
shared_ptr<CountryStatusDisplay> m_countryStatusDisplay;
shared_ptr<CompassArrow> m_compassArrow;
shared_ptr<location::State> m_locationState;
shared_ptr<gui::CachedTextView> m_debugLabel;
shared_ptr<gui::CachedTextView> m_copyrightLabel;
void InitRuler(Framework * fw);
void InitDebugLabel();
void InitLocationState(Framework * fw);
void InitCompassArrow(Framework * fw);
void InitCountryStatusDisplay(Framework * fw);
void InitCopyright(Framework * fw);
public:
enum class WidgetType {
Ruler = 0,
CopyrightLabel,
CountryStatusDisplay,
CompassArrow,
DebugLabel
};
InformationDisplay(Framework * framework);
void setController(gui::Controller * controller);
/*!
* \brief SetWidgetPivotsByDefault sets the default pivot points for all the widgets on the map.
* The pivot points can be overridden by a call of SetWidgetPivot()
* after Framework::OnSize() call.
*/
void SetWidgetPivotsByDefault(int screenWidth, int screenHeight);
void setVisualScale(double visualScale);
bool isCopyrightActive() const;
void enableCopyright(bool doEnable);
void enableRuler(bool doEnable);
bool isRulerEnabled() const;
void enableDebugInfo(bool doEnable);
void setDebugInfo(double frameDuration, int currentScale);
void measurementSystemChanged();
void enableCompassArrow(bool doEnable);
bool isCompassArrowEnabled() const;
void setCompassArrowAngle(double angle);
shared_ptr<location::State> const & locationState() const;
void setEmptyCountryIndex(storage::TIndex const & idx);
shared_ptr<CountryStatusDisplay> const & countryStatusDisplay() const;
void ResetRouteMatchingInfo();
void SetWidgetPivot(WidgetType widget, m2::PointD const & pivot);
m2::PointD GetWidgetSize(WidgetType widget) const;
};
|