mirror of
https://github.com/vale981/tdesktop
synced 2025-03-07 02:31:41 -05:00
66 lines
1.5 KiB
C++
66 lines
1.5 KiB
C++
/*
|
|
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 "history/media/history_media.h"
|
|
|
|
struct HistoryMessageVia;
|
|
struct HistoryMessageReply;
|
|
struct HistoryMessageForwarded;
|
|
|
|
class HistorySticker : public HistoryMedia {
|
|
public:
|
|
HistorySticker(
|
|
not_null<Element*> parent,
|
|
not_null<DocumentData*> document);
|
|
|
|
void draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const override;
|
|
TextState textState(QPoint point, StateRequest request) const override;
|
|
|
|
bool toggleSelectionByHandlerClick(const ClickHandlerPtr &p) const override {
|
|
return true;
|
|
}
|
|
bool dragItem() const override {
|
|
return true;
|
|
}
|
|
bool dragItemByHandler(const ClickHandlerPtr &p) const override {
|
|
return true;
|
|
}
|
|
|
|
DocumentData *getDocument() const override {
|
|
return _data;
|
|
}
|
|
|
|
bool needsBubble() const override {
|
|
return false;
|
|
}
|
|
bool customInfoLayout() const override {
|
|
return true;
|
|
}
|
|
QString emoji() const {
|
|
return _emoji;
|
|
}
|
|
bool hidesForwardedInfo() const override {
|
|
return true;
|
|
}
|
|
|
|
private:
|
|
QSize countOptimalSize() override;
|
|
QSize countCurrentSize(int newWidth) override;
|
|
|
|
bool needInfoDisplay() const;
|
|
int additionalWidth(const HistoryMessageVia *via, const HistoryMessageReply *reply) const;
|
|
int additionalWidth() const;
|
|
|
|
int _pixw = 1;
|
|
int _pixh = 1;
|
|
ClickHandlerPtr _packLink;
|
|
not_null<DocumentData*> _data;
|
|
QString _emoji;
|
|
|
|
};
|