tdesktop/Telegram/SourceFiles/iv/iv_instance.h

72 lines
1.5 KiB
C
Raw Normal View History

/*
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
2024-03-23 08:42:22 +00:00
#include "iv/iv_delegate.h"
namespace Main {
class Session;
class SessionShow;
} // namespace Main
2024-03-23 08:42:22 +00:00
namespace Window {
class SessionController;
} // namespace Window
namespace Iv {
class Data;
class Shown;
class Instance final {
public:
2024-03-23 08:42:22 +00:00
explicit Instance(not_null<Delegate*> delegate);
~Instance();
2024-03-23 08:42:22 +00:00
void show(
not_null<Window::SessionController*> controller,
not_null<Data*> data,
QString hash);
void show(
std::shared_ptr<Main::SessionShow> show,
not_null<Data*> data,
2023-12-05 07:54:46 +00:00
QString hash);
[[nodiscard]] bool hasActiveWindow(
not_null<Main::Session*> session) const;
2023-12-01 14:47:24 +00:00
bool closeActive();
bool minimizeActive();
void closeAll();
[[nodiscard]] rpl::lifetime &lifetime();
private:
2023-12-04 19:06:44 +00:00
void processOpenChannel(const QString &context);
void processJoinChannel(const QString &context);
2024-03-11 12:59:11 +00:00
void requestFull(not_null<Main::Session*> session, const QString &id);
2023-12-04 19:06:44 +00:00
2024-03-23 08:42:22 +00:00
const not_null<Delegate*> _delegate;
std::unique_ptr<Shown> _shown;
2023-12-04 19:06:44 +00:00
Main::Session *_shownSession = nullptr;
base::flat_set<not_null<Main::Session*>> _tracking;
2024-03-11 12:59:11 +00:00
base::flat_map<
not_null<Main::Session*>,
base::flat_set<not_null<ChannelData*>>> _joining;
base::flat_map<
not_null<Main::Session*>,
base::flat_set<QString>> _fullRequested;
rpl::lifetime _lifetime;
};
} // namespace Iv