2015-05-19 18:46:45 +03:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 13:23:14 +03:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2015-05-19 18:46:45 +03:00
|
|
|
|
2018-01-03 13:23:14 +03:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2015-05-19 18:46:45 +03:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-04-06 17:38:10 +03:00
|
|
|
#include "boxes/abstract_box.h"
|
2018-11-21 22:14:48 +04:00
|
|
|
#include "base/timer.h"
|
2020-06-08 21:24:36 +04:00
|
|
|
#include "data/stickers/data_stickers.h"
|
2015-05-19 18:46:45 +03:00
|
|
|
|
2016-07-15 18:58:52 +03:00
|
|
|
class ConfirmBox;
|
2016-10-20 19:32:15 +03:00
|
|
|
|
2019-06-24 17:09:37 +02:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
|
|
|
|
2016-10-12 22:34:25 +03:00
|
|
|
namespace Ui {
|
|
|
|
class PlainShadow;
|
|
|
|
} // namespace Ui
|
2016-07-15 18:58:52 +03:00
|
|
|
|
2020-06-11 20:09:46 +04:00
|
|
|
class StickerSetBox final : public Ui::BoxContent {
|
2015-05-19 18:46:45 +03:00
|
|
|
public:
|
2019-06-24 17:09:37 +02:00
|
|
|
StickerSetBox(
|
|
|
|
QWidget*,
|
|
|
|
not_null<Window::SessionController*> controller,
|
|
|
|
const MTPInputStickerSet &set);
|
2016-10-20 19:32:15 +03:00
|
|
|
|
2019-09-18 14:19:05 +03:00
|
|
|
static QPointer<Ui::BoxContent> Show(
|
2019-06-24 17:09:37 +02:00
|
|
|
not_null<Window::SessionController*> controller,
|
|
|
|
not_null<DocumentData*> document);
|
2018-11-26 15:55:02 +04:00
|
|
|
|
2016-12-13 20:07:56 +03:00
|
|
|
protected:
|
|
|
|
void prepare() override;
|
|
|
|
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
|
|
|
|
2016-10-20 19:32:15 +03:00
|
|
|
private:
|
2021-06-17 11:06:17 +04:00
|
|
|
enum class Error {
|
|
|
|
NotFound,
|
|
|
|
};
|
|
|
|
|
2018-11-21 22:14:48 +04:00
|
|
|
void updateTitleAndButtons();
|
2016-12-13 20:07:56 +03:00
|
|
|
void updateButtons();
|
2018-11-21 22:14:48 +04:00
|
|
|
void addStickers();
|
2020-08-31 16:55:47 +03:00
|
|
|
void copyStickersLink();
|
2021-06-17 11:06:17 +04:00
|
|
|
void handleError(Error error);
|
2016-12-13 20:07:56 +03:00
|
|
|
|
2020-06-11 20:09:46 +04:00
|
|
|
const not_null<Window::SessionController*> _controller;
|
2016-12-13 20:07:56 +03:00
|
|
|
MTPInputStickerSet _set;
|
2016-11-18 16:34:58 +03:00
|
|
|
|
2016-10-20 19:32:15 +03:00
|
|
|
class Inner;
|
2016-12-13 20:07:56 +03:00
|
|
|
QPointer<Inner> _inner;
|
|
|
|
|
2016-10-20 19:32:15 +03:00
|
|
|
};
|