swift
atcbuttoncomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2018 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_COMPONENTS_ATCBUTTONCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_ATCBUTTONCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QScopedPointer>
11 
14 
15 namespace Ui
16 {
17  class CAtcButtonComponent;
18 }
19 namespace swift::gui::components
20 {
22  class CAtcButtonComponent : public QFrame
23  {
24  Q_OBJECT
25 
26  public:
28  explicit CAtcButtonComponent(QWidget *parent = nullptr);
29 
31  virtual ~CAtcButtonComponent();
32 
34  void updateStations();
35 
37  void setMaxNumber(int number) { m_maxNumber = number; }
38 
40  void setWithIcons(bool withIcons) { m_withIcons = withIcons; }
41 
43  int getMaxNumber() const { return m_maxNumber; }
44 
46  void setRowsColumns(int rows, int cols, bool setMaxElements);
47 
49  void setIgnoreNonAtcCallsigns(bool ignore) { m_ignoreNonAtc = ignore; }
50 
52  void setBackgroundUpdates(bool backgroundUpdates) { m_backgroundUpdates = backgroundUpdates; }
53 
54  signals:
57 
58  private:
60  void onChangedAtcStations();
61 
63  void onConnectionStatusChanged(const swift::misc::network::CConnectionStatus &from,
65 
67  void onButtonClicked();
68 
69  QScopedPointer<Ui::CAtcButtonComponent> ui;
70  bool m_withIcons = true;
71  bool m_ignoreNonAtc = true;
72  bool m_backgroundUpdates = true;
73  int m_maxNumber = 8;
74  int m_rows = 2;
75  int m_cols = 4;
76  };
77 } // namespace swift::gui::components
78 
79 #endif // SWIFT_GUI_COMPONENTS_ATCBUTTONCOMPONENT_H
CAtcButtonComponent(QWidget *parent=nullptr)
Ctor.
void requestAtcStation(const swift::misc::aviation::CAtcStation &station)
ATC station clicked.
void setIgnoreNonAtcCallsigns(bool ignore)
Ignore non ATC callsigns.
void setBackgroundUpdates(bool backgroundUpdates)
Background updates.
void setRowsColumns(int rows, int cols, bool setMaxElements)
Rows/columns.
void setWithIcons(bool withIcons)
With icons.
Value object encapsulating information about an ATC station.
Definition: atcstation.h:38
Value object encapsulating information about a connection status.
High level reusable GUI components.
Definition: aboutdialog.cpp:13