2019-01-05 11:08:02 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "boxes/abstract_box.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class Radiobutton;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2020-11-29 18:26:49 +00:00
|
|
|
namespace style {
|
|
|
|
struct Checkbox;
|
|
|
|
} // namespace style
|
|
|
|
|
2019-09-18 11:19:05 +00:00
|
|
|
class SingleChoiceBox : public Ui::BoxContent {
|
2019-01-05 11:08:02 +00:00
|
|
|
public:
|
2019-01-11 10:07:56 +00:00
|
|
|
SingleChoiceBox(
|
|
|
|
QWidget*,
|
2019-06-18 15:00:55 +00:00
|
|
|
rpl::producer<QString> title,
|
2019-01-11 10:07:56 +00:00
|
|
|
const std::vector<QString> &optionTexts,
|
|
|
|
int initialSelection,
|
2020-11-29 18:26:49 +00:00
|
|
|
Fn<void(int)> callback,
|
|
|
|
const style::Checkbox *st = nullptr,
|
|
|
|
const style::Radio *radioSt = nullptr);
|
2019-01-05 11:08:02 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void prepare() override;
|
|
|
|
|
|
|
|
private:
|
2019-06-18 15:00:55 +00:00
|
|
|
rpl::producer<QString> _title;
|
2019-01-05 11:08:02 +00:00
|
|
|
std::vector<QString> _optionTexts;
|
|
|
|
int _initialSelection = 0;
|
|
|
|
Fn<void(int)> _callback;
|
2020-11-29 18:26:49 +00:00
|
|
|
const style::Checkbox &_st;
|
|
|
|
const style::Radio &_radioSt;
|
2019-01-05 11:08:02 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|