2016-12-01 19:20:33 +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.
|
2016-12-01 19:20:33 +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
|
2016-12-01 19:20:33 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2020-07-06 09:58:18 +00:00
|
|
|
namespace Api {
|
|
|
|
enum class SendProgressType;
|
|
|
|
} // namespace Api
|
|
|
|
|
2016-12-01 19:20:33 +00:00
|
|
|
namespace Ui {
|
|
|
|
|
|
|
|
class SendActionAnimation {
|
|
|
|
public:
|
2020-07-06 09:58:18 +00:00
|
|
|
using Type = Api::SendProgressType;
|
2020-12-02 10:52:19 +00:00
|
|
|
class Impl;
|
|
|
|
|
|
|
|
SendActionAnimation();
|
|
|
|
~SendActionAnimation();
|
2016-12-01 19:20:33 +00:00
|
|
|
|
|
|
|
void start(Type type);
|
2020-12-02 10:52:19 +00:00
|
|
|
void tryToFinish();
|
2016-12-01 19:20:33 +00:00
|
|
|
|
2020-12-02 10:52:19 +00:00
|
|
|
int width() const;
|
2021-09-11 14:15:40 +00:00
|
|
|
int widthNoMargins() const;
|
2021-08-30 13:11:43 +00:00
|
|
|
void paint(
|
|
|
|
Painter &p,
|
|
|
|
style::color color,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
crl::time ms) const;
|
2016-12-01 19:20:33 +00:00
|
|
|
|
|
|
|
explicit operator bool() const {
|
|
|
|
return _impl != nullptr;
|
|
|
|
}
|
|
|
|
|
2021-08-30 13:11:43 +00:00
|
|
|
static void PaintSpeakingIdle(
|
|
|
|
Painter &p,
|
|
|
|
style::color color,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth);
|
2016-12-04 19:40:41 +00:00
|
|
|
|
2016-12-01 19:20:33 +00:00
|
|
|
private:
|
2020-12-02 10:52:19 +00:00
|
|
|
[[nodiscard]] static std::unique_ptr<Impl> CreateByType(Type type);
|
2016-12-01 19:20:33 +00:00
|
|
|
|
2017-02-21 13:45:56 +00:00
|
|
|
std::unique_ptr<Impl> _impl;
|
2016-12-01 19:20:33 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Ui
|