tdesktop/Telegram/SourceFiles/settings/settings_common.h

67 lines
1.2 KiB
C
Raw Normal View History

2018-09-05 19:05:49 +00: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
#include "ui/rp_widget.h"
namespace Ui {
class VerticalLayout;
} // namespace Ui
2018-09-05 19:39:35 +00:00
namespace Window {
class Controller;
} // namespace Window
2018-09-05 19:05:49 +00:00
namespace Info {
namespace Profile {
class Button;
} // namespace Profile
} // namespace Info
namespace Settings {
enum class Type {
Main,
Information,
Notifications,
PrivacySecurity,
General,
Chat,
};
using Button = Info::Profile::Button;
class Section : public Ui::RpWidget {
public:
using RpWidget::RpWidget;
virtual rpl::producer<Type> sectionShowOther() {
return rpl::never<Type>();
}
};
object_ptr<Section> CreateSection(
Type type,
not_null<QWidget*> parent,
2018-09-05 19:39:35 +00:00
not_null<Window::Controller*> controller,
2018-09-05 19:05:49 +00:00
UserData *self = nullptr);
void AddSkip(not_null<Ui::VerticalLayout*> container);
void AddDivider(not_null<Ui::VerticalLayout*> container);
using MenuCallback = Fn<QAction*(
const QString &text,
Fn<void()> handler)>;
void FillMenu(
Fn<void(Type)> showOther,
MenuCallback addAction);
2018-09-05 19:05:49 +00:00
} // namespace Settings