swift
aircrafticaoform.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_AIRCRAFTICAOFORM_H
7 #define SWIFT_GUI_EDITORS_AIRCRAFTICAOFORM_H
8 
9 #include <QObject>
10 #include <QScopedPointer>
11 
12 #include "gui/editors/form.h"
13 #include "gui/swiftguiexport.h"
15 #include "misc/statusmessagelist.h"
16 #include "misc/variant.h"
17 
18 namespace Ui
19 {
20  class CAircraftIcaoForm;
21 }
22 namespace swift::gui::editors
23 {
28  {
29  Q_OBJECT
30 
31  public:
33  explicit CAircraftIcaoForm(QWidget *parent = nullptr);
34 
36  virtual ~CAircraftIcaoForm() override;
37 
40 
42  void allowDrop(bool allowDrop);
43 
45  bool isDropAllowed() const;
46 
49  virtual void setReadOnly(bool readonly) override;
50  virtual void setSelectOnly() override;
51  virtual swift::misc::CStatusMessageList validate(bool nested = false) const override;
53 
55  void clear();
56 
58  void resetValue();
59 
60  public slots:
62  bool setValue(const swift::misc::aviation::CAircraftIcaoCode &icao);
63 
64  protected:
66  virtual void jsonPasted(const QString &json) override;
67 
68  private:
69  QScopedPointer<Ui::CAircraftIcaoForm> ui;
71 
73  void droppedCode(const swift::misc::CVariant &variantDropped);
74 
76  void idEntered();
77 
79  int getDbKeyFromGui() const;
80  };
81 } // namespace swift::gui::editors
82 
83 #endif // SWIFT_GUI_EDITORS_AIRCRAFTICAOFORM_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.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.