swift
infobarstatuscomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 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_INFOBARSTATUSCOMPONENT_H
7 #define SWIFT_GUI_INFOBARSTATUSCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QObject>
11 #include <QScopedPointer>
12 #include <QString>
13 
14 #include "core/actionbind.h"
15 #include "gui/swiftguiexport.h"
17 #include "misc/digestsignal.h"
20 
21 class QPoint;
22 
23 namespace Ui
24 {
25  class CInfoBarStatusComponent;
26 }
27 namespace swift::gui::components
28 {
31  {
32  Q_OBJECT
33 
34  public:
36  explicit CInfoBarStatusComponent(QWidget *parent = nullptr);
37 
39  virtual ~CInfoBarStatusComponent() override;
40 
42  void setDBusStatus(bool dbus);
43 
45  void setDBusTooltip(const QString &tooltip);
46 
48  void setSpacing(int spacing);
49 
50  signals:
53 
54  protected:
56  virtual void resizeEvent(QResizeEvent *event) override;
57 
58  private:
59  QScopedPointer<Ui::CInfoBarStatusComponent> ui;
60  swift::core::CActionBind m_actionPtt { swift::misc::input::pttHotkeyAction(),
61  swift::misc::input::pttHotkeyIcon(), this,
62  &CInfoBarStatusComponent::onPttChanged };
63 
64  swift::misc::CDigestSignal m_dsResize { this, &CInfoBarStatusComponent::adjustTextSize,
65  std::chrono::seconds { 1 }, 50 };
66 
68  static bool isAudioAvailableAndNotMuted();
69 
71  void initLeds();
72 
74  void adjustTextSize();
75 
77  void onSimulatorStatusChanged(int status);
78 
80  void onNetworkConnectionChanged(const swift::misc::network::CConnectionStatus &from,
82 
84  void onOutputMuteChanged(bool muted);
85 
87  void onAudioStarted(const swift::misc::audio::CAudioDeviceInfo &input,
89 
91  void onAudioStopped();
92 
94  void onMapperReady();
95 
97  void onPttChanged(bool enabled);
98 
100  void updateValues();
101 
103  void updateSpacing();
104  };
105 } // namespace swift::gui::components
106 
107 #endif // SWIFT_GUI_INFOBARSTATUSCOMPONENT_H
CActionBind binds a member function to an action.
Definition: actionbind.h:18
Info bar displaying status (Network, Simulator, DBus)
Receive 1..n signals, collect them over time, and resend afer n milliseconds.
Definition: digestsignal.h:18
Value object encapsulating information of a audio device.
Value object encapsulating information about a connection status.
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.