Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
openlayerwidget.h
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // openlayerwidget.h
3 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
4 // (c) 2010-2012
5 // Yves Sablonier, Pete Morgan
6 // Geoff McLane
7 // GNU GPLv2, see main.cpp and shipped licence.txt for further information
8 
9 #ifndef OPENLAYERWIDGET_H
10 #define OPENLAYERWIDGET_H
11 
12 #include <QtCore/QVariant>
13 #include <QtCore/QString>
14 
15 #include <QtWebKit/QWebView>
16 #include <QWebInspector>
17 #include <QtNetwork/QNetworkDiskCache>
18 
19 
20 #include <QStatusBar>
21 #include <QProgressBar>
22 #include <QLabel>
23 #include <QWidget>
24 #include <QActionGroup>
25 #include <QToolButton>
26 #include <QSlider>
27 #include <QDoubleSpinBox>
28 #include <QToolBar>
29 #include <QDial>
30 
31 #include "xobjects/mainobject.h"
32 
33 
34 class MainObject;
35 QT_FORWARD_DECLARE_CLASS(QNetworkDiskCache)
36 
37 class OpenLayerWidget : public QWidget
38 {
39 Q_OBJECT
40 public:
41  explicit OpenLayerWidget(MainObject *mob, QWidget *parent = 0);
42 
45  QSlider *sliderZoom;
47 
48  QString map_type;
49  QToolBar *toolbarAirports;
50 
51  QWebView *webView;
52 
53 private:
54 
55  QProgressBar *progressBar;
56  QStatusBar *statusBar;
57  QComboBox *comboServer;
58 
59  QLineEdit *txtLat;
60  QLineEdit *txtLon;
61  QSpinBox *spinHeading;
62  QDial *dialHeading;
63 
64 
65  QButtonGroup *buttonGroupViewLayers;
66  QCheckBox *chkViewStands;
67  QCheckBox *chkViewRunwayLabels;
68  QCheckBox *chkViewRunwayLines;
69 
70  QCheckBox *chkViewGridLines;
71 
72 
73  QToolButton *buttDebug;
74  QWebInspector *webInspector;
75 
76  QNetworkDiskCache *networkDiskCache;
77  //QNetworkCookieJar *networkCookieJar;
78 
79 signals:
80 
81  void setx(QString option, bool enabled, QString value);
82  void setv(QString option, QString value);
83  void map_double_clicked(QString lat, QString lon, QString heading);
84 
85 public slots:
86 
87  //= browser progress
88  void start_progress();
89  void update_progress(int progress);
90  void end_progress(bool Ok);
91 
92  //= map calls
93  void load_map(QString map_type);
94  void execute_js(QString js_string);
95 
96 
97  //# To map markers and features
98  void clear_airport(QString apt);
99  void clear_map();
100 
101  void add_runway(QString apt, QString rwy1, QString rwy2, QString lat1, QString lon1, QString lat2, QString lon2);
102  void add_stand(QString apt, QString name, QString lat, QString lon);
103  void add_tower(QString apt, QString lat, QString lon);
104 
105  void show_aircraft(QString callsign, QString lat, QString lon, QString heading, QString altitude);
106  void focus_aircraft(QString callsign);
107 
108  void show_radar(QString callsign, QString lat, QString lon, QString heading, QString altitude, bool is_tower);
109  //void display_radar_layer( int viz);
110  void clear_radar();
111 
112 
113  void zoom_to_airport(QString apt);
114  void zoom_to_latlon(QString lat, QString lon, int zoom);
115  void zoom_to(int zoom);
116 
117  void on_zoom_in();
118  void on_zoom_out();
119 
120 
121  //====================================
122  //@<< From Map Events
123  void map_initialised();
124 
125  void map_debug(QVariant);
126 
127  //void map_mouse_move(QVariant lat, QVariant lon);
128  void map_click(QVariant lat, QVariant lon);
129  void map_right_click(QVariant lat, QVariant lon);
130 
131  void map_set_coords(QVariant lat, QVariant lon);
132  void on_lat_changed(QString);
133  void on_lon_changed(QString);
134 
135 
136  void map_zoom_changed(QVariant zoom);
137  void map_error(QVariant err);
138 
139  void marker_clicked(QVariant marker, QVariant mId);
140  void marker_unselected(QVariant curr_idx, QVariant mLocationId);
141 
142  //======================================
143  void closeEvent(QCloseEvent *event);
144 
145  void on_upx( QString option, bool enabled, QString value);
146 
147  void on_display_layer(QAbstractButton*);
148 
149  void on_dial(int val);
150  void on_spin(int val);
151  void on_show_debugger();
152  void on_debug_mode(bool);
153 };
154 
155 #endif // OPENLAYERWIDGET
QStatusBar * statusBar
The MainObject is an extended QObject, and the main "controller" for FGx.
Definition: mainobject.h:66
QWebInspector * webInspector
QSpinBox * spinHeading
void on_upx(QString option, bool enabled, QString value)
Definition: mainobject.cpp:478
void setx(QString option, bool enabled, QString value)
QToolBar * toolbarAirports
QCheckBox * chkViewStands
QCheckBox * chkViewRunwayLabels
QWebView * webView
QString * mpmapFollowCallsign
QCheckBox * chkViewGridLines
QNetworkDiskCache * networkDiskCache
QLineEdit * txtLat
QButtonGroup * buttonGroupViewLayers
QLineEdit * txtLon
QToolButton * buttDebug
MainObject * mainObject
QComboBox * comboServer
QProgressBar * progressBar
QCheckBox * chkViewRunwayLines
void on_debug_mode(bool enabled)
QSlider * sliderZoom