2019-06-06 11:20:21 +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 "mainwindow.h"
|
2019-09-18 11:19:05 +00:00
|
|
|
#include "ui/layers/layer_widget.h"
|
2019-06-06 11:20:21 +00:00
|
|
|
|
|
|
|
namespace Main {
|
|
|
|
class Account;
|
|
|
|
} // namespace Main
|
|
|
|
|
|
|
|
namespace Window {
|
|
|
|
|
|
|
|
class Controller final {
|
|
|
|
public:
|
|
|
|
explicit Controller(not_null<Main::Account*> account);
|
|
|
|
~Controller();
|
|
|
|
|
|
|
|
Controller(const Controller &other) = delete;
|
|
|
|
Controller &operator=(const Controller &other) = delete;
|
|
|
|
|
2019-06-06 11:59:00 +00:00
|
|
|
Main::Account &account() const {
|
|
|
|
return *_account;
|
2019-06-06 11:20:21 +00:00
|
|
|
}
|
|
|
|
not_null<::MainWindow*> widget() {
|
|
|
|
return &_widget;
|
|
|
|
}
|
|
|
|
SessionController *sessionController() const {
|
|
|
|
return _sessionController.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
void firstShow();
|
|
|
|
|
|
|
|
void setupPasscodeLock();
|
|
|
|
void clearPasscodeLock();
|
|
|
|
void setupIntro();
|
|
|
|
void setupMain();
|
|
|
|
|
|
|
|
void showSettings();
|
|
|
|
|
2019-06-10 14:58:45 +00:00
|
|
|
template <typename BoxType>
|
|
|
|
QPointer<BoxType> show(
|
|
|
|
object_ptr<BoxType> content,
|
2019-09-18 11:19:05 +00:00
|
|
|
Ui::LayerOptions options = Ui::LayerOption::KeepOther,
|
2019-06-10 14:58:45 +00:00
|
|
|
anim::type animated = anim::type::normal) {
|
|
|
|
const auto result = QPointer<BoxType>(content.data());
|
|
|
|
showBox(std::move(content), options, animated);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-09-03 08:25:19 +00:00
|
|
|
void showRightColumn(object_ptr<TWidget> widget);
|
|
|
|
|
2019-06-06 11:20:21 +00:00
|
|
|
void activate();
|
|
|
|
void reActivate();
|
|
|
|
void updateIsActive(int timeout);
|
|
|
|
void minimize();
|
|
|
|
void close();
|
|
|
|
|
|
|
|
QPoint getPointForCallPanelCenter() const;
|
|
|
|
|
|
|
|
void tempDirDelete(int task);
|
|
|
|
|
|
|
|
private:
|
2019-06-10 14:58:45 +00:00
|
|
|
void showBox(
|
2019-09-18 11:19:05 +00:00
|
|
|
object_ptr<Ui::BoxContent> content,
|
|
|
|
Ui::LayerOptions options,
|
2019-06-10 14:58:45 +00:00
|
|
|
anim::type animated);
|
2019-09-02 16:10:18 +00:00
|
|
|
void checkThemeEditor();
|
2019-06-10 14:58:45 +00:00
|
|
|
|
2019-06-06 11:20:21 +00:00
|
|
|
not_null<Main::Account*> _account;
|
2019-06-22 09:52:18 +00:00
|
|
|
::MainWindow _widget;
|
2019-08-16 12:44:20 +00:00
|
|
|
std::unique_ptr<SessionController> _sessionController;
|
2019-06-06 11:20:21 +00:00
|
|
|
|
|
|
|
rpl::lifetime _lifetime;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Window
|