tdesktop/Telegram/SourceFiles/calls/calls_box_controller.h

62 lines
1.5 KiB
C
Raw Normal View History

/*
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 "boxes/peer_list_box.h"
2021-01-21 15:57:12 +00:00
#include "ui/layers/generic_box.h"
2019-07-25 18:55:11 +00:00
namespace Window {
class SessionController;
} // namespace Window
namespace Calls {
2019-11-27 08:02:56 +00:00
class BoxController : public PeerListController, private base::Subscriber {
public:
2019-07-25 18:55:11 +00:00
explicit BoxController(not_null<Window::SessionController*> window);
Main::Session &session() const override;
void prepare() override;
void rowClicked(not_null<PeerListRow*> row) override;
void rowActionClicked(not_null<PeerListRow*> row) override;
void loadMoreRows() override;
2021-01-21 15:57:12 +00:00
base::unique_qptr<Ui::PopupMenu> rowContextMenu(
QWidget *parent,
not_null<PeerListRow*> row) override;
private:
void receivedCalls(const QVector<MTPMessage> &result);
void refreshAbout();
class Row;
Row *rowForItem(not_null<const HistoryItem*> item);
2017-04-27 21:17:00 +00:00
enum class InsertWay {
Append,
Prepend,
};
bool insertRow(not_null<HistoryItem*> item, InsertWay way);
std::unique_ptr<PeerListRow> createRow(
not_null<HistoryItem*> item) const;
2019-07-25 18:55:11 +00:00
const not_null<Window::SessionController*> _window;
2019-11-27 08:02:56 +00:00
MTP::Sender _api;
2019-07-25 18:55:11 +00:00
MsgId _offsetId = 0;
int _loadRequestId = 0; // Not a real mtpRequestId.
bool _allLoaded = false;
};
2021-01-21 15:57:12 +00:00
void ClearCallsBox(
not_null<Ui::GenericBox*> box,
not_null<Window::SessionController*> window);
} // namespace Calls