2014-12-19 21:33:22 +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.
|
2014-12-19 21:33:22 +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
|
2014-12-19 21:33:22 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-04-18 15:21:03 +00:00
|
|
|
#include "lang/lang_cloud_manager.h"
|
2017-04-06 14:38:10 +00:00
|
|
|
#include "boxes/abstract_box.h"
|
2018-09-05 21:01:50 +00:00
|
|
|
#include "base/binary_guard.h"
|
2014-12-19 21:33:22 +00:00
|
|
|
|
2016-10-28 09:20:24 +00:00
|
|
|
namespace Ui {
|
2018-10-30 11:23:54 +00:00
|
|
|
class MultiSelect;
|
|
|
|
struct ScrollToRequest;
|
2016-10-28 09:20:24 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2019-09-18 11:19:05 +00:00
|
|
|
class LanguageBox : public Ui::BoxContent {
|
2014-12-19 21:33:22 +00:00
|
|
|
public:
|
2016-12-13 17:07:56 +00:00
|
|
|
LanguageBox(QWidget*) {
|
|
|
|
}
|
2014-12-19 21:33:22 +00:00
|
|
|
|
2018-10-30 11:23:54 +00:00
|
|
|
void setInnerFocus() override;
|
|
|
|
|
2018-09-05 21:01:50 +00:00
|
|
|
static base::binary_guard Show();
|
|
|
|
|
2015-04-02 10:33:19 +00:00
|
|
|
protected:
|
2016-12-13 17:07:56 +00:00
|
|
|
void prepare() override;
|
|
|
|
|
2018-10-30 11:23:54 +00:00
|
|
|
void keyPressEvent(QKeyEvent *e) override;
|
|
|
|
|
2015-04-02 10:33:19 +00:00
|
|
|
private:
|
2017-04-18 15:21:03 +00:00
|
|
|
using Languages = Lang::CloudManager::Languages;
|
|
|
|
|
2018-10-30 11:23:54 +00:00
|
|
|
not_null<Ui::MultiSelect*> createMultiSelect();
|
|
|
|
int rowsInPage() const;
|
2016-12-13 17:07:56 +00:00
|
|
|
|
2018-10-30 11:23:54 +00:00
|
|
|
Fn<void()> _setInnerFocus;
|
|
|
|
Fn<Ui::ScrollToRequest(int rows)> _jump;
|
2016-08-16 16:53:10 +00:00
|
|
|
|
2014-12-19 21:33:22 +00:00
|
|
|
};
|