2022-03-23 15:59:53 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "platform/platform_tray.h"
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
class Tray final {
|
|
|
|
public:
|
|
|
|
Tray();
|
|
|
|
|
2022-04-20 22:39:01 +00:00
|
|
|
void create();
|
|
|
|
void updateMenuText();
|
|
|
|
void updateIconCounters();
|
|
|
|
|
|
|
|
[[nodiscard]] rpl::producer<> aboutToShowRequests() const;
|
|
|
|
[[nodiscard]] rpl::producer<> showFromTrayRequests() const;
|
|
|
|
[[nodiscard]] rpl::producer<> hideToTrayRequests() const;
|
|
|
|
|
2022-06-23 05:29:11 +00:00
|
|
|
[[nodiscard]] bool has() const;
|
|
|
|
|
2022-03-23 15:59:53 +00:00
|
|
|
private:
|
2022-04-20 22:39:01 +00:00
|
|
|
void rebuildMenu();
|
|
|
|
void toggleSoundNotifications();
|
|
|
|
|
2022-03-23 15:59:53 +00:00
|
|
|
Platform::Tray _tray;
|
|
|
|
|
2022-04-20 22:39:01 +00:00
|
|
|
bool _activeForTrayIconAction = false;
|
2022-04-18 13:34:59 +00:00
|
|
|
crl::time _lastTrayClickTime = 0;
|
|
|
|
|
2022-04-20 22:39:01 +00:00
|
|
|
rpl::event_stream<> _textUpdates;
|
|
|
|
rpl::event_stream<> _minimizeMenuItemClicks;
|
|
|
|
|
2022-03-23 15:59:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Core
|