tray.h 901 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_tray.h"
  9. namespace Core {
  10. class Tray final {
  11. public:
  12. Tray();
  13. void create();
  14. void updateMenuText();
  15. void updateIconCounters();
  16. [[nodiscard]] rpl::producer<> aboutToShowRequests() const;
  17. [[nodiscard]] rpl::producer<> showFromTrayRequests() const;
  18. [[nodiscard]] rpl::producer<> hideToTrayRequests() const;
  19. [[nodiscard]] bool has() const;
  20. private:
  21. void rebuildMenu();
  22. void toggleSoundNotifications();
  23. Platform::Tray _tray;
  24. bool _activeForTrayIconAction = false;
  25. crl::time _lastTrayClickTime = 0;
  26. rpl::event_stream<> _textUpdates;
  27. rpl::event_stream<> _minimizeMenuItemClicks;
  28. };
  29. } // namespace Core