2016-09-27 16:20:49 +02:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 11:23:14 +01:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-09-27 16:20:49 +02:00
|
|
|
|
2018-01-03 11:23:14 +01:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-09-27 16:20:49 +02:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2018-01-13 13:45:11 +01:00
|
|
|
#include "history/view/history_view_object.h"
|
2022-09-30 16:49:48 +02:00
|
|
|
#include "ui/chat/message_bubble.h"
|
2019-09-13 14:22:54 +02:00
|
|
|
#include "ui/rect_part.h"
|
2018-01-11 20:33:26 +01:00
|
|
|
|
2019-09-13 08:06:02 +02:00
|
|
|
class History;
|
2017-12-18 16:44:50 +01:00
|
|
|
struct HistoryMessageEdited;
|
2018-01-13 13:45:11 +01:00
|
|
|
struct TextSelection;
|
2017-12-18 16:44:50 +01:00
|
|
|
|
2017-09-04 13:40:02 +02:00
|
|
|
namespace base {
|
|
|
|
template <typename Enum>
|
|
|
|
class enum_mask;
|
|
|
|
} // namespace base
|
|
|
|
|
|
|
|
namespace Storage {
|
2018-03-09 21:48:47 +01:00
|
|
|
enum class SharedMediaType : signed char;
|
2017-09-04 13:40:02 +02:00
|
|
|
using SharedMediaTypesMask = base::enum_mask<SharedMediaType>;
|
|
|
|
} // namespace Storage
|
|
|
|
|
2020-06-16 18:53:44 +02:00
|
|
|
namespace Lottie {
|
2020-07-02 12:44:12 +02:00
|
|
|
struct ColorReplacements;
|
2020-06-16 18:53:44 +02:00
|
|
|
} // namespace Lottie
|
|
|
|
|
2021-08-19 16:22:12 +02:00
|
|
|
namespace Ui {
|
|
|
|
struct BubbleSelectionInterval;
|
2021-08-26 17:02:21 +02:00
|
|
|
struct ChatPaintContext;
|
2022-12-12 19:57:17 +01:00
|
|
|
class SpoilerAnimation;
|
2021-08-19 16:22:12 +02:00
|
|
|
} // namespace Ui
|
|
|
|
|
2022-09-30 21:03:44 +02:00
|
|
|
namespace Images {
|
|
|
|
struct CornersMaskRef;
|
|
|
|
} // namespace Images
|
|
|
|
|
2018-01-27 14:59:24 +01:00
|
|
|
namespace HistoryView {
|
2019-08-02 15:21:09 +02:00
|
|
|
|
2018-01-27 14:59:24 +01:00
|
|
|
enum class PointState : char;
|
|
|
|
enum class CursorState : char;
|
|
|
|
enum class InfoDisplayType : char;
|
|
|
|
struct TextState;
|
|
|
|
struct StateRequest;
|
2022-12-12 19:57:17 +01:00
|
|
|
struct MediaSpoiler;
|
2022-08-04 12:35:08 +02:00
|
|
|
class StickerPlayer;
|
2019-09-13 08:06:02 +02:00
|
|
|
class Element;
|
2023-10-31 19:37:59 +01:00
|
|
|
struct SelectedQuote;
|
2018-01-27 14:59:24 +01:00
|
|
|
|
2021-08-26 17:02:21 +02:00
|
|
|
using PaintContext = Ui::ChatPaintContext;
|
|
|
|
|
2022-09-30 16:49:48 +02:00
|
|
|
enum class MediaInBubbleState : uchar {
|
2016-09-28 12:15:03 +02:00
|
|
|
None,
|
|
|
|
Top,
|
|
|
|
Middle,
|
|
|
|
Bottom,
|
2016-09-27 16:20:49 +02:00
|
|
|
};
|
|
|
|
|
2021-11-18 13:03:12 +01:00
|
|
|
[[nodiscard]] TimeId DurationForTimestampLinks(
|
|
|
|
not_null<DocumentData*> document);
|
|
|
|
[[nodiscard]] QString TimestampLinkBase(
|
2019-12-25 16:20:02 +01:00
|
|
|
not_null<DocumentData*> document,
|
|
|
|
FullMsgId context);
|
2021-11-18 13:03:12 +01:00
|
|
|
|
|
|
|
[[nodiscard]] TimeId DurationForTimestampLinks(
|
|
|
|
not_null<WebPageData*> webpage);
|
|
|
|
[[nodiscard]] QString TimestampLinkBase(
|
|
|
|
not_null<WebPageData*> webpage,
|
|
|
|
FullMsgId context);
|
|
|
|
|
2019-12-27 11:41:30 +01:00
|
|
|
[[nodiscard]] TextWithEntities AddTimestampLinks(
|
|
|
|
TextWithEntities text,
|
|
|
|
TimeId duration,
|
|
|
|
const QString &base);
|
2019-12-25 16:20:02 +01:00
|
|
|
|
2022-12-12 19:57:17 +01:00
|
|
|
class Media : public Object, public base::has_weak_ptr {
|
2016-09-27 16:20:49 +02:00
|
|
|
public:
|
2020-08-24 15:59:44 +02:00
|
|
|
explicit Media(not_null<Element*> parent) : _parent(parent) {
|
2016-09-27 16:20:49 +02:00
|
|
|
}
|
|
|
|
|
2022-12-09 18:35:45 +01:00
|
|
|
[[nodiscard]] not_null<Element*> parent() const;
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] not_null<History*> history() const;
|
2019-01-03 13:36:01 +01:00
|
|
|
|
2019-04-08 17:10:06 +02:00
|
|
|
[[nodiscard]] virtual TextForMimeData selectedText(
|
2019-01-29 17:26:19 +01:00
|
|
|
TextSelection selection) const {
|
2023-10-11 19:49:26 +02:00
|
|
|
return {};
|
|
|
|
}
|
2023-10-31 19:37:59 +01:00
|
|
|
[[nodiscard]] virtual SelectedQuote selectedQuote(
|
|
|
|
TextSelection selection) const;
|
2023-10-24 11:46:43 +02:00
|
|
|
[[nodiscard]] virtual TextSelection selectionFromQuote(
|
2023-10-31 19:37:59 +01:00
|
|
|
not_null<HistoryItem*> item,
|
2023-10-24 11:46:43 +02:00
|
|
|
const TextWithEntities "e) const {
|
|
|
|
return {};
|
|
|
|
}
|
2016-09-27 16:20:49 +02:00
|
|
|
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool isDisplayed() const;
|
2017-12-13 19:10:48 +01:00
|
|
|
virtual void updateNeedBubbleState() {
|
2016-09-27 16:20:49 +02:00
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool hasTextForCopy() const {
|
2016-09-27 16:20:49 +02:00
|
|
|
return false;
|
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool hideMessageText() const {
|
2018-01-18 14:59:22 +01:00
|
|
|
return true;
|
|
|
|
}
|
2023-04-14 11:52:49 +02:00
|
|
|
[[nodiscard]] virtual bool hideServiceText() const {
|
|
|
|
return false;
|
|
|
|
}
|
2023-10-06 09:15:26 +02:00
|
|
|
[[nodiscard]] virtual bool hideFromName() const {
|
|
|
|
return false;
|
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool allowsFastShare() const {
|
2017-07-11 19:11:06 +02:00
|
|
|
return false;
|
|
|
|
}
|
2018-01-17 17:21:01 +01:00
|
|
|
virtual void refreshParentId(not_null<HistoryItem*> realParent) {
|
2017-06-24 12:32:30 +02:00
|
|
|
}
|
2021-09-03 12:17:07 +02:00
|
|
|
virtual void drawHighlight(
|
|
|
|
Painter &p,
|
|
|
|
const PaintContext &context,
|
|
|
|
int top) const {
|
2020-12-30 09:55:11 +01:00
|
|
|
}
|
2021-08-20 12:12:07 +02:00
|
|
|
virtual void draw(Painter &p, const PaintContext &context) const = 0;
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual PointState pointState(QPoint point) const;
|
|
|
|
[[nodiscard]] virtual TextState textState(
|
|
|
|
QPoint point,
|
|
|
|
StateRequest request) const = 0;
|
2017-06-21 23:38:31 +02:00
|
|
|
virtual void updatePressed(QPoint point) {
|
2017-02-10 23:37:37 +01:00
|
|
|
}
|
2016-09-27 16:20:49 +02:00
|
|
|
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual Storage::SharedMediaTypesMask sharedMediaTypes() const;
|
2017-05-18 14:37:06 +02:00
|
|
|
|
2016-09-27 16:20:49 +02:00
|
|
|
// if we are in selecting items mode perhaps we want to
|
|
|
|
// toggle selection instead of activating the pressed link
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool toggleSelectionByHandlerClick(
|
2017-10-13 21:07:04 +02:00
|
|
|
const ClickHandlerPtr &p) const = 0;
|
2023-11-01 06:17:08 +01:00
|
|
|
[[nodiscard]] virtual bool allowTextSelectionByHandler(
|
|
|
|
const ClickHandlerPtr &p) const;
|
2016-09-27 16:20:49 +02:00
|
|
|
|
2017-10-13 21:07:04 +02:00
|
|
|
[[nodiscard]] virtual TextSelection adjustSelection(
|
|
|
|
TextSelection selection,
|
|
|
|
TextSelectType type) const {
|
2016-09-27 16:20:49 +02:00
|
|
|
return selection;
|
|
|
|
}
|
2017-10-13 21:07:04 +02:00
|
|
|
[[nodiscard]] virtual uint16 fullSelectionLength() const {
|
2017-06-23 21:28:42 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2017-10-13 21:07:04 +02:00
|
|
|
[[nodiscard]] TextSelection skipSelection(
|
2018-01-13 13:45:11 +01:00
|
|
|
TextSelection selection) const;
|
2017-10-13 21:07:04 +02:00
|
|
|
[[nodiscard]] TextSelection unskipSelection(
|
2018-01-13 13:45:11 +01:00
|
|
|
TextSelection selection) const;
|
2016-09-27 16:20:49 +02:00
|
|
|
|
2020-10-06 20:27:26 +02:00
|
|
|
[[nodiscard]] virtual auto getBubbleSelectionIntervals(
|
|
|
|
TextSelection selection) const
|
2021-08-19 16:22:12 +02:00
|
|
|
-> std::vector<Ui::BubbleSelectionInterval>;
|
2020-10-06 20:27:26 +02:00
|
|
|
|
2016-09-27 16:20:49 +02:00
|
|
|
// if we press and drag this link should we drag the item
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool dragItemByHandler(
|
|
|
|
const ClickHandlerPtr &p) const = 0;
|
2016-09-27 16:20:49 +02:00
|
|
|
|
|
|
|
virtual void clickHandlerActiveChanged(const ClickHandlerPtr &p, bool active) {
|
|
|
|
}
|
|
|
|
virtual void clickHandlerPressedChanged(const ClickHandlerPtr &p, bool pressed) {
|
|
|
|
}
|
|
|
|
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool uploading() const {
|
2016-09-27 16:20:49 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual PhotoData *getPhoto() const {
|
2017-12-15 20:05:10 +01:00
|
|
|
return nullptr;
|
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual DocumentData *getDocument() const {
|
2016-09-27 16:20:49 +02:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-01-21 15:49:42 +01:00
|
|
|
void playAnimation() {
|
|
|
|
playAnimation(false);
|
2016-09-27 16:20:49 +02:00
|
|
|
}
|
2018-01-21 15:49:42 +01:00
|
|
|
void autoplayAnimation() {
|
|
|
|
playAnimation(true);
|
2016-09-27 16:20:49 +02:00
|
|
|
}
|
2018-01-21 15:49:42 +01:00
|
|
|
virtual void stopAnimation() {
|
2017-05-12 19:44:18 +02:00
|
|
|
}
|
2020-06-16 18:53:44 +02:00
|
|
|
virtual void stickerClearLoopPlayed() {
|
2019-08-01 14:55:14 +02:00
|
|
|
}
|
2022-08-04 12:35:08 +02:00
|
|
|
virtual std::unique_ptr<StickerPlayer> stickerTakePlayer(
|
2020-07-02 12:44:12 +02:00
|
|
|
not_null<DocumentData*> data,
|
|
|
|
const Lottie::ColorReplacements *replacements);
|
2020-06-04 15:26:06 +02:00
|
|
|
virtual void checkAnimation() {
|
2019-07-30 17:46:13 +02:00
|
|
|
}
|
2016-09-27 16:20:49 +02:00
|
|
|
|
2020-10-29 16:21:16 +01:00
|
|
|
[[nodiscard]] virtual QSize sizeForGroupingOptimal(int maxWidth) const {
|
2020-10-16 19:48:27 +02:00
|
|
|
Unexpected("Grouping method call.");
|
|
|
|
}
|
2020-10-29 16:21:16 +01:00
|
|
|
[[nodiscard]] virtual QSize sizeForGrouping(int width) const {
|
2017-12-13 19:10:48 +01:00
|
|
|
Unexpected("Grouping method call.");
|
|
|
|
}
|
|
|
|
virtual void drawGrouped(
|
|
|
|
Painter &p,
|
2021-08-20 12:12:07 +02:00
|
|
|
const PaintContext &context,
|
2017-12-13 19:10:48 +01:00
|
|
|
const QRect &geometry,
|
2019-12-20 15:13:55 +01:00
|
|
|
RectParts sides,
|
2022-10-03 10:41:51 +02:00
|
|
|
Ui::BubbleRounding rounding,
|
2020-12-30 09:55:11 +01:00
|
|
|
float64 highlightOpacity,
|
2017-12-13 19:10:48 +01:00
|
|
|
not_null<uint64*> cacheKey,
|
2020-10-29 17:12:43 +01:00
|
|
|
not_null<QPixmap*> cache) const {
|
2017-12-13 19:10:48 +01:00
|
|
|
Unexpected("Grouping method call.");
|
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual TextState getStateGrouped(
|
2018-01-13 13:45:11 +01:00
|
|
|
const QRect &geometry,
|
2019-12-20 15:13:55 +01:00
|
|
|
RectParts sides,
|
2018-01-13 13:45:11 +01:00
|
|
|
QPoint point,
|
2020-10-29 17:12:43 +01:00
|
|
|
StateRequest request) const;
|
2017-12-13 19:10:48 +01:00
|
|
|
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool animating() const {
|
2016-09-27 16:20:49 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual TextWithEntities getCaption() const {
|
2016-09-27 16:20:49 +02:00
|
|
|
return TextWithEntities();
|
|
|
|
}
|
2022-12-12 19:57:17 +01:00
|
|
|
virtual void hideSpoilers() {
|
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool needsBubble() const = 0;
|
2022-10-04 09:10:17 +02:00
|
|
|
[[nodiscard]] virtual bool unwrapped() const {
|
|
|
|
return false;
|
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool customInfoLayout() const = 0;
|
2021-12-31 00:17:34 +01:00
|
|
|
[[nodiscard]] virtual QRect contentRectForReactions() const {
|
|
|
|
return QRect(0, 0, width(), height());
|
|
|
|
}
|
|
|
|
[[nodiscard]] virtual auto reactionButtonCenterOverride() const
|
|
|
|
-> std::optional<int> {
|
|
|
|
return std::nullopt;
|
2021-12-28 14:46:43 +01:00
|
|
|
}
|
2022-01-11 15:13:04 +01:00
|
|
|
[[nodiscard]] virtual QPoint resolveCustomInfoRightBottom() const {
|
|
|
|
return QPoint();
|
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual QMargins bubbleMargins() const {
|
2016-09-27 16:20:49 +02:00
|
|
|
return QMargins();
|
|
|
|
}
|
|
|
|
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool overrideEditedDate() const {
|
2017-12-16 17:32:10 +01:00
|
|
|
return false;
|
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual HistoryMessageEdited *displayedEditBadge() const {
|
2017-12-16 17:32:10 +01:00
|
|
|
Unexpected("displayedEditBadge() on non-grouped media.");
|
|
|
|
}
|
|
|
|
|
2017-04-30 15:04:38 +02:00
|
|
|
// An attach media in a web page can provide an
|
|
|
|
// additional text to be displayed below the attach.
|
|
|
|
// For example duration / progress for video messages.
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual QString additionalInfoString() const {
|
2017-04-30 15:04:38 +02:00
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2016-09-28 12:15:03 +02:00
|
|
|
void setInBubbleState(MediaInBubbleState state) {
|
|
|
|
_inBubbleState = state;
|
2016-09-27 16:20:49 +02:00
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] MediaInBubbleState inBubbleState() const {
|
2016-09-28 12:15:03 +02:00
|
|
|
return _inBubbleState;
|
2016-09-27 16:20:49 +02:00
|
|
|
}
|
2022-09-30 16:49:48 +02:00
|
|
|
void setBubbleRounding(Ui::BubbleRounding rounding) {
|
|
|
|
_bubbleRounding = rounding;
|
|
|
|
}
|
|
|
|
[[nodiscard]] Ui::BubbleRounding bubbleRounding() const {
|
|
|
|
return _bubbleRounding;
|
|
|
|
}
|
2022-09-30 21:03:44 +02:00
|
|
|
[[nodiscard]] Ui::BubbleRounding adjustedBubbleRounding(
|
|
|
|
RectParts square = {}) const;
|
|
|
|
[[nodiscard]] Ui::BubbleRounding adjustedBubbleRoundingWithCaption(
|
|
|
|
const Ui::Text::String &caption) const;
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] bool isBubbleTop() const {
|
|
|
|
return (_inBubbleState == MediaInBubbleState::Top)
|
|
|
|
|| (_inBubbleState == MediaInBubbleState::None);
|
2016-09-27 16:20:49 +02:00
|
|
|
}
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] bool isBubbleBottom() const {
|
|
|
|
return (_inBubbleState == MediaInBubbleState::Bottom)
|
|
|
|
|| (_inBubbleState == MediaInBubbleState::None);
|
2016-09-27 16:20:49 +02:00
|
|
|
}
|
2020-09-03 09:19:02 +02:00
|
|
|
[[nodiscard]] bool isRoundedInBubbleBottom() const;
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool skipBubbleTail() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sometimes webpages can force the bubble to fit their size instead of
|
|
|
|
// allowing message text to be as wide as possible (like wallpapers).
|
|
|
|
[[nodiscard]] virtual bool enforceBubbleWidth() const {
|
2016-11-18 17:27:47 +01:00
|
|
|
return false;
|
|
|
|
}
|
2016-09-27 16:20:49 +02:00
|
|
|
|
2018-01-13 13:45:11 +01:00
|
|
|
// Sometimes click on media in message is overloaded by the message:
|
2016-09-29 21:42:14 +02:00
|
|
|
// (for example it can open a link or a game instead of opening media)
|
|
|
|
// But the overloading click handler should be used only when media
|
2018-01-13 13:45:11 +01:00
|
|
|
// is already loaded (not a photo or GIF waiting for load with auto
|
2016-09-29 21:42:14 +02:00
|
|
|
// load being disabled - in such case media should handle the click).
|
2019-01-29 17:26:19 +01:00
|
|
|
[[nodiscard]] virtual bool isReadyForOpen() const {
|
2016-09-29 21:42:14 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-01-24 09:49:12 +01:00
|
|
|
struct BubbleRoll {
|
|
|
|
float64 rotate = 0.;
|
|
|
|
float64 scale = 1.;
|
|
|
|
|
|
|
|
explicit operator bool() const {
|
|
|
|
return (rotate != 0.) || (scale != 1.);
|
|
|
|
}
|
|
|
|
};
|
2020-01-24 10:50:20 +01:00
|
|
|
[[nodiscard]] virtual BubbleRoll bubbleRoll() const {
|
2020-01-24 09:49:12 +01:00
|
|
|
return BubbleRoll();
|
|
|
|
}
|
2020-01-24 10:50:20 +01:00
|
|
|
[[nodiscard]] virtual QMargins bubbleRollRepaintMargins() const {
|
|
|
|
return QMargins();
|
|
|
|
}
|
2020-01-24 13:47:45 +01:00
|
|
|
virtual void paintBubbleFireworks(
|
|
|
|
Painter &p,
|
|
|
|
const QRect &bubble,
|
|
|
|
crl::time ms) const {
|
|
|
|
}
|
2020-12-30 09:55:11 +01:00
|
|
|
[[nodiscard]] virtual bool customHighlight() const {
|
|
|
|
return false;
|
|
|
|
}
|
2020-01-24 09:49:12 +01:00
|
|
|
|
2020-05-26 15:40:36 +02:00
|
|
|
virtual bool hasHeavyPart() const {
|
|
|
|
return false;
|
2020-03-27 12:40:50 +01:00
|
|
|
}
|
2019-05-14 11:50:44 +02:00
|
|
|
virtual void unloadHeavyPart() {
|
|
|
|
}
|
|
|
|
|
2018-01-17 17:21:01 +01:00
|
|
|
// Should be called only by Data::Session.
|
|
|
|
virtual void updateSharedContactUserId(UserId userId) {
|
|
|
|
}
|
2018-03-13 11:19:06 +01:00
|
|
|
virtual void parentTextUpdated() {
|
|
|
|
}
|
2018-01-17 17:21:01 +01:00
|
|
|
|
2019-08-02 15:21:09 +02:00
|
|
|
virtual ~Media() = default;
|
2018-01-13 13:45:11 +01:00
|
|
|
|
2016-09-27 16:20:49 +02:00
|
|
|
protected:
|
2019-12-25 16:20:02 +01:00
|
|
|
[[nodiscard]] QSize countCurrentSize(int newWidth) override;
|
|
|
|
[[nodiscard]] Ui::Text::String createCaption(
|
2021-12-02 11:42:33 +01:00
|
|
|
not_null<HistoryItem*> item) const;
|
2018-01-13 13:45:11 +01:00
|
|
|
|
2018-01-21 15:49:42 +01:00
|
|
|
virtual void playAnimation(bool autoplay) {
|
|
|
|
}
|
|
|
|
|
2021-08-20 12:12:07 +02:00
|
|
|
[[nodiscard]] bool usesBubblePattern(const PaintContext &context) const;
|
|
|
|
|
2022-09-30 21:03:44 +02:00
|
|
|
void fillImageShadow(
|
|
|
|
QPainter &p,
|
|
|
|
QRect rect,
|
|
|
|
Ui::BubbleRounding rounding,
|
|
|
|
const PaintContext &context) const;
|
|
|
|
void fillImageOverlay(
|
|
|
|
QPainter &p,
|
|
|
|
QRect rect,
|
|
|
|
std::optional<Ui::BubbleRounding> rounding, // nullopt if in WebPage.
|
|
|
|
const PaintContext &context) const;
|
2022-12-12 19:57:17 +01:00
|
|
|
void fillImageSpoiler(
|
|
|
|
QPainter &p,
|
|
|
|
not_null<MediaSpoiler*> spoiler,
|
|
|
|
QRect rect,
|
|
|
|
const PaintContext &context) const;
|
|
|
|
void createSpoilerLink(not_null<MediaSpoiler*> spoiler);
|
2022-09-30 21:03:44 +02:00
|
|
|
|
2022-01-11 15:13:04 +01:00
|
|
|
void repaint() const;
|
|
|
|
|
2020-08-24 15:59:44 +02:00
|
|
|
const not_null<Element*> _parent;
|
2016-09-28 12:15:03 +02:00
|
|
|
MediaInBubbleState _inBubbleState = MediaInBubbleState::None;
|
2022-09-30 16:49:48 +02:00
|
|
|
Ui::BubbleRounding _bubbleRounding;
|
2016-09-27 16:20:49 +02:00
|
|
|
|
|
|
|
};
|
2019-08-02 15:21:09 +02:00
|
|
|
|
2022-09-30 21:03:44 +02:00
|
|
|
[[nodiscard]] Images::CornersMaskRef MediaRoundingMask(
|
|
|
|
std::optional<Ui::BubbleRounding> rounding);
|
|
|
|
|
2019-08-02 15:21:09 +02:00
|
|
|
} // namespace HistoryView
|