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