Files
bar/include/services/notificationController.hpp

35 lines
1.0 KiB
C++

#pragma once
#include <cstdint>
#include <map>
#include <memory>
#include <sys/types.h>
#include <vector>
#include "services/dbus/messages.hpp"
#include "widgets/notification/baseNotification.hpp"
#include "gdkmm/monitor.h"
class NotificationController {
static std::shared_ptr<NotificationController> instance;
public:
static std::shared_ptr<NotificationController> getInstance() {
if (!NotificationController::instance) {
NotificationController::instance = std::shared_ptr<NotificationController>(new NotificationController());
}
return NotificationController::instance;
}
void showSpotifyNotification(MprisPlayer2Message mpris);
void showNotificationOnAllMonitors(NotifyMessage notify);
private:
uint64_t globalNotificationId = 1;
std::map<uint64_t, std::vector<std::shared_ptr<BaseNotification>>> activeNotifications;
NotificationController();
std::vector<std::shared_ptr<Gdk::Monitor>> activeMonitors;
void closeNotification(uint64_t notificationId);
};