mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-01-29 06:10:52 +00:00
42 lines
959 B
C++
42 lines
959 B
C++
#include <QObject>
|
|
#include <QSystemTrayIcon>
|
|
|
|
#include "enums.h"
|
|
|
|
class QMenu;
|
|
class QAction;
|
|
class QActionGroup;
|
|
|
|
class TrayIconManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit TrayIconManager(QObject *parent = nullptr);
|
|
|
|
void updateBatteryStatus(const QString &status);
|
|
|
|
void updateNoiseControlState(AirpodsTrayApp::Enums::NoiseControlMode);
|
|
|
|
void updateConversationalAwareness(bool enabled);
|
|
|
|
void showNotification(const QString &title, const QString &message);
|
|
|
|
private slots:
|
|
void onTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
|
|
|
|
private:
|
|
QSystemTrayIcon *trayIcon;
|
|
QMenu *trayMenu;
|
|
QAction *caToggleAction;
|
|
QActionGroup *noiseControlGroup;
|
|
|
|
void setupMenuActions();
|
|
|
|
void updateIconFromBattery(const QString &status);
|
|
|
|
signals:
|
|
void trayClicked();
|
|
void noiseControlChanged(AirpodsTrayApp::Enums::NoiseControlMode);
|
|
void conversationalAwarenessToggled(bool enabled);
|
|
}; |