swift
liveryform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 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_EDITORS_LIVERYFORM_H
7 #define SWIFT_GUI_EDITORS_LIVERYFORM_H
8 
9 #include <QObject>
10 #include <QScopedPointer>
11 
13 #include "gui/editors/form.h"
14 #include "gui/swiftguiexport.h"
16 #include "misc/aviation/livery.h"
17 #include "misc/statusmessagelist.h"
18 #include "misc/variant.h"
19 
20 class QWidget;
21 
22 namespace Ui
23 {
24  class CLiveryForm;
25 }
26 namespace swift::gui::editors
27 {
32  {
33  Q_OBJECT
34 
35  public:
37  explicit CLiveryForm(QWidget *parent = nullptr);
38 
40  virtual ~CLiveryForm() override;
41 
43  swift::misc::aviation::CLivery getValue() const;
44 
46  swift::misc::aviation::CAirlineIcaoCode getValueAirlineIcao() const;
47 
49  swift::misc::CStatusMessageList validateAirlineIcao() const;
50 
52  void allowDrop(bool allowDrop);
53 
55  bool isDropAllowed() const;
56 
59  virtual void setReadOnly(bool readonly) override;
60  virtual void setSelectOnly() override;
61  virtual swift::misc::CStatusMessageList validate(bool withNestedForms) const override;
63 
65  void clear();
66 
68  bool setValue(const swift::misc::aviation::CLivery &livery);
69 
71  void resetValue();
72 
73  protected:
75  virtual void jsonPasted(const QString &json) override;
76 
77  private:
79  void onDroppedLivery(const swift::misc::CVariant &variantDropped);
80 
82  void onAirlineChanged(const swift::misc::aviation::CAirlineIcaoCode &code);
83 
85  void onIdEntered();
86 
88  void setTemporaryLivery();
89 
91  void searchForColor();
92 
93  QScopedPointer<Ui::CLiveryForm> ui;
94  swift::misc::aviation::CLivery m_originalLivery;
96  };
97 } // namespace swift::gui::editors
98 
99 #endif // SWIFT_GUI_EDITORS_LIVERYFORM_H
Form base class.
Definition: form.h:27
Status messages, e.g. from Core -> GUI.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Definition: variant.h:66
Value object for ICAO classification.
Value object encapsulating information about an airpot.
Definition: livery.h:29
#define SWIFT_GUI_EXPORT
Export a class or function from the library.