swift
infobarwebreadersstatuscomponent.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_INFOBARWEBREADERSSTATUSCOMPONENT_H
7 #define SWIFT_GUI_INFOBARWEBREADERSSTATUSCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QList>
11 #include <QObject>
12 #include <QScopedPointer>
13 #include <QTimer>
14 
15 #include "gui/led.h"
16 #include "gui/swiftguiexport.h"
18 #include "misc/network/url.h"
19 
20 namespace Ui
21 {
22  class CInfoBarWebReadersStatusComponent;
23 }
24 namespace swift::gui
25 {
26  class CLedWidget;
27  namespace components
28  {
31  {
32  Q_OBJECT
33 
34  public:
37 
39  virtual void consolidationRunning(bool running);
40 
41  protected:
43  explicit CInfoBarWebReadersStatusBase(QWidget *parent = nullptr);
44 
46  void initLeds();
47 
49  void init();
50 
52  void setLedReadStates(const QList<CLedWidget *> &leds,
54 
56  void setLedReadState(CLedWidget *led, swift::misc::network::CEntityFlags::ReadState readState);
57 
59  QList<CLedWidget *> entitiesToLeds(swift::misc::network::CEntityFlags::Entity entities) const;
60 
62  bool hasAllData() const;
63 
65  void setLeds(swift::gui::CLedWidget *ledDataReady, CLedWidget *ledConsolidation,
66  swift::gui::CLedWidget *ledIcaoAircraft, swift::gui::CLedWidget *ledIcaoAirline,
67  swift::gui::CLedWidget *ledCountries, swift::gui::CLedWidget *ledDistributors,
68  swift::gui::CLedWidget *ledLiveries, swift::gui::CLedWidget *ledModels);
69 
71  void dataRead(swift::misc::network::CEntityFlags::Entity entities,
73 
75  void checkData();
76 
78  virtual void showConsolidationStatus(bool show);
79 
80  private:
81  QTimer m_timer;
82  swift::gui::CLedWidget *m_ledDataReady = nullptr;
83  swift::gui::CLedWidget *m_ledConsolidation = nullptr;
84  swift::gui::CLedWidget *m_ledIcaoAircraft = nullptr;
85  swift::gui::CLedWidget *m_ledIcaoAirline = nullptr;
86  swift::gui::CLedWidget *m_ledCountries = nullptr;
87  swift::gui::CLedWidget *m_ledDistributors = nullptr;
88  swift::gui::CLedWidget *m_ledLiveries = nullptr;
89  swift::gui::CLedWidget *m_ledModels = nullptr;
90  };
91 
94  {
95  Q_OBJECT
96 
97  public:
99  explicit CInfoBarWebReadersStatusComponent(QWidget *parent = nullptr);
100 
102  virtual ~CInfoBarWebReadersStatusComponent() override;
103 
105  virtual void showConsolidationStatus(bool show) override;
106 
107  private:
108  QScopedPointer<Ui::CInfoBarWebReadersStatusComponent> ui;
109  };
110  } // namespace components
111 } // namespace swift::gui
112 #endif // SWIFT_GUI_INFOBARWEBREADERSSTATUSCOMPONENT_H
Displaying an LED as widget. Non copyable.
Definition: led.h:29
Info bar displaying status of web readers(swift DB, ...)
Info bar displaying status of web readers(swift DB, ...)
GUI related classes.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.