swift
atcstationtreeview.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_VIEWS_ATCSTATIONTREEVIEW_H
7 #define SWIFT_GUI_VIEWS_ATCSTATIONTREEVIEW_H
8 
9 #include <QList>
10 #include <QMap>
11 #include <QModelIndex>
12 #include <QObject>
13 #include <QPoint>
14 #include <QTreeView>
15 
17 #include "gui/swiftguiexport.h"
20 #include "misc/digestsignal.h"
21 #include "misc/pq/frequency.h"
22 
23 namespace swift::gui
24 {
25  namespace models
26  {
27  class CAtcStationTreeModel;
28  class CColumns;
29  } // namespace models
30 
31  namespace views
32  {
35  {
36  Q_OBJECT
37 
38  public:
40  explicit CAtcStationTreeView(QWidget *parent = nullptr);
41 
43  void changedAtcStationConnectionStatus(const swift::misc::aviation::CAtcStation &station, bool added);
44 
46  void updateContainer(const swift::misc::aviation::CAtcStationList &stations);
47 
49  void clear();
50 
52  bool isEmpty() const;
53 
55  void setColumns(const models::CColumns &columns);
56 
58  void fullResizeToContents();
59 
60  signals:
63 
67 
70 
73 
74  private:
76  const models::CAtcStationTreeModel *stationModel() const;
77 
79  models::CAtcStationTreeModel *stationModel();
80 
82  void fullResizeToContentsImpl();
83 
85  swift::misc::aviation::CAtcStation selectedObject() const;
86 
88  swift::misc::aviation::CAtcStation selectedObject(const QModelIndex &index) const;
89 
91  QString suffixForIndex(const QModelIndex &index);
92 
94  void onExpanded(const QModelIndex &index);
95 
97  void onSelected(const QItemSelection &selected, const QItemSelection &deselected);
98 
100  void customMenu(const QPoint &point);
101 
103  void storeState();
104 
106  void restoreState();
107 
110  void tuneInAtcCom1();
111  void tuneInAtcCom2();
112  void requestTextMessage();
114 
115  swift::misc::CDigestSignal m_dsFullResize { this, &CAtcStationTreeView::fullResizeToContentsImpl,
116  std::chrono::milliseconds(1000), 25 };
117  QMap<QString, bool> m_expanded;
118  };
119  } // namespace views
120 } // namespace swift::gui
121 
122 #endif // SWIFT_GUI_VIEWS_ATCSTATIONTREEVIEW_H
Using this class provides a QTableView with the overlay functionality already integrated.
Header data for a table.
Definition: columns.h:160
void testRequestDummyAtcOnlineStations(int number)
Request some dummy ATC stations.
void objectSelected(const swift::misc::aviation::CAtcStation &station)
This object has been selected.
void requestComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, swift::misc::aviation::CComSystem::ComUnit unit)
Request COM frequency.
void requestTextMessageWidget(const swift::misc::aviation::CCallsign &callsign)
Request a text message to.
Receive 1..n signals, collect them over time, and resend afer n milliseconds.
Definition: digestsignal.h:18
Value object encapsulating information about an ATC station.
Definition: atcstation.h:38
Value object for a list of ATC stations.
Value object encapsulating information of a callsign.
Definition: callsign.h:30
GUI related classes.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.