2018-09-05 22:05:49 +03:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2023-11-15 00:54:32 +03:00
|
|
|
#include "settings/settings_common_session.h"
|
|
|
|
|
|
|
|
class UserData;
|
2018-09-05 22:05:49 +03:00
|
|
|
|
2022-12-19 15:48:24 +04:00
|
|
|
namespace Ui {
|
2022-03-15 15:12:49 +04:00
|
|
|
struct UnreadBadgeStyle;
|
2022-12-19 15:48:24 +04:00
|
|
|
} // namespace Ui
|
2022-03-15 15:12:49 +04:00
|
|
|
|
2022-06-02 01:21:26 +03:00
|
|
|
namespace Main {
|
|
|
|
class Account;
|
|
|
|
} // namespace Main
|
|
|
|
|
2018-09-05 22:05:49 +03:00
|
|
|
namespace Settings {
|
|
|
|
|
2022-04-01 15:53:23 +04:00
|
|
|
class Information : public Section<Information> {
|
2018-09-05 22:05:49 +03:00
|
|
|
public:
|
2018-09-13 23:09:26 +03:00
|
|
|
Information(
|
|
|
|
QWidget *parent,
|
2019-07-24 16:00:30 +02:00
|
|
|
not_null<Window::SessionController*> controller);
|
2018-09-05 22:05:49 +03:00
|
|
|
|
2022-04-13 12:05:10 +04:00
|
|
|
[[nodiscard]] rpl::producer<QString> title() override;
|
2022-04-01 15:53:23 +04:00
|
|
|
|
2018-09-05 22:05:49 +03:00
|
|
|
private:
|
2019-06-06 13:21:40 +03:00
|
|
|
void setupContent(not_null<Window::SessionController*> controller);
|
2018-09-05 22:05:49 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2022-03-15 15:12:49 +04:00
|
|
|
struct AccountsEvents {
|
2023-04-23 18:21:31 +04:00
|
|
|
rpl::producer<> closeRequests;
|
2022-03-15 15:12:49 +04:00
|
|
|
};
|
|
|
|
AccountsEvents SetupAccounts(
|
|
|
|
not_null<Ui::VerticalLayout*> container,
|
|
|
|
not_null<Window::SessionController*> controller);
|
|
|
|
|
2022-12-10 07:21:27 +04:00
|
|
|
void UpdatePhotoLocally(not_null<UserData*> user, const QImage &image);
|
|
|
|
|
2022-06-14 01:43:13 +03:00
|
|
|
namespace Badge {
|
|
|
|
|
2022-12-19 15:48:24 +04:00
|
|
|
[[nodiscard]] Ui::UnreadBadgeStyle Style();
|
2022-03-15 15:12:49 +04:00
|
|
|
|
|
|
|
struct UnreadBadge {
|
|
|
|
int count = 0;
|
|
|
|
bool muted = false;
|
|
|
|
};
|
2022-06-14 01:43:13 +03:00
|
|
|
[[nodiscard]] not_null<Ui::RpWidget*> AddRight(
|
|
|
|
not_null<Ui::SettingsButton*> button);
|
|
|
|
[[nodiscard]] not_null<Ui::RpWidget*> CreateUnread(
|
|
|
|
not_null<Ui::RpWidget*> container,
|
|
|
|
rpl::producer<UnreadBadge> value);
|
|
|
|
void AddUnread(
|
2022-03-15 15:12:49 +04:00
|
|
|
not_null<Ui::SettingsButton*> button,
|
|
|
|
rpl::producer<UnreadBadge> value);
|
|
|
|
|
2022-06-14 01:43:13 +03:00
|
|
|
} // namespace Badge
|
2018-09-05 22:05:49 +03:00
|
|
|
} // namespace Settings
|