]> git.mxchange.org Git - flightgear.git/blob - src/GUI/LocationWidget.hxx
VS2015 compatability fixes.
[flightgear.git] / src / GUI / LocationWidget.hxx
1 // LocationWidget.hxx - GUI launcher dialog using Qt5
2 //
3 // Written by James Turner, started October 2015.
4 //
5 // Copyright (C) 2015 James Turner <zakalawe@mac.com>
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
21 #ifndef LOCATIONWIDGET_H
22 #define LOCATIONWIDGET_H
23
24 #include <QWidget>
25
26 #include <QToolButton>
27
28 #include <Navaids/positioned.hxx>
29 #include <Airports/airports_fwd.hxx>
30
31 #include "QtLauncher_fwd.hxx"
32
33 namespace Ui {
34     class LocationWidget;
35 }
36
37 class NavSearchModel;
38
39 class LocationWidget : public QWidget
40 {
41     Q_OBJECT
42
43 public:
44     explicit LocationWidget(QWidget *parent = 0);
45     ~LocationWidget();
46
47     void saveSettings();
48     void restoreSettings();
49
50     QString locationDescription() const;
51
52     void setBaseLocation(FGPositionedRef ref);
53
54     void setAircraftType(LauncherAircraftType ty);
55
56     bool shouldStartPaused() const;
57
58     void setLocationOptions();
59 Q_SIGNALS:
60     void descriptionChanged(QString t);
61
62 private Q_SLOTS:
63     void updateDescription();
64     void onLocationChanged();
65     void onOffsetDataChanged();
66     void onHeadingChanged();
67 private:
68
69     void onSearch();
70     void onSearchResultSelected(const QModelIndex& index);
71     void onSearchComplete();
72
73     void onAirportRunwayClicked(FGRunwayRef rwy);
74     void onAirportParkingClicked(FGParkingRef park);
75
76     void onOffsetBearingTrueChanged(bool on);
77
78     void addToRecent(FGPositionedRef pos);
79
80     void onOffsetEnabledToggled(bool on);
81     void onBackToSearch();
82     void setNavRadioOption();
83     void onShowHistory();
84
85     Ui::LocationWidget *m_ui;
86
87     NavSearchModel* m_searchModel;
88
89     FGPositionedRef m_location;
90     bool m_locationIsLatLon;
91     SGGeod m_geodLocation;
92
93     QToolButton* m_backButton;
94
95     FGPositionedList m_recentLocations;
96     LauncherAircraftType m_aircraftType;
97 };
98
99 #endif // LOCATIONWIDGET_H