tdesktop/Telegram/SourceFiles/calls/calls_group_members.h

86 lines
2.2 KiB
C++

/*
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"
namespace Ui {
class ScrollArea;
} // namespace Ui
namespace Data {
class GroupCall;
} // namespace Data
namespace Calls {
class GroupCall;
class GroupMembers final
: public Ui::RpWidget
, private PeerListContentDelegate {
public:
GroupMembers(
QWidget *parent,
not_null<GroupCall*> call);
struct MuteRequest {
not_null<UserData*> user;
bool mute = false;
};
[[nodiscard]] int desiredHeight() const;
[[nodiscard]] rpl::producer<MuteRequest> toggleMuteRequests() const;
private:
using ListWidget = PeerListContent;
void visibleTopBottomUpdated(
int visibleTop,
int visibleBottom) override;
void resizeEvent(QResizeEvent *e) override;
// PeerListContentDelegate interface.
void peerListSetTitle(rpl::producer<QString> title) override;
void peerListSetAdditionalTitle(rpl::producer<QString> title) override;
bool peerListIsRowChecked(not_null<PeerListRow*> row) override;
int peerListSelectedRowsCount() override;
void peerListScrollToTop() override;
std::vector<not_null<PeerData*>> peerListCollectSelectedRows() override;
void peerListAddSelectedPeerInBunch(
not_null<PeerData*> peer) override;
void peerListAddSelectedRowInBunch(
not_null<PeerListRow*> row) override;
void peerListFinishSelectedRowsBunch() override;
void peerListSetDescription(
object_ptr<Ui::FlatLabel> description) override;
void setupHeader(not_null<GroupCall*> call);
object_ptr<Ui::FlatLabel> setupTitle(not_null<GroupCall*> call);
void setupList();
void setupButtons();
void addMember();
void updateHeaderControlsGeometry(int newWidth);
base::weak_ptr<GroupCall> _call;
object_ptr<Ui::ScrollArea> _scroll;
std::unique_ptr<PeerListController> _listController;
object_ptr<Ui::RpWidget> _header = { nullptr };
ListWidget *_list = { nullptr };
Ui::RpWidget *_titleWrap = nullptr;
Ui::FlatLabel *_title = nullptr;
Ui::IconButton *_addMember = nullptr;
};
} // namespace Calls