2014-05-30 08:53:19 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2014-05-30 08:53:19 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2019-01-18 11:26:43 +00:00
|
|
|
#include "base/timer.h"
|
2017-11-30 17:33:27 +00:00
|
|
|
#include "base/weak_ptr.h"
|
2017-09-13 16:57:44 +00:00
|
|
|
#include "ui/rp_widget.h"
|
2019-04-02 09:13:30 +00:00
|
|
|
#include "ui/effects/animations.h"
|
2018-11-05 11:16:09 +00:00
|
|
|
#include "media/player/media_player_float.h"
|
2020-06-30 14:26:44 +00:00
|
|
|
#include "mtproto/sender.h"
|
2019-01-04 11:09:48 +00:00
|
|
|
#include "data/data_pts_waiter.h"
|
2016-04-12 21:31:28 +00:00
|
|
|
|
2017-12-18 15:44:50 +00:00
|
|
|
struct HistoryMessageMarkupButton;
|
|
|
|
class MainWindow;
|
|
|
|
class ConfirmBox;
|
|
|
|
class HistoryWidget;
|
|
|
|
class StackItem;
|
2017-12-19 16:57:42 +00:00
|
|
|
struct FileLoadResult;
|
2019-09-13 06:06:02 +00:00
|
|
|
class History;
|
2020-05-29 14:08:18 +00:00
|
|
|
class Image;
|
2017-12-18 15:44:50 +00:00
|
|
|
|
2021-03-12 12:48:00 +00:00
|
|
|
namespace MTP {
|
|
|
|
class Error;
|
|
|
|
} // namespace MTP
|
|
|
|
|
2019-08-12 12:11:34 +00:00
|
|
|
namespace Api {
|
|
|
|
struct SendAction;
|
|
|
|
} // namespace Api
|
|
|
|
|
2019-07-24 11:45:24 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2019-01-03 12:36:01 +00:00
|
|
|
namespace Data {
|
2019-01-28 13:59:49 +00:00
|
|
|
class WallPaper;
|
2019-01-03 12:36:01 +00:00
|
|
|
} // namespace Data
|
|
|
|
|
2016-04-12 21:31:28 +00:00
|
|
|
namespace Dialogs {
|
2018-01-04 17:15:04 +00:00
|
|
|
struct RowDescriptor;
|
2016-04-12 21:31:28 +00:00
|
|
|
class Row;
|
2018-01-13 12:45:11 +00:00
|
|
|
class Key;
|
2019-04-24 10:15:10 +00:00
|
|
|
class Widget;
|
2016-04-12 21:31:28 +00:00
|
|
|
} // namespace Dialogs
|
|
|
|
|
2016-09-17 19:28:33 +00:00
|
|
|
namespace Media {
|
|
|
|
namespace Player {
|
|
|
|
class Widget;
|
2016-10-12 19:34:25 +00:00
|
|
|
class VolumeWidget;
|
|
|
|
class Panel;
|
2019-03-04 11:28:52 +00:00
|
|
|
struct TrackState;
|
2016-09-17 19:28:33 +00:00
|
|
|
} // namespace Player
|
|
|
|
} // namespace Media
|
|
|
|
|
2018-06-20 00:02:36 +00:00
|
|
|
namespace Export {
|
|
|
|
namespace View {
|
|
|
|
class TopBar;
|
|
|
|
class PanelController;
|
|
|
|
struct Content;
|
|
|
|
} // namespace View
|
|
|
|
} // namespace Export
|
|
|
|
|
2016-04-12 21:31:28 +00:00
|
|
|
namespace Ui {
|
2017-11-12 15:41:00 +00:00
|
|
|
class ResizeArea;
|
2016-10-12 19:34:25 +00:00
|
|
|
class PlainShadow;
|
2016-10-26 16:43:13 +00:00
|
|
|
class DropdownMenu;
|
2021-02-15 17:37:22 +00:00
|
|
|
enum class ReportReason;
|
2017-04-25 20:36:04 +00:00
|
|
|
template <typename Widget>
|
2017-09-13 16:57:44 +00:00
|
|
|
class SlideWrap;
|
2016-04-12 21:31:28 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
|
|
|
namespace Window {
|
2019-06-06 10:21:40 +00:00
|
|
|
class SessionController;
|
2018-06-20 00:02:36 +00:00
|
|
|
template <typename Inner>
|
|
|
|
class TopBarWrapWidget;
|
2016-05-19 12:03:51 +00:00
|
|
|
class SectionMemento;
|
|
|
|
class SectionWidget;
|
2017-05-24 10:04:29 +00:00
|
|
|
class AbstractSectionWidget;
|
2019-02-10 16:29:55 +00:00
|
|
|
class ConnectionState;
|
2016-05-19 12:03:51 +00:00
|
|
|
struct SectionSlideParams;
|
2017-10-03 13:05:58 +00:00
|
|
|
struct SectionShow;
|
2017-05-24 10:04:29 +00:00
|
|
|
enum class Column;
|
2018-11-26 14:01:29 +00:00
|
|
|
class HistoryHider;
|
2016-04-12 21:31:28 +00:00
|
|
|
} // namespace Window
|
|
|
|
|
2017-04-25 20:36:04 +00:00
|
|
|
namespace Calls {
|
|
|
|
class Call;
|
2020-11-24 14:40:10 +00:00
|
|
|
class GroupCall;
|
2017-04-25 20:36:04 +00:00
|
|
|
class TopBar;
|
|
|
|
} // namespace Calls
|
|
|
|
|
2020-06-18 11:17:58 +00:00
|
|
|
namespace Core {
|
|
|
|
class Changelogs;
|
|
|
|
} // namespace Core
|
|
|
|
|
2016-04-04 21:09:46 +00:00
|
|
|
namespace InlineBots {
|
|
|
|
namespace Layout {
|
|
|
|
class ItemBase;
|
|
|
|
} // namespace Layout
|
|
|
|
} // namespace InlineBots
|
|
|
|
|
2018-11-05 11:16:09 +00:00
|
|
|
class MainWidget
|
|
|
|
: public Ui::RpWidget
|
2020-06-25 14:17:37 +00:00
|
|
|
, private Media::Player::FloatDelegate
|
|
|
|
, private base::Subscriber {
|
2014-05-30 08:53:19 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-10-03 13:05:58 +00:00
|
|
|
using SectionShow = Window::SectionShow;
|
|
|
|
|
2020-06-16 15:40:43 +00:00
|
|
|
MainWidget(
|
|
|
|
QWidget *parent,
|
|
|
|
not_null<Window::SessionController*> controller);
|
2020-06-11 09:41:03 +00:00
|
|
|
~MainWidget();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2019-08-16 12:44:20 +00:00
|
|
|
[[nodiscard]] Main::Session &session() const;
|
2020-06-10 18:08:17 +00:00
|
|
|
[[nodiscard]] not_null<Window::SessionController*> controller() const;
|
2019-01-18 12:27:37 +00:00
|
|
|
|
2019-08-16 12:44:20 +00:00
|
|
|
[[nodiscard]] bool isMainSectionShown() const;
|
|
|
|
[[nodiscard]] bool isThirdSectionShown() const;
|
2014-12-12 16:27:03 +00:00
|
|
|
|
2019-08-16 12:44:20 +00:00
|
|
|
void returnTabbedSelector();
|
2015-07-03 08:47:16 +00:00
|
|
|
|
2016-12-05 11:01:08 +00:00
|
|
|
void showAnimated(const QPixmap &bgAnimCache, bool back = false);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
void activate();
|
|
|
|
|
|
|
|
void windowShown();
|
|
|
|
|
|
|
|
void dialogsToUp();
|
2020-02-11 11:23:51 +00:00
|
|
|
void checkHistoryActivation();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-01-04 17:15:04 +00:00
|
|
|
PeerData *peer();
|
2015-07-17 19:17:37 +00:00
|
|
|
|
2017-03-27 12:24:38 +00:00
|
|
|
int backgroundFromY() const;
|
2017-09-16 16:53:41 +00:00
|
|
|
void showSection(
|
2020-12-14 14:48:10 +00:00
|
|
|
std::shared_ptr<Window::SectionMemento> memento,
|
2017-10-03 13:05:58 +00:00
|
|
|
const SectionShow ¶ms);
|
2017-09-16 16:53:41 +00:00
|
|
|
void updateColumnLayout();
|
2016-07-05 14:48:36 +00:00
|
|
|
bool stackIsEmpty() const;
|
2017-09-20 10:23:57 +00:00
|
|
|
void showBackFromStack(
|
2017-10-03 13:05:58 +00:00
|
|
|
const SectionShow ¶ms);
|
2015-07-17 19:17:37 +00:00
|
|
|
void orderWidgets();
|
2014-05-30 08:53:19 +00:00
|
|
|
QRect historyRect() const;
|
2016-05-19 12:03:51 +00:00
|
|
|
QPixmap grabForShowAnimation(const Window::SectionSlideParams ¶ms);
|
2017-09-16 16:53:41 +00:00
|
|
|
void checkMainSectionToLayer();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2020-06-11 16:33:15 +00:00
|
|
|
bool sendExistingDocument(not_null<DocumentData*> sticker);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
bool isActive() const;
|
2020-02-11 11:23:51 +00:00
|
|
|
[[nodiscard]] bool doWeMarkAsRead() const;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2020-06-11 09:41:03 +00:00
|
|
|
void saveFieldToHistoryLocalDraft();
|
2016-06-03 18:24:27 +00:00
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
int32 dlgsWidth() const;
|
|
|
|
|
2017-12-06 10:13:38 +00:00
|
|
|
void showForwardLayer(MessageIdsList &&items);
|
2017-07-11 10:23:15 +00:00
|
|
|
void showSendPathsLayer();
|
2015-10-18 12:49:34 +00:00
|
|
|
void shareUrlLayer(const QString &url, const QString &text);
|
2016-04-08 14:16:52 +00:00
|
|
|
void inlineSwitchLayer(const QString &botAndQuery);
|
2018-11-26 14:01:29 +00:00
|
|
|
void hiderLayer(base::unique_qptr<Window::HistoryHider> h);
|
2017-12-06 10:13:38 +00:00
|
|
|
bool setForwardDraft(PeerId peer, MessageIdsList &&items);
|
2017-11-30 17:45:36 +00:00
|
|
|
bool shareUrl(
|
2018-11-26 14:01:29 +00:00
|
|
|
PeerId peerId,
|
2017-11-30 17:45:36 +00:00
|
|
|
const QString &url,
|
|
|
|
const QString &text);
|
2017-12-30 08:15:42 +00:00
|
|
|
void replyToItem(not_null<HistoryItem*> item);
|
2018-11-26 14:01:29 +00:00
|
|
|
bool inlineSwitchChosen(PeerId peerId, const QString &botAndQuery);
|
|
|
|
bool sendPaths(PeerId peerId);
|
2015-06-27 13:02:00 +00:00
|
|
|
void onFilesOrForwardDrop(const PeerId &peer, const QMimeData *data);
|
2018-11-26 14:01:29 +00:00
|
|
|
bool selectingPeer() const;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-06-14 16:26:41 +00:00
|
|
|
void deletePhotoLayer(PhotoData *photo);
|
|
|
|
|
2018-03-08 21:21:27 +00:00
|
|
|
// While HistoryInner is not HistoryView::ListWidget.
|
2019-02-19 06:57:53 +00:00
|
|
|
crl::time highlightStartTime(not_null<const HistoryItem*> item) const;
|
2014-07-04 11:12:54 +00:00
|
|
|
|
2020-06-10 18:08:17 +00:00
|
|
|
void sendBotCommand(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
UserData *bot,
|
|
|
|
const QString &cmd,
|
|
|
|
MsgId replyTo);
|
2016-11-20 12:54:07 +00:00
|
|
|
void hideSingleUseKeyboard(PeerData *peer, MsgId replyTo);
|
2017-03-27 18:11:51 +00:00
|
|
|
bool insertBotCommand(const QString &cmd);
|
2015-06-10 15:54:24 +00:00
|
|
|
|
2018-02-14 19:38:01 +00:00
|
|
|
void searchMessages(const QString &query, Dialogs::Key inChat);
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-02-03 15:02:46 +00:00
|
|
|
QPixmap cachedBackground(const QRect &forRect, int &x, int &y);
|
|
|
|
void updateScrollColors();
|
|
|
|
|
2019-01-17 08:18:23 +00:00
|
|
|
void setChatBackground(
|
|
|
|
const Data::WallPaper &background,
|
|
|
|
QImage &&image = QImage());
|
2015-02-03 15:02:46 +00:00
|
|
|
bool chatBackgroundLoading();
|
2016-06-22 13:39:54 +00:00
|
|
|
float64 chatBackgroundProgress() const;
|
2015-02-03 15:02:46 +00:00
|
|
|
void checkChatBackground();
|
2019-01-25 14:37:28 +00:00
|
|
|
Image *newBackgroundThumb();
|
2015-03-19 09:18:19 +00:00
|
|
|
|
2018-01-07 12:04:34 +00:00
|
|
|
// Does offerPeer or showPeerHistory.
|
|
|
|
void choosePeer(PeerId peerId, MsgId showAtMsgId);
|
2015-07-17 19:17:37 +00:00
|
|
|
void clearBotStartToken(PeerData *peer);
|
|
|
|
|
2015-09-16 13:04:08 +00:00
|
|
|
void ctrlEnterSubmitUpdated();
|
|
|
|
void setInnerFocus();
|
|
|
|
|
2015-09-21 20:57:42 +00:00
|
|
|
void scheduleViewIncrement(HistoryItem *item);
|
|
|
|
|
2015-10-01 14:05:05 +00:00
|
|
|
bool contentOverlapped(const QRect &globalRect);
|
|
|
|
|
2018-01-22 17:39:20 +00:00
|
|
|
void searchInChat(Dialogs::Key chat);
|
|
|
|
|
2021-02-15 17:37:22 +00:00
|
|
|
void showChooseReportMessages(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
Ui::ReportReason reason,
|
|
|
|
Fn<void(MessageIdsList)> done);
|
|
|
|
void clearChooseReportMessages();
|
|
|
|
|
2017-09-20 10:23:57 +00:00
|
|
|
void ui_showPeerHistory(
|
|
|
|
PeerId peer,
|
2017-10-03 13:05:58 +00:00
|
|
|
const SectionShow ¶ms,
|
|
|
|
MsgId msgId);
|
2016-03-29 17:17:00 +00:00
|
|
|
PeerData *ui_getPeerForMouseAction();
|
2015-12-13 11:17:15 +00:00
|
|
|
|
2016-08-12 16:28:10 +00:00
|
|
|
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);
|
2015-12-07 13:05:00 +00:00
|
|
|
|
2020-06-25 14:17:37 +00:00
|
|
|
using FloatDelegate::floatPlayerAreaUpdated;
|
|
|
|
|
2019-04-30 18:31:42 +00:00
|
|
|
void closeBothPlayers();
|
2020-11-10 13:52:17 +00:00
|
|
|
void stopAndClosePlayer();
|
2019-04-30 18:31:42 +00:00
|
|
|
|
2020-12-13 13:08:16 +00:00
|
|
|
bool preventsCloseSection(Fn<void()> callback) const;
|
|
|
|
bool preventsCloseSection(
|
|
|
|
Fn<void()> callback,
|
|
|
|
const SectionShow ¶ms) const;
|
|
|
|
|
2021-03-03 18:22:42 +00:00
|
|
|
public Q_SLOTS:
|
2015-12-31 05:34:43 +00:00
|
|
|
void inlineResultLoadProgress(FileLoader *loader);
|
|
|
|
void inlineResultLoadFailed(FileLoader *loader, bool started);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
void dialogsCancelled();
|
|
|
|
|
2016-09-23 16:04:26 +00:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
|
|
|
void keyPressEvent(QKeyEvent *e) override;
|
2017-01-14 18:50:16 +00:00
|
|
|
bool eventFilter(QObject *o, QEvent *e) override;
|
2016-09-23 16:04:26 +00:00
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
private:
|
2019-01-18 11:26:43 +00:00
|
|
|
void viewsIncrement();
|
|
|
|
|
2016-12-05 11:01:08 +00:00
|
|
|
void animationCallback();
|
2017-01-14 18:50:16 +00:00
|
|
|
void handleAdaptiveLayoutUpdate();
|
|
|
|
void updateWindowAdaptiveLayout();
|
2019-03-04 11:28:52 +00:00
|
|
|
void handleAudioUpdate(const Media::Player::TrackState &state);
|
2016-09-23 16:04:26 +00:00
|
|
|
void updateMediaPlayerPosition();
|
2016-10-14 17:10:15 +00:00
|
|
|
void updateMediaPlaylistPosition(int x);
|
2016-10-12 19:34:25 +00:00
|
|
|
void updateControlsGeometry();
|
2017-01-14 18:50:16 +00:00
|
|
|
void updateDialogsWidthAnimated();
|
2018-01-22 16:42:25 +00:00
|
|
|
void updateThirdColumnToCurrentChat(
|
|
|
|
Dialogs::Key key,
|
2017-09-20 18:40:23 +00:00
|
|
|
bool canWrite);
|
2017-11-28 20:01:00 +00:00
|
|
|
[[nodiscard]] bool saveThirdSectionToStackBack() const;
|
2018-01-22 16:42:25 +00:00
|
|
|
[[nodiscard]] auto thirdSectionForCurrentMainSection(Dialogs::Key key)
|
2020-12-14 14:48:10 +00:00
|
|
|
-> std::shared_ptr<Window::SectionMemento>;
|
2016-10-12 19:34:25 +00:00
|
|
|
|
2018-05-07 17:44:33 +00:00
|
|
|
void setupConnectingWidget();
|
2016-10-12 19:34:25 +00:00
|
|
|
void createPlayer();
|
|
|
|
void playerHeightUpdated();
|
2016-08-27 04:49:18 +00:00
|
|
|
|
2017-04-25 20:36:04 +00:00
|
|
|
void setCurrentCall(Calls::Call *call);
|
2020-11-24 14:40:10 +00:00
|
|
|
void setCurrentGroupCall(Calls::GroupCall *call);
|
2017-04-25 20:36:04 +00:00
|
|
|
void createCallTopBar();
|
|
|
|
void destroyCallTopBar();
|
2017-09-13 16:57:44 +00:00
|
|
|
void callTopBarHeightUpdated(int callTopBarHeight);
|
2017-04-25 20:36:04 +00:00
|
|
|
|
2018-06-20 00:02:36 +00:00
|
|
|
void setCurrentExportView(Export::View::PanelController *view);
|
|
|
|
void createExportTopBar(Export::View::Content &&data);
|
|
|
|
void destroyExportTopBar();
|
|
|
|
void exportTopBarHeightUpdated();
|
|
|
|
|
2017-09-16 16:53:41 +00:00
|
|
|
Window::SectionSlideParams prepareShowAnimation(
|
|
|
|
bool willHaveTopBarShadow);
|
|
|
|
void showNewSection(
|
2020-12-14 14:48:10 +00:00
|
|
|
std::shared_ptr<Window::SectionMemento> memento,
|
2017-10-03 13:05:58 +00:00
|
|
|
const SectionShow ¶ms);
|
2017-09-16 16:53:41 +00:00
|
|
|
void dropMainSection(Window::SectionWidget *widget);
|
|
|
|
|
|
|
|
Window::SectionSlideParams prepareThirdSectionAnimation(Window::SectionWidget *section);
|
2016-05-19 12:03:51 +00:00
|
|
|
|
|
|
|
// All this methods use the prepareShowAnimation().
|
2017-09-16 16:53:41 +00:00
|
|
|
Window::SectionSlideParams prepareMainSectionAnimation(Window::SectionWidget *section);
|
2016-05-19 12:03:51 +00:00
|
|
|
Window::SectionSlideParams prepareHistoryAnimation(PeerId historyPeerId);
|
|
|
|
Window::SectionSlideParams prepareDialogsAnimation();
|
|
|
|
|
2016-07-05 14:48:36 +00:00
|
|
|
void saveSectionInStack();
|
|
|
|
|
2017-09-16 16:53:41 +00:00
|
|
|
int getMainSectionTop() const;
|
|
|
|
int getThirdSectionTop() const;
|
2017-04-25 20:36:04 +00:00
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
void hideAll();
|
|
|
|
void showAll();
|
2018-11-26 14:01:29 +00:00
|
|
|
void clearHider(not_null<Window::HistoryHider*> instance);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2019-01-18 11:26:43 +00:00
|
|
|
void cacheBackground();
|
2016-08-27 04:49:18 +00:00
|
|
|
void clearCachedBackground();
|
2018-11-05 11:16:09 +00:00
|
|
|
|
2020-06-25 14:17:37 +00:00
|
|
|
[[nodiscard]] auto floatPlayerDelegate()
|
|
|
|
-> not_null<Media::Player::FloatDelegate*>;
|
2018-11-05 11:16:09 +00:00
|
|
|
not_null<Ui::RpWidget*> floatPlayerWidget() override;
|
2020-06-25 14:17:37 +00:00
|
|
|
not_null<Media::Player::FloatSectionDelegate*> floatPlayerGetSection(
|
2018-11-05 11:16:09 +00:00
|
|
|
Window::Column column) override;
|
|
|
|
void floatPlayerEnumerateSections(Fn<void(
|
2020-06-25 14:17:37 +00:00
|
|
|
not_null<Media::Player::FloatSectionDelegate*> widget,
|
2018-11-05 11:16:09 +00:00
|
|
|
Window::Column widgetColumn)> callback) override;
|
2018-11-05 13:18:54 +00:00
|
|
|
bool floatPlayerIsVisible(not_null<HistoryItem*> item) override;
|
|
|
|
void floatPlayerClosed(FullMsgId itemId);
|
2021-06-15 23:06:22 +00:00
|
|
|
void floatPlayerDoubleClickEvent(
|
|
|
|
not_null<const HistoryItem*> item) override;
|
2017-05-22 15:25:49 +00:00
|
|
|
|
2020-06-11 16:09:46 +00:00
|
|
|
void viewsIncrementDone(
|
|
|
|
QVector<MTPint> ids,
|
2020-09-01 06:44:18 +00:00
|
|
|
const MTPmessages_MessageViews &result,
|
2020-06-11 16:09:46 +00:00
|
|
|
mtpRequestId requestId);
|
2021-03-12 12:48:00 +00:00
|
|
|
void viewsIncrementFail(const MTP::Error &error, mtpRequestId requestId);
|
2017-05-22 15:25:49 +00:00
|
|
|
|
2017-11-12 15:41:00 +00:00
|
|
|
void refreshResizeAreas();
|
|
|
|
template <typename MoveCallback, typename FinishCallback>
|
|
|
|
void createResizeArea(
|
|
|
|
object_ptr<Ui::ResizeArea> &area,
|
|
|
|
MoveCallback &&moveCallback,
|
|
|
|
FinishCallback &&finishCallback);
|
|
|
|
void ensureFirstColumnResizeAreaCreated();
|
|
|
|
void ensureThirdColumnResizeAreaCreated();
|
|
|
|
|
2019-01-17 08:18:23 +00:00
|
|
|
bool isReadyChatBackground(
|
|
|
|
const Data::WallPaper &background,
|
|
|
|
const QImage &image) const;
|
|
|
|
void setReadyChatBackground(
|
|
|
|
const Data::WallPaper &background,
|
|
|
|
QImage &&image);
|
2019-01-16 12:39:35 +00:00
|
|
|
|
2019-05-12 12:59:01 +00:00
|
|
|
void handleHistoryBack();
|
|
|
|
|
2021-05-26 23:20:27 +00:00
|
|
|
bool isOneColumn() const;
|
|
|
|
bool isNormalColumn() const;
|
|
|
|
bool isThreeColumn() const;
|
|
|
|
|
2020-06-16 14:19:23 +00:00
|
|
|
const not_null<Window::SessionController*> _controller;
|
2020-06-30 14:26:44 +00:00
|
|
|
MTP::Sender _api;
|
2017-05-22 15:25:49 +00:00
|
|
|
|
2019-04-02 09:13:30 +00:00
|
|
|
Ui::Animations::Simple _a_show;
|
2016-12-05 11:01:08 +00:00
|
|
|
bool _showBack = false;
|
2015-10-17 14:52:26 +00:00
|
|
|
QPixmap _cacheUnder, _cacheOver;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2017-11-12 16:50:58 +00:00
|
|
|
int _dialogsWidth = 0;
|
|
|
|
int _thirdColumnWidth = 0;
|
2019-04-02 09:13:30 +00:00
|
|
|
Ui::Animations::Simple _a_dialogsWidth;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Ui::PlainShadow> _sideShadow;
|
2017-09-16 16:53:41 +00:00
|
|
|
object_ptr<Ui::PlainShadow> _thirdShadow = { nullptr };
|
2017-11-12 15:41:00 +00:00
|
|
|
object_ptr<Ui::ResizeArea> _firstColumnResizeArea = { nullptr };
|
|
|
|
object_ptr<Ui::ResizeArea> _thirdColumnResizeArea = { nullptr };
|
2019-04-24 10:15:10 +00:00
|
|
|
object_ptr<Dialogs::Widget> _dialogs;
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<HistoryWidget> _history;
|
2017-09-16 16:53:41 +00:00
|
|
|
object_ptr<Window::SectionWidget> _mainSection = { nullptr };
|
2017-04-07 18:10:49 +00:00
|
|
|
object_ptr<Window::SectionWidget> _thirdSection = { nullptr };
|
2020-12-14 14:48:10 +00:00
|
|
|
std::shared_ptr<Window::SectionMemento> _thirdSectionFromStack;
|
2019-02-10 16:29:55 +00:00
|
|
|
std::unique_ptr<Window::ConnectionState> _connecting;
|
2016-12-13 17:07:56 +00:00
|
|
|
|
2017-11-30 17:33:27 +00:00
|
|
|
base::weak_ptr<Calls::Call> _currentCall;
|
2020-11-24 14:40:10 +00:00
|
|
|
base::weak_ptr<Calls::GroupCall> _currentGroupCall;
|
2020-06-25 17:57:36 +00:00
|
|
|
rpl::lifetime _currentCallLifetime;
|
2017-09-13 16:57:44 +00:00
|
|
|
object_ptr<Ui::SlideWrap<Calls::TopBar>> _callTopBar = { nullptr };
|
2017-04-25 20:36:04 +00:00
|
|
|
|
2018-06-20 00:02:36 +00:00
|
|
|
Export::View::PanelController *_currentExportView = nullptr;
|
|
|
|
object_ptr<Window::TopBarWrapWidget<Export::View::TopBar>> _exportTopBar
|
|
|
|
= { nullptr };
|
2020-06-25 07:14:05 +00:00
|
|
|
rpl::lifetime _exportViewLifetime;
|
2018-06-20 00:02:36 +00:00
|
|
|
|
|
|
|
object_ptr<Window::TopBarWrapWidget<Media::Player::Widget>> _player
|
|
|
|
= { nullptr };
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Media::Player::VolumeWidget> _playerVolume = { nullptr };
|
|
|
|
object_ptr<Media::Player::Panel> _playerPlaylist;
|
2016-10-14 17:10:15 +00:00
|
|
|
bool _playerUsingPanel = false;
|
|
|
|
|
2018-11-26 14:01:29 +00:00
|
|
|
base::unique_qptr<Window::HistoryHider> _hider;
|
2017-02-21 13:45:56 +00:00
|
|
|
std::vector<std::unique_ptr<StackItem>> _stack;
|
2015-12-07 10:06:59 +00:00
|
|
|
|
2016-04-08 09:20:10 +00:00
|
|
|
int _playerHeight = 0;
|
2017-04-25 20:36:04 +00:00
|
|
|
int _callTopBarHeight = 0;
|
2018-06-20 00:02:36 +00:00
|
|
|
int _exportTopBarHeight = 0;
|
2016-04-08 09:20:10 +00:00
|
|
|
int _contentScrollAddToY = 0;
|
2015-07-03 08:47:16 +00:00
|
|
|
|
2015-02-03 15:02:46 +00:00
|
|
|
QPixmap _cachedBackground;
|
|
|
|
QRect _cachedFor, _willCacheFor;
|
2016-04-08 09:20:10 +00:00
|
|
|
int _cachedX = 0;
|
|
|
|
int _cachedY = 0;
|
2019-01-18 11:26:43 +00:00
|
|
|
base::Timer _cacheBackgroundTimer;
|
2015-02-03 15:02:46 +00:00
|
|
|
|
2016-06-14 16:26:41 +00:00
|
|
|
PhotoData *_deletingPhoto = nullptr;
|
|
|
|
|
2020-06-11 16:09:46 +00:00
|
|
|
base::flat_map<not_null<PeerData*>, base::flat_set<MsgId>> _viewsIncremented;
|
|
|
|
base::flat_map<not_null<PeerData*>, base::flat_set<MsgId>> _viewsToIncrement;
|
|
|
|
base::flat_map<not_null<PeerData*>, mtpRequestId> _viewsIncrementRequests;
|
|
|
|
base::flat_map<mtpRequestId, not_null<PeerData*>> _viewsIncrementByRequest;
|
2019-01-18 11:26:43 +00:00
|
|
|
base::Timer _viewsIncrementTimer;
|
2015-09-21 20:57:42 +00:00
|
|
|
|
2019-01-16 12:39:35 +00:00
|
|
|
struct SettingBackground;
|
|
|
|
std::unique_ptr<SettingBackground> _background;
|
2015-02-03 15:02:46 +00:00
|
|
|
|
2017-11-12 15:41:00 +00:00
|
|
|
bool _firstColumnResizing = false;
|
|
|
|
int _firstColumnResizingShift = 0;
|
2017-01-14 18:50:16 +00:00
|
|
|
|
2020-06-18 11:17:58 +00:00
|
|
|
// _changelogs depends on _data, subscribes on chats loading event.
|
|
|
|
const std::unique_ptr<Core::Changelogs> _changelogs;
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
};
|
2019-09-13 06:06:02 +00:00
|
|
|
|
|
|
|
namespace App {
|
|
|
|
MainWidget *main();
|
|
|
|
} // namespace App
|