2017-12-05 08:43:18 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-12-05 08:43:18 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2017-12-05 08:43:18 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
|
|
|
class EmptyUserpic {
|
|
|
|
public:
|
2021-01-20 14:09:45 +00:00
|
|
|
[[nodiscard]] static QString ExternalName();
|
|
|
|
|
2017-12-05 08:43:18 +00:00
|
|
|
EmptyUserpic(const style::color &color, const QString &name);
|
|
|
|
|
|
|
|
void paint(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2017-12-05 08:43:18 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size) const;
|
|
|
|
void paintRounded(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2017-12-05 08:43:18 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
2022-10-14 13:25:05 +00:00
|
|
|
int size,
|
|
|
|
int radius = 0) const;
|
2017-12-05 08:43:18 +00:00
|
|
|
void paintSquare(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2017-12-05 08:43:18 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size) const;
|
|
|
|
QPixmap generate(int size);
|
2019-03-22 13:43:34 +00:00
|
|
|
InMemoryKey uniqueKey() const;
|
2017-12-05 08:43:18 +00:00
|
|
|
|
2017-12-05 11:50:32 +00:00
|
|
|
static void PaintSavedMessages(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2017-12-05 11:50:32 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size);
|
2019-08-28 18:20:49 +00:00
|
|
|
static void PaintSavedMessagesRounded(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2019-08-28 18:20:49 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size);
|
2017-12-05 16:48:03 +00:00
|
|
|
static void PaintSavedMessages(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2017-12-05 16:48:03 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
const style::color &bg,
|
|
|
|
const style::color &fg);
|
2019-08-28 18:20:49 +00:00
|
|
|
static void PaintSavedMessagesRounded(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2019-08-28 18:20:49 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
const style::color &bg,
|
|
|
|
const style::color &fg);
|
|
|
|
static QPixmap GenerateSavedMessages(int size);
|
|
|
|
static QPixmap GenerateSavedMessagesRounded(int size);
|
2017-12-05 11:50:32 +00:00
|
|
|
|
2020-09-11 15:33:26 +00:00
|
|
|
static void PaintRepliesMessages(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2020-09-11 15:33:26 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size);
|
|
|
|
static void PaintRepliesMessagesRounded(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2020-09-11 15:33:26 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size);
|
|
|
|
static void PaintRepliesMessages(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2020-09-11 15:33:26 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
const style::color &bg,
|
|
|
|
const style::color &fg);
|
|
|
|
static void PaintRepliesMessagesRounded(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2020-09-11 15:33:26 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
const style::color &bg,
|
|
|
|
const style::color &fg);
|
|
|
|
static QPixmap GenerateRepliesMessages(int size);
|
|
|
|
static QPixmap GenerateRepliesMessagesRounded(int size);
|
|
|
|
|
2017-12-05 08:43:18 +00:00
|
|
|
~EmptyUserpic();
|
|
|
|
|
|
|
|
private:
|
|
|
|
template <typename Callback>
|
|
|
|
void paint(
|
2022-09-16 20:23:27 +00:00
|
|
|
QPainter &p,
|
2017-12-05 08:43:18 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
Callback paintBackground) const;
|
|
|
|
|
|
|
|
void fillString(const QString &name);
|
|
|
|
|
|
|
|
style::color _color;
|
|
|
|
QString _string;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Ui
|