swift
datainfoareacomponent.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_DATAINFOAREACOMPONENT_H
7 #define SWIFT_GUI_DATAINFOAREACOMPONENT_H
8 
9 #include <QObject>
10 #include <QScopedPointer>
11 #include <QSize>
12 
13 #include "gui/infoarea.h"
14 #include "gui/swiftguiexport.h"
16 
17 class QPixmap;
18 class QWidget;
19 
20 namespace Ui
21 {
22  class CDataInfoAreaComponent;
23 }
24 namespace swift::gui::components
25 {
26  class CDbAircraftIcaoComponent;
27  class CDbAirlineIcaoComponent;
28  class CDbCountryComponent;
29  class CDbDistributorComponent;
30  class CDbLiveryComponent;
31  class CDbModelComponent;
32  class CDbAircraftCategoryComponent;
33 
38  {
39  Q_OBJECT
40 
41  public:
43  enum InfoArea
44  {
45  // index must match tab index!
46  InfoAreaModels = 0,
47  InfoAreaLiveries = 1,
48  InfoAreaDistributors = 2,
49  InfoAreaAircraftIcao = 3,
50  InfoAreaAirlineIcao = 4,
51  InfoAreaCountries = 5,
52  InfoAreaAircraftCategories = 6,
53  InfoAreaNone = -1
54  };
55 
57  explicit CDataInfoAreaComponent(QWidget *parent = nullptr);
58 
60  virtual ~CDataInfoAreaComponent() override;
61 
63  CDbModelComponent *getModelComponent() const;
64 
66  CDbLiveryComponent *getLiveryComponent() const;
67 
69  CDbDistributorComponent *getDistributorComponent() const;
70 
72  CDbAircraftIcaoComponent *getAircraftComponent() const;
73 
75  CDbAirlineIcaoComponent *getAirlineComponent() const;
76 
78  CDbCountryComponent *getCountryComponent() const;
79 
81  CDbAircraftCategoryComponent *getAircraftCategoryComponent() const;
82 
83  public slots:
85  bool writeDbDataToResourceDir() const;
86 
88  bool readDbDataFromResourceDir();
89 
91  void requestUpdateOfAllDbData();
92 
94  void requestUpdatedData(swift::misc::network::CEntityFlags::Entity entity);
95 
96  protected:
98  virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override;
99 
101  virtual const QPixmap &indexToPixmap(int areaIndex) const override;
102 
103  private:
104  QScopedPointer<Ui::CDataInfoAreaComponent> ui;
105  };
106 } // namespace swift::gui::components
107 
108 #endif // SWIFT_GUI_DATAINFOAREACOMPONENT_H
Info area, hosting dockable widgets.
Definition: infoarea.h:41
Info area containing the DB data (models, liveries ...)
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.