2016-06-06 10:29:51 +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-06-06 10:29:51 +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-06-06 10:29:51 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-04-06 14:38:10 +00:00
|
|
|
#include "boxes/abstract_box.h"
|
2016-06-06 10:29:51 +00:00
|
|
|
|
2016-10-28 09:20:24 +00:00
|
|
|
namespace Ui {
|
2017-03-18 21:06:10 +00:00
|
|
|
template <typename Enum>
|
|
|
|
class RadioenumGroup;
|
|
|
|
template <typename Enum>
|
|
|
|
class Radioenum;
|
2018-05-20 17:42:30 +00:00
|
|
|
class InputField;
|
2016-10-28 09:20:24 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2019-09-18 11:19:05 +00:00
|
|
|
class ReportBox : public Ui::BoxContent, public RPCSender {
|
2016-06-06 10:29:51 +00:00
|
|
|
public:
|
2018-05-10 14:15:16 +00:00
|
|
|
ReportBox(QWidget*, not_null<PeerData*> peer);
|
|
|
|
ReportBox(QWidget*, not_null<PeerData*> peer, MessageIdsList ids);
|
2016-06-06 10:29:51 +00:00
|
|
|
|
|
|
|
protected:
|
2016-12-13 17:07:56 +00:00
|
|
|
void prepare() override;
|
|
|
|
void setInnerFocus() override;
|
2016-06-06 10:29:51 +00:00
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
2016-06-06 10:29:51 +00:00
|
|
|
|
|
|
|
private:
|
2017-03-18 21:06:10 +00:00
|
|
|
enum class Reason {
|
|
|
|
Spam,
|
|
|
|
Violence,
|
2019-03-25 12:07:31 +00:00
|
|
|
ChildAbuse,
|
2017-03-18 21:06:10 +00:00
|
|
|
Pornography,
|
|
|
|
Other,
|
|
|
|
};
|
|
|
|
void reasonChanged(Reason reason);
|
2018-05-31 12:20:28 +00:00
|
|
|
void reasonResized();
|
2016-06-06 10:29:51 +00:00
|
|
|
void updateMaxHeight();
|
2018-05-31 12:20:28 +00:00
|
|
|
void report();
|
2016-06-06 10:29:51 +00:00
|
|
|
|
|
|
|
void reportDone(const MTPBool &result);
|
|
|
|
bool reportFail(const RPCError &error);
|
|
|
|
|
2018-05-10 14:15:16 +00:00
|
|
|
not_null<PeerData*> _peer;
|
2018-09-21 16:28:46 +00:00
|
|
|
std::optional<MessageIdsList> _ids;
|
2016-06-06 10:29:51 +00:00
|
|
|
|
2017-03-18 21:06:10 +00:00
|
|
|
std::shared_ptr<Ui::RadioenumGroup<Reason>> _reasonGroup;
|
2018-05-10 14:15:16 +00:00
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonSpam = { nullptr };
|
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonViolence = { nullptr };
|
2019-03-25 12:07:31 +00:00
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonChildAbuse = { nullptr };
|
2018-05-10 14:15:16 +00:00
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonPornography = { nullptr };
|
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonOther = { nullptr };
|
2018-05-20 17:42:30 +00:00
|
|
|
object_ptr<Ui::InputField> _reasonOtherText = { nullptr };
|
2016-06-06 10:29:51 +00:00
|
|
|
|
|
|
|
mtpRequestId _requestId = 0;
|
|
|
|
|
|
|
|
};
|