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
|
|
|
|
2023-01-30 10:10:42 +00:00
|
|
|
struct LanguageId;
|
|
|
|
|
2016-10-28 09:20:24 +00:00
|
|
|
namespace Ui {
|
2018-10-30 11:23:54 +00:00
|
|
|
class MultiSelect;
|
|
|
|
struct ScrollToRequest;
|
2023-01-30 14:01:10 +00:00
|
|
|
class VerticalLayout;
|
2016-10-28 09:20:24 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2023-01-30 14:01:10 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
|
|
|
|
2019-09-18 11:19:05 +00:00
|
|
|
class LanguageBox : public Ui::BoxContent {
|
2014-12-19 21:33:22 +00:00
|
|
|
public:
|
2023-01-30 14:01:10 +00:00
|
|
|
LanguageBox(QWidget*, Window::SessionController *controller);
|
2014-12-19 21:33:22 +00:00
|
|
|
|
2018-10-30 11:23:54 +00:00
|
|
|
void setInnerFocus() override;
|
|
|
|
|
2023-01-30 14:01:10 +00:00
|
|
|
static base::binary_guard Show(Window::SessionController *controller);
|
2018-09-05 21:01:50 +00:00
|
|
|
|
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;
|
|
|
|
|
2023-01-30 14:01:10 +00:00
|
|
|
void setupTop(not_null<Ui::VerticalLayout*> container);
|
|
|
|
[[nodiscard]] int rowsInPage() const;
|
2016-12-13 17:07:56 +00:00
|
|
|
|
2023-01-30 14:01:10 +00:00
|
|
|
Window::SessionController *_controller = nullptr;
|
|
|
|
rpl::event_stream<bool> _translateChatTurnOff;
|
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
|
|
|
};
|