swift
aircraftcomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 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_AIRCRAFTCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_AIRCRAFTCOMPONENT_H
8 
9 #include <QObject>
10 #include <QScopedPointer>
11 #include <QTabWidget>
12 #include <QTimer>
13 #include <QtGlobal>
14 
17 #include "gui/swiftguiexport.h"
19 
20 namespace Ui
21 {
22  class CAircraftComponent;
23 }
24 namespace swift::misc
25 {
26  namespace aviation
27  {
28  class CCallsign;
29  }
30  namespace simulation
31  {
32  class CSimulatedAircraft;
33  }
34 } // namespace swift::misc
35 namespace swift::gui
36 {
37  class CDockWidgetInfoArea;
38 
39  namespace components
40  {
43  {
44  Q_OBJECT
45 
46  public:
50  {
51  TabAircraftInRange = 0,
52  TabAirportsInRange
53  };
54 
56  explicit CAircraftComponent(QWidget *parent = nullptr);
57 
59  virtual ~CAircraftComponent() override;
60 
62  int countAircraftInView() const;
63 
65  virtual bool setParentDockWidgetInfoArea(swift::gui::CDockWidgetInfoArea *parentDockableWidget) override;
66 
68  void update();
69 
71  void setTab(AircraftTab tab);
72 
73  signals:
76 
77  private:
79  void updateViews();
80 
82  void onInfoAreaTabBarChanged(int index);
83 
85  void onRowCountChanged(int count, bool withFilter);
86 
88  void onConnectionStatusChanged(const swift::misc::network::CConnectionStatus &from,
90 
92  void onSettingsChanged();
93 
95  void onOwnAircraftMoved(const swift::misc::physical_quantities::CLength &distance);
96 
97  QScopedPointer<Ui::CAircraftComponent> ui;
99  this, &CAircraftComponent::onSettingsChanged
100  };
101  QTimer m_updateTimer;
102  int m_updateCounter = 0;
103  };
104  } // namespace components
105 } // namespace swift::gui
106 
107 #endif // SWIFT_GUI_COMPONENTS_AIRCRAFTCOMPONENT_H
Specialized class for dock widgets serving as info area.
Helper class: If a component is residing in an dockable widget. This class provides access to its inf...
void requestTextMessageWidget(const swift::misc::aviation::CCallsign &callsign)
Request a text message.
Value object encapsulating information of a callsign.
Definition: callsign.h:30
Value object encapsulating information about a connection status.
Physical unit length (length)
Definition: length.h:18
GUI related classes.
Free functions in swift::misc.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.