/* 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 namespace HistoryView { class Element; } // namespace HistoryView namespace Data { class Media; } // namespace Data class DocumentData; class PhotoData; namespace HistoryView { class Media; int documentMaxStatusWidth(DocumentData *document); void PaintInterpolatedIcon( Painter &p, const style::icon &a, const style::icon &b, float64 b_ratio, QRect rect); std::unique_ptr CreateAttach( not_null parent, DocumentData *document, PhotoData *photo, const std::vector> &collage = {}, const QString &webpageUrl = QString()); int unitedLineHeight(); [[nodiscard]] inline QSize NonEmptySize(QSize size) { return QSize(std::max(size.width(), 1), std::max(size.height(), 1)); } [[nodiscard]] inline QSize DownscaledSize(QSize size, QSize box) { return (size.width() > box.width() || size.height() > box.height()) ? size.scaled(box, Qt::KeepAspectRatio) : size; } } // namespace HistoryView