swift
maininfoareacomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2014 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_MAININFOAREACOMPONENT_H
7 #define SWIFT_GUI_MAININFOAREACOMPONENT_H
8 
9 #include <QObject>
10 #include <QScopedPointer>
11 #include <QSize>
12 
13 #include "gui/infoarea.h"
14 #include "gui/swiftguiexport.h"
15 
16 class QPixmap;
17 class QWidget;
18 
19 namespace Ui
20 {
21  class CMainInfoAreaComponent;
22 }
23 namespace swift::gui::components
24 {
25  // forward declaration to break compile dependency from all components
26  class CAircraftComponent;
27  class CAtcStationComponent;
28  class CCockpitComponent;
29  class CFlightPlanComponent;
30  class CLogComponent;
31  class CMappingComponent;
32  class CInterpolationComponent;
33  class CRadarComponent;
34  class CSettingsComponent;
35  class CSimulatorComponent;
36  class CTextMessageComponent;
37  class CUserComponent;
38 
41  {
42  Q_OBJECT
43 
44  public:
46  explicit CMainInfoAreaComponent(QWidget *parent = nullptr);
47 
49  virtual ~CMainInfoAreaComponent() override;
50 
52  enum InfoArea
53  {
54  // index must match tab index!
55  InfoAreaCockpit = 0,
56  InfoAreaAircraft = 1,
57  InfoAreaAtc = 2,
58  InfoAreaUsers = 3,
59  InfoAreaTextMessages = 4,
60  InfoAreaSimulator = 5,
61  InfoAreaFlightPlan = 6,
62  InfoAreaMapping = 7,
63  InfoAreaInterpolation = 8,
64  InfoAreaSettings = 9,
65  InfoAreaLog = 10,
66  InfoAreaRadar = 11,
67  InfoAreaNone = -1
68  };
69 
71  CCockpitComponent *getCockpitComponent();
72 
74  CAtcStationComponent *getAtcStationComponent();
75 
77  CAircraftComponent *getAircraftComponent();
78 
80  CMappingComponent *getMappingComponent();
81 
83  CInterpolationComponent *getInterpolationComponent();
84 
86  CUserComponent *getUserComponent();
87 
89  CFlightPlanComponent *getFlightPlanComponent();
90 
92  CSettingsComponent *getSettingsComponent();
93 
95  CLogComponent *getLogComponent();
96 
98  CSimulatorComponent *getSimulatorComponent();
99 
101  CTextMessageComponent *getTextMessageComponent();
102 
104  CRadarComponent *getRadarComponent();
105 
107  void displayLog();
108 
110  void toggleFloating(InfoArea infoArea) { CInfoArea::toggleFloatingByIndex(static_cast<int>(infoArea)); }
111 
113  void selectArea(InfoArea infoArea);
114 
116  void selectLog();
117 
119  void selectSettingsTab(int index);
120 
122  void selectAudioTab();
123 
124  protected:
125  // CInfoArea overrides
126  virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override;
127  virtual const QPixmap &indexToPixmap(int areaIndex) const override;
128 
129  private:
130  QScopedPointer<Ui::CMainInfoAreaComponent> ui;
131  };
132 } // namespace swift::gui::components
133 
134 #endif // SWIFT_GUI_MAININFOAREACOMPONENT_H
Info area, hosting dockable widgets.
Definition: infoarea.h:41
void toggleFloatingByIndex(int areaIndex)
Toggle floating of index.
Definition: infoarea.cpp:378
Cockpit component: COM unit, show / hide bar, voice rooms.
GUI displaying log and status messages.
Definition: logcomponent.h:45
void toggleFloating(InfoArea infoArea)
Toggle floating of given area.
GUI displaying a radar like view with aircrafts nearby.
User componenet (users, clients)
Definition: usercomponent.h:29
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.