notifications_manager_win.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "platform/platform_notifications_manager.h"
  9. struct ToastActivation;
  10. namespace Platform {
  11. namespace Notifications {
  12. class Manager : public Window::Notifications::NativeManager {
  13. public:
  14. Manager(Window::Notifications::System *system);
  15. ~Manager();
  16. bool init();
  17. void clearNotification(NotificationId id);
  18. void handleActivation(const ToastActivation &activation);
  19. protected:
  20. void doShowNativeNotification(
  21. NotificationInfo &&info,
  22. Ui::PeerUserpicView &userpicView) override;
  23. void doClearAllFast() override;
  24. void doClearFromItem(not_null<HistoryItem*> item) override;
  25. void doClearFromTopic(not_null<Data::ForumTopic*> topic) override;
  26. void doClearFromHistory(not_null<History*> history) override;
  27. void doClearFromSession(not_null<Main::Session*> session) override;
  28. void onBeforeNotificationActivated(NotificationId id) override;
  29. void onAfterNotificationActivated(
  30. NotificationId id,
  31. not_null<Window::SessionController*> window) override;
  32. bool doSkipToast() const override;
  33. void doMaybePlaySound(Fn<void()> playSound) override;
  34. void doMaybeFlashBounce(Fn<void()> flashBounce) override;
  35. private:
  36. class Private;
  37. const std::unique_ptr<Private> _private;
  38. };
  39. } // namespace Notifications
  40. } // namespace Platform