/* 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 "mainwindow.h" #include "ui/layers/layer_widget.h" namespace Main { class Account; } // namespace Main namespace Window { class Controller final { public: Controller(); ~Controller(); Controller(const Controller &other) = delete; Controller &operator=(const Controller &other) = delete; void showAccount(not_null account); not_null<::MainWindow*> widget() { return &_widget; } Main::Account &account() const { Expects(_account != nullptr); return *_account; } SessionController *sessionController() const { return _sessionController.get(); } void finishFirstShow(); void setupPasscodeLock(); void clearPasscodeLock(); void setupIntro(); void setupMain(); void showSettings(); template QPointer show( object_ptr content, Ui::LayerOptions options = Ui::LayerOption::KeepOther, anim::type animated = anim::type::normal) { const auto result = QPointer(content.data()); showBox(std::move(content), options, animated); return result; } void showToast(const QString &text); void showRightColumn(object_ptr widget); void sideBarChanged(); void activate(); void reActivate(); void updateIsActive(int timeout); void minimize(); void close(); QPoint getPointForCallPanelCenter() const; void tempDirDelete(int task); private: void showBox( object_ptr content, Ui::LayerOptions options, anim::type animated); void checkThemeEditor(); Main::Account *_account = nullptr; ::MainWindow _widget; std::unique_ptr _sessionController; rpl::lifetime _accountLifetime; rpl::lifetime _lifetime; }; } // namespace Window