swift
ownaircraftcomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_COMPONENTS_OWNAIRCRAFTCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_OWNAIRCRAFTCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QScopedPointer>
11 
14 #include "misc/aviation/callsign.h"
15 #include "misc/network/user.h"
18 
19 namespace Ui
20 {
21  class COwnAircraftComponent;
22 }
23 namespace swift::gui::components
24 {
26  class COwnAircraftComponent : public QFrame
27  {
28  Q_OBJECT
29 
30  public:
33  {
40  QString ownLiverySend;
41  bool useModelString = true;
42  bool useLivery = true;
43  };
44 
46  explicit COwnAircraftComponent(QWidget *parent = nullptr);
47 
49  virtual ~COwnAircraftComponent() override;
50 
53 
55  void setUser(const swift::misc::network::CUser &user);
56 
59 
62 
66 
68  CGuiAircraftValues getAircraftValuesFromGui() const;
69 
70  signals:
73 
74  private:
76  void onSimulatorModelChanged(const swift::misc::simulation::CAircraftModel &model);
77 
79  void onModelStringSendChanged();
80 
82  void onSimulatorStatusChanged(int status);
83 
86  bool setGuiIcaoValues(const swift::misc::simulation::CAircraftModel &model, bool onlyIfEmpty);
87 
89  void changedAircraftIcao(const swift::misc::aviation::CAircraftIcaoCode &icao);
90 
92  void changedAirlineIcao(const swift::misc::aviation::CAirlineIcaoCode &icao);
93 
95  void highlightModelField(const swift::misc::simulation::CAircraftModel &model = {});
96 
98  bool hasValidContexts() const;
99 
101  void clearLivery();
102 
104  swift::misc::simulation::CAircraftModel getPrefillModel() const;
105 
107  this
108  };
109  QScopedPointer<Ui::COwnAircraftComponent> ui;
110  };
111 } // namespace swift::gui::components
112 
113 #endif // SWIFT_GUI_COMPONENTS_OWNAIRCRAFTCOMPONENT_H
swift::misc::CStatusMessageList validate() const
Validate aircaft.
void setUser(const swift::misc::network::CUser &user)
Set a user.
bool updateOwnAircaftIcaoValuesFromGuiValues()
Update own ICAO values (own aircraft from what is set in the GUI)
void setOwnModelAndIcaoValues(const swift::misc::simulation::CAircraftModel &ownModel={})
Own model and ICAO data for GUI and own aircraft.
swift::misc::aviation::CCallsign getCallsignFromGui() const
Values from GUI.
CGuiAircraftValues getAircraftValuesFromGui() const
Values from GUI.
COwnAircraftComponent(QWidget *parent=nullptr)
Constructor.
Status messages, e.g. from Core -> GUI.
Value object for ICAO classification.
Value object for ICAO classification.
Value object encapsulating information of a callsign.
Definition: callsign.h:30
Value object encapsulating information of a user.
Definition: user.h:28
Aircraft model (used by another pilot, my models on disk)
Definition: aircraftmodel.h:71
High level reusable GUI components.
Definition: aboutdialog.cpp:13
swift::misc::aviation::CAirlineIcaoCode ownAirlineIcao
ICAO airline.
swift::misc::aviation::CCallsign ownCallsign
own aircraft callsign
swift::misc::aviation::CAircraftIcaoCode ownAircraftIcao
ICAO aircraft.