File indexing completed on 2025-01-26 04:24:12

0001 #ifndef TOASTER_H
0002 #define TOASTER_H
0003 
0004 #include "libsnore/plugins/snorebackend.h"
0005 #include <QProcess>
0006 
0007 namespace SnorePlugin {
0008 
0009 class WindowsToast : public Snore::SnoreBackend
0010 {
0011     Q_OBJECT
0012     Q_INTERFACES(Snore::SnoreBackend)
0013     Q_PLUGIN_METADATA(IID "org.Snore.NotificationBackend/1.0" FILE "snore_plugin.json")
0014 public:
0015     WindowsToast() = default;
0016     ~WindowsToast() = default;
0017 
0018     virtual bool canCloseNotification() const override;
0019     int maxNumberOfActiveNotifications() const override;
0020 
0021     bool isReady() override;
0022 public Q_SLOTS:
0023     void slotNotify(Snore::Notification notification) override;
0024     void slotRegisterApplication(const Snore::Application &application) override;
0025     void slotCloseNotification(Snore::Notification notification) override;
0026 
0027 private:
0028     QString appId(const Snore::Application &application);
0029 
0030     QProcess *createProcess(Snore::Notification noti);
0031 
0032 };
0033 }
0034 
0035 #endif // TOASTER_H