tdesktop/Telegram/SourceFiles/media/view/media_view_open_common.h

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