1 /*
2 This file is part of Telegram Desktop,
3 the official desktop application for the Telegram messaging service.
4 
5 For license and copyright information please follow this link:
6 https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
7 */
8 #pragma once
9 
10 #include "lang/lang_cloud_manager.h"
11 #include "boxes/abstract_box.h"
12 #include "base/binary_guard.h"
13 
14 namespace Ui {
15 class MultiSelect;
16 struct ScrollToRequest;
17 } // namespace Ui
18 
19 class LanguageBox : public Ui::BoxContent {
20 public:
LanguageBox(QWidget *)21 	LanguageBox(QWidget*) {
22 	}
23 
24 	void setInnerFocus() override;
25 
26 	static base::binary_guard Show();
27 
28 protected:
29 	void prepare() override;
30 
31 	void keyPressEvent(QKeyEvent *e) override;
32 
33 private:
34 	using Languages = Lang::CloudManager::Languages;
35 
36 	not_null<Ui::MultiSelect*> createMultiSelect();
37 	int rowsInPage() const;
38 
39 	Fn<void()> _setInnerFocus;
40 	Fn<Ui::ScrollToRequest(int rows)> _jump;
41 
42 };
43