forked from organicmaps/organicmaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.hpp
147 lines (114 loc) · 3.69 KB
/
mainwindow.hpp
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
#pragma once
#include "qt/selection.hpp"
#include "map/routing_mark.hpp"
#include "storage/storage_defines.hpp"
#include "platform/location.hpp"
#include "platform/location_service.hpp"
#include <QtWidgets/QApplication>
#include <QtWidgets/QMainWindow>
#include <array>
#include <string>
#include <memory>
class Framework;
class QDockWidget;
class QLabel;
class QPushButton;
namespace search { class Result; }
namespace qt
{
class DrawWidget;
class PopupMenuHolder;
struct ScreenshotParams;
class MainWindow : public QMainWindow, location::LocationObserver
{
DrawWidget * m_pDrawWidget = nullptr;
// TODO(mgsergio): Make indexing more informative.
std::array<QDockWidget *, 1> m_Docks;
QPushButton * m_downloadButton = nullptr;
QPushButton * m_retryButton = nullptr;
QLabel * m_downloadingStatusLabel = nullptr;
storage::CountryId m_lastCountry;
std::unique_ptr<location::LocationService> const m_locationService;
bool const m_screenshotMode;
QAction * m_pMyPositionAction = nullptr;
QAction * m_pCreateFeatureAction = nullptr;
QAction * m_pSearchAction = nullptr;
QAction * m_rulerAction = nullptr;
enum LayerType : uint8_t
{
/// @todo Uncomment when we will integrate a traffic provider.
// TRAFFIC = 0,
TRANSIT = 0, // Metro scheme
ISOLINES,
OUTDOORS,
};
PopupMenuHolder * m_layers = nullptr;
PopupMenuHolder * m_routing = nullptr;
PopupMenuHolder * m_selection = nullptr;
#ifdef BUILD_DESIGNER
QString const m_mapcssFilePath = nullptr;
QAction * m_pBuildStyleAction = nullptr;
QAction * m_pRecalculateGeomIndex = nullptr;
QAction * m_pDrawDebugRectAction = nullptr;
QAction * m_pGetStatisticsAction = nullptr;
QAction * m_pRunTestsAction = nullptr;
QAction * m_pBuildPhonePackAction = nullptr;
#endif // BUILD_DESIGNER
Q_OBJECT
public:
MainWindow(Framework & framework, std::unique_ptr<ScreenshotParams> && screenshotParams,
QRect const & screenGeometry
#ifdef BUILD_DESIGNER
, QString const & mapcssFilePath = QString()
#endif
);
protected:
Framework & GetFramework() const;
void OnLocationError(location::TLocationError errorCode) override;
void OnLocationUpdated(location::GpsInfo const & info) override;
void LocationStateModeChanged(location::EMyPositionMode mode);
void CreatePanelImpl(size_t i, Qt::DockWidgetArea area, QString const & name,
QKeySequence const & hotkey, char const * slot);
void CreateNavigationBar();
void CreateSearchBarAndPanel();
void CreateCountryStatusControls();
void SetLayerEnabled(LayerType type, bool enable);
#if defined(OMIM_OS_WINDOWS)
/// to handle menu messages
bool nativeEvent(QByteArray const & eventType, void * message, qintptr * result) override;
#endif
void closeEvent(QCloseEvent * e) override;
protected Q_SLOTS:
#ifndef NO_DOWNLOADER
void ShowUpdateDialog();
#endif // NO_DOWNLOADER
void OnPreferences();
void OnAbout();
void OnMyPosition();
void OnCreateFeatureClicked();
void OnSearchButtonClicked();
void OnLoginMenuItem();
void OnUploadEditsMenuItem();
void OnBeforeEngineCreation();
void OnDownloadClicked();
void OnRetryDownloadClicked();
void OnSwitchSelectionMode(SelectionMode mode);
void OnSwitchMwmsBordersSelectionMode();
void OnClearSelection();
void OnLayerEnabled(LayerType layer);
void OnRulerEnabled();
void OnRoutePointSelected(RouteMarkType type);
void OnFollowRoute();
void OnClearRoute();
void OnRoutingSettings();
void OnBookmarksAction();
#ifdef BUILD_DESIGNER
void OnBuildStyle();
void OnRecalculateGeomIndex();
void OnDebugStyle();
void OnGetStatistics();
void OnRunTests();
void OnBuildPhonePackage();
#endif // BUILD_DESIGNER
};
} // namespace qt