2021-06-14 06:33:54 +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 "data/data_cloud_themes.h"
|
2023-06-05 12:10:34 +00:00
|
|
|
#include "data/data_stories.h"
|
2021-06-14 06:33:54 +00:00
|
|
|
|
|
|
|
class DocumentData;
|
|
|
|
class PeerData;
|
|
|
|
class PhotoData;
|
|
|
|
class HistoryItem;
|
|
|
|
|
2021-06-15 18:54:31 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
|
|
|
|
2021-06-14 06:33:54 +00:00
|
|
|
namespace Media::View {
|
|
|
|
|
|
|
|
struct OpenRequest {
|
|
|
|
public:
|
2021-06-14 06:21:56 +00:00
|
|
|
OpenRequest() {
|
|
|
|
}
|
|
|
|
|
2021-06-15 18:54:31 +00:00
|
|
|
OpenRequest(
|
|
|
|
Window::SessionController *controller,
|
|
|
|
not_null<PhotoData*> photo,
|
2022-10-11 15:08:19 +00:00
|
|
|
HistoryItem *item,
|
|
|
|
MsgId topicRootId)
|
2021-06-15 18:54:31 +00:00
|
|
|
: _controller(controller)
|
|
|
|
, _photo(photo)
|
2022-10-11 15:08:19 +00:00
|
|
|
, _item(item)
|
|
|
|
, _topicRootId(topicRootId) {
|
2021-06-14 06:33:54 +00:00
|
|
|
}
|
2021-06-15 18:54:31 +00:00
|
|
|
OpenRequest(
|
|
|
|
Window::SessionController *controller,
|
|
|
|
not_null<PhotoData*> photo,
|
|
|
|
not_null<PeerData*> peer)
|
|
|
|
: _controller(controller)
|
|
|
|
, _photo(photo)
|
2021-06-14 06:33:54 +00:00
|
|
|
, _peer(peer) {
|
|
|
|
}
|
|
|
|
|
2021-06-15 18:54:31 +00:00
|
|
|
OpenRequest(
|
|
|
|
Window::SessionController *controller,
|
|
|
|
not_null<DocumentData*> document,
|
2021-06-15 20:52:44 +00:00
|
|
|
HistoryItem *item,
|
2022-10-11 15:08:19 +00:00
|
|
|
MsgId topicRootId,
|
2022-02-16 07:46:31 +00:00
|
|
|
bool continueStreaming = false,
|
|
|
|
crl::time startTime = 0)
|
2021-06-15 18:54:31 +00:00
|
|
|
: _controller(controller)
|
|
|
|
, _document(document)
|
2021-06-15 20:52:44 +00:00
|
|
|
, _item(item)
|
2022-10-11 15:08:19 +00:00
|
|
|
, _topicRootId(topicRootId)
|
2022-02-16 07:46:31 +00:00
|
|
|
, _continueStreaming(continueStreaming)
|
|
|
|
, _startTime(startTime) {
|
2021-06-14 06:33:54 +00:00
|
|
|
}
|
|
|
|
OpenRequest(
|
2021-06-15 18:54:31 +00:00
|
|
|
Window::SessionController *controller,
|
2021-06-14 06:33:54 +00:00
|
|
|
not_null<DocumentData*> document,
|
|
|
|
const Data::CloudTheme &cloudTheme)
|
2021-06-15 18:54:31 +00:00
|
|
|
: _controller(controller)
|
|
|
|
, _document(document)
|
2021-06-14 06:33:54 +00:00
|
|
|
, _cloudTheme(cloudTheme) {
|
|
|
|
}
|
|
|
|
|
2023-05-26 07:21:19 +00:00
|
|
|
OpenRequest(
|
|
|
|
Window::SessionController *controller,
|
|
|
|
not_null<Data::Story*> story,
|
2023-06-05 12:10:34 +00:00
|
|
|
Data::StoriesContext context)
|
2023-05-26 07:21:19 +00:00
|
|
|
: _controller(controller)
|
|
|
|
, _story(story)
|
2023-06-05 12:10:34 +00:00
|
|
|
, _storiesContext(context) {
|
2023-05-26 07:21:19 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
[[nodiscard]] PeerData *peer() const {
|
2021-06-14 06:33:54 +00:00
|
|
|
return _peer;
|
|
|
|
}
|
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
[[nodiscard]] PhotoData *photo() const {
|
2021-06-14 06:33:54 +00:00
|
|
|
return _photo;
|
|
|
|
}
|
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
[[nodiscard]] HistoryItem *item() const {
|
2021-06-14 06:33:54 +00:00
|
|
|
return _item;
|
|
|
|
}
|
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
[[nodiscard]] MsgId topicRootId() const {
|
|
|
|
return _topicRootId;
|
|
|
|
}
|
|
|
|
|
|
|
|
[[nodiscard]] DocumentData *document() const {
|
2021-06-14 06:33:54 +00:00
|
|
|
return _document;
|
|
|
|
}
|
|
|
|
|
2023-05-26 07:21:19 +00:00
|
|
|
[[nodiscard]] Data::Story *story() const {
|
|
|
|
return _story;
|
|
|
|
}
|
2023-06-05 12:10:34 +00:00
|
|
|
[[nodiscard]] Data::StoriesContext storiesContext() const {
|
|
|
|
return _storiesContext;
|
2023-06-02 14:26:39 +00:00
|
|
|
}
|
2023-05-26 07:21:19 +00:00
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
[[nodiscard]] std::optional<Data::CloudTheme> cloudTheme() const {
|
2021-06-14 06:33:54 +00:00
|
|
|
return _cloudTheme;
|
|
|
|
}
|
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
[[nodiscard]] Window::SessionController *controller() const {
|
2021-06-15 18:54:31 +00:00
|
|
|
return _controller;
|
|
|
|
}
|
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
[[nodiscard]] bool continueStreaming() const {
|
2021-06-15 20:52:44 +00:00
|
|
|
return _continueStreaming;
|
|
|
|
}
|
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
[[nodiscard]] crl::time startTime() const {
|
2022-02-16 07:46:31 +00:00
|
|
|
return _startTime;
|
|
|
|
}
|
|
|
|
|
2021-06-14 06:33:54 +00:00
|
|
|
private:
|
2021-06-15 18:54:31 +00:00
|
|
|
Window::SessionController *_controller = nullptr;
|
2021-06-14 06:33:54 +00:00
|
|
|
DocumentData *_document = nullptr;
|
|
|
|
PhotoData *_photo = nullptr;
|
2023-05-26 07:21:19 +00:00
|
|
|
Data::Story *_story = nullptr;
|
2023-06-05 12:10:34 +00:00
|
|
|
Data::StoriesContext _storiesContext;
|
2021-06-14 06:33:54 +00:00
|
|
|
PeerData *_peer = nullptr;
|
|
|
|
HistoryItem *_item = nullptr;
|
2022-10-11 15:08:19 +00:00
|
|
|
MsgId _topicRootId = 0;
|
2021-06-14 06:33:54 +00:00
|
|
|
std::optional<Data::CloudTheme> _cloudTheme = std::nullopt;
|
2021-06-15 20:52:44 +00:00
|
|
|
bool _continueStreaming = false;
|
2022-02-16 07:46:31 +00:00
|
|
|
crl::time _startTime = 0;
|
2021-06-14 06:33:54 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Media::View
|