swift
pilotform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2017 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_PILOTFORM_H
7 #define SWIFT_GUI_EDITORS_PILOTFORM_H
8 
9 #include <QFrame>
10 #include <QIntValidator>
11 #include <QScopedPointer>
12 
13 #include "gui/editors/form.h"
14 #include "gui/swiftguiexport.h"
16 #include "misc/network/user.h"
17 
18 namespace Ui
19 {
20  class CPilotForm;
21 }
22 namespace swift::gui::editors
23 {
26  {
27  Q_OBJECT
28 
29  public:
31  explicit CPilotForm(QWidget *parent = nullptr);
32 
34  virtual ~CPilotForm() override;
35 
37  void setVatsimValidation(bool vatsim);
38 
40  swift::misc::network::CUser getUser() const;
41 
43  void setUser(const swift::misc::network::CUser &user);
44 
46  void clear();
47 
50  virtual void setReadOnly(bool readonly) override;
51  virtual swift::misc::CStatusMessageList validate(bool nested = false) const override;
53 
54  private:
56  void unhidePassword();
57 
59  void doValidation();
60 
61  QScopedPointer<Ui::CPilotForm> ui;
62  QScopedPointer<QIntValidator> m_vatsimIntValidator { new QIntValidator(100000, 9999999, this) };
63  bool m_vatsim = false;
64  };
65 } // namespace swift::gui::editors
66 
67 #endif // SWIFT_GUI_EDITORS_PILOTFORM_H
Form base class.
Definition: form.h:27
Pilot form (name, homebase)
Definition: pilotform.h:26
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of a user.
Definition: user.h:28
#define SWIFT_GUI_EXPORT
Export a class or function from the library.