tdesktop/Telegram/SourceFiles/window/themes/window_theme_preview.h

55 lines
1.1 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 "window/themes/window_theme.h"
2019-09-03 18:04:38 +00:00
namespace Data {
struct CloudTheme;
} // namespace Data
namespace Window {
namespace Theme {
struct CurrentData {
WallPaperId backgroundId = 0;
QImage backgroundImage;
bool backgroundTiled = false;
};
enum class PreviewType {
Normal,
Extended,
};
2019-09-08 16:29:43 +00:00
[[nodiscard]] QString CachedThemePath(uint64 documentId);
2019-09-03 18:04:38 +00:00
std::unique_ptr<Preview> PreviewFromFile(
const QByteArray &bytes,
2019-09-05 07:42:06 +00:00
const QString &filepath,
2019-09-03 18:04:38 +00:00
const Data::CloudTheme &cloud);
std::unique_ptr<Preview> GeneratePreview(
2019-09-03 18:04:38 +00:00
const QByteArray &bytes,
2019-09-05 07:42:06 +00:00
const QString &filepath,
2019-09-03 18:04:38 +00:00
const Data::CloudTheme &cloud,
CurrentData &&data,
PreviewType type);
QImage GeneratePreview(
const QByteArray &bytes,
const QString &filepath);
int DefaultPreviewTitleHeight();
void DefaultPreviewWindowFramePaint(
QImage &preview,
const style::palette &palette,
QRect body,
int outerWidth);
} // namespace Theme
} // namespace Window