2017-05-02 11:56:39 +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-05-02 11:56:39 +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-05-02 11:56:39 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "boxes/abstract_box.h"
|
|
|
|
#include "mtproto/sender.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
2018-05-20 17:42:30 +00:00
|
|
|
class InputField;
|
2017-05-02 11:56:39 +00:00
|
|
|
class FlatLabel;
|
|
|
|
class IconButton;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2019-11-27 08:02:56 +00:00
|
|
|
class RateCallBox : public Ui::BoxContent {
|
2017-05-02 11:56:39 +00:00
|
|
|
public:
|
2019-07-25 18:55:11 +00:00
|
|
|
RateCallBox(
|
|
|
|
QWidget*,
|
|
|
|
not_null<Main::Session*> session,
|
|
|
|
uint64 callId,
|
|
|
|
uint64 callAccessHash);
|
2017-05-02 11:56:39 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void prepare() override;
|
|
|
|
void setInnerFocus() override;
|
|
|
|
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void updateMaxHeight();
|
|
|
|
void ratingChanged(int value);
|
2018-05-31 12:20:28 +00:00
|
|
|
void send();
|
|
|
|
void commentResized();
|
2017-05-02 11:56:39 +00:00
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
const not_null<Main::Session*> _session;
|
2019-11-27 08:02:56 +00:00
|
|
|
MTP::Sender _api;
|
2019-07-25 18:55:11 +00:00
|
|
|
|
2017-05-02 11:56:39 +00:00
|
|
|
uint64 _callId = 0;
|
|
|
|
uint64 _callAccessHash = 0;
|
|
|
|
int _rating = 0;
|
|
|
|
|
|
|
|
std::vector<object_ptr<Ui::IconButton>> _stars;
|
2018-05-20 17:42:30 +00:00
|
|
|
object_ptr<Ui::InputField> _comment = { nullptr };
|
2017-05-02 11:56:39 +00:00
|
|
|
|
|
|
|
mtpRequestId _requestId = 0;
|
|
|
|
|
|
|
|
};
|