/* 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 RpWidget; class ScrollArea; class VerticalLayout; class SettingsButton; namespace GL { enum class Backend; } // namespace GL } // namespace Ui namespace Data { class GroupCall; } // namespace Data namespace Calls { class GroupCall; } // namespace Calls namespace Calls::Group { class Viewport; class MembersRow; struct VolumeRequest; struct MuteRequest; enum class PanelMode; class Members final : public Ui::RpWidget , private PeerListContentDelegate { public: Members( not_null parent, not_null call, PanelMode mode, Ui::GL::Backend backend); ~Members(); [[nodiscard]] not_null viewport() const; [[nodiscard]] int desiredHeight() const; [[nodiscard]] rpl::producer desiredHeightValue() const override; [[nodiscard]] rpl::producer fullCountValue() const; [[nodiscard]] auto toggleMuteRequests() const -> rpl::producer; [[nodiscard]] auto changeVolumeRequests() const -> rpl::producer; [[nodiscard]] auto kickParticipantRequests() const -> rpl::producer>; [[nodiscard]] rpl::producer<> addMembersRequests() const { return _addMemberRequests.events(); } [[nodiscard]] MembersRow *lookupRow(not_null peer) const; void setMode(PanelMode mode); [[nodiscard]] QRect getInnerGeometry() const; private: class Controller; struct VideoTile; using ListWidget = PeerListContent; void resizeEvent(QResizeEvent *e) override; // PeerListContentDelegate interface. void peerListSetTitle(rpl::producer title) override; void peerListSetAdditionalTitle(rpl::producer title) override; void peerListSetHideEmpty(bool hide) override; bool peerListIsRowChecked(not_null row) override; int peerListSelectedRowsCount() override; void peerListScrollToTop() override; void peerListAddSelectedPeerInBunch( not_null peer) override; void peerListAddSelectedRowInBunch( not_null row) override; void peerListFinishSelectedRowsBunch() override; void peerListSetDescription( object_ptr description) override; void setupAddMember(not_null call); void resizeToList(); void setupList(); void setupFakeRoundCorners(); void trackViewportGeometry(); void updateControlsGeometry(); const not_null _call; rpl::variable _mode = PanelMode(); object_ptr _scroll; std::unique_ptr _listController; not_null _layout; const not_null _videoWrap; const std::unique_ptr _videoPlaceholder; std::unique_ptr _viewport; rpl::variable _addMemberButton = nullptr; RpWidget *_topSkip = nullptr; RpWidget *_bottomSkip = nullptr; ListWidget *_list = nullptr; rpl::event_stream<> _addMemberRequests; rpl::variable _canAddMembers; }; } // namespace Calls