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 namespace Window {
11 
12 class Adaptive {
13 public:
14 	enum class WindowLayout {
15 		OneColumn,
16 		Normal,
17 		ThreeColumn,
18 	};
19 
20 	enum class ChatLayout {
21 		Normal,
22 		Wide,
23 	};
24 
25 	Adaptive();
26 
27 	void setWindowLayout(WindowLayout value);
28 	void setChatLayout(ChatLayout value);
29 
30 	[[nodiscard]] rpl::producer<> value() const;
31 	[[nodiscard]] rpl::producer<> changes() const;
32 	[[nodiscard]] rpl::producer<bool> oneColumnValue() const;
33 	[[nodiscard]] rpl::producer<ChatLayout> chatLayoutValue() const;
34 
35 	[[nodiscard]] bool isOneColumn() const;
36 	[[nodiscard]] bool isNormal() const;
37 	[[nodiscard]] bool isThreeColumn() const;
38 
39 	[[nodiscard]] rpl::producer<bool> chatWideValue() const;
40 	[[nodiscard]] bool isChatWide() const;
41 
42 private:
43 	rpl::variable<ChatLayout> _chatLayout;
44 	rpl::variable<WindowLayout> _layout;
45 
46 };
47 
48 } // namespace Window
49