tdesktop/Telegram/SourceFiles/calls/group/calls_group_members.h

108 lines
2.9 KiB
C
Raw Normal View History

2020-11-25 14:09:59 +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 "boxes/peer_list_box.h"
namespace Ui {
class RpWidget;
2020-11-25 14:09:59 +00:00
class ScrollArea;
class VerticalLayout;
class SettingsButton;
2020-11-25 14:09:59 +00:00
} // namespace Ui
namespace Data {
class GroupCall;
} // namespace Data
2020-11-25 14:09:59 +00:00
namespace Calls {
class GroupCall;
} // namespace Calls
namespace Calls::Group {
2020-11-25 14:09:59 +00:00
2021-05-11 11:07:16 +00:00
class LargeVideo;
class MembersRow;
struct VolumeRequest;
struct MuteRequest;
enum class PanelMode;
2020-11-25 14:09:59 +00:00
class Members final
2020-11-25 14:09:59 +00:00
: public Ui::RpWidget
, private PeerListContentDelegate {
public:
Members(
not_null<QWidget*> parent,
2020-11-25 14:09:59 +00:00
not_null<GroupCall*> call);
~Members();
2020-11-25 14:09:59 +00:00
[[nodiscard]] int desiredHeight() const;
2020-11-27 16:55:18 +00:00
[[nodiscard]] rpl::producer<int> desiredHeightValue() const override;
[[nodiscard]] rpl::producer<int> fullCountValue() const;
[[nodiscard]] auto toggleMuteRequests() const
-> rpl::producer<Group::MuteRequest>;
[[nodiscard]] auto changeVolumeRequests() const
-> rpl::producer<Group::VolumeRequest>;
2021-03-03 15:29:33 +00:00
[[nodiscard]] auto kickParticipantRequests() const
-> rpl::producer<not_null<PeerData*>>;
[[nodiscard]] rpl::producer<> addMembersRequests() const {
return _addMemberRequests.events();
}
2020-11-25 14:09:59 +00:00
[[nodiscard]] MembersRow *lookupRow(not_null<PeerData*> peer) const;
void setMode(PanelMode mode);
2020-11-25 14:09:59 +00:00
private:
class Controller;
2020-11-25 14:09:59 +00:00
using ListWidget = PeerListContent;
void resizeEvent(QResizeEvent *e) override;
// PeerListContentDelegate interface.
void peerListSetTitle(rpl::producer<QString> title) override;
void peerListSetAdditionalTitle(rpl::producer<QString> title) override;
void peerListSetHideEmpty(bool hide) override;
2020-11-25 14:09:59 +00:00
bool peerListIsRowChecked(not_null<PeerListRow*> row) override;
int peerListSelectedRowsCount() override;
void peerListScrollToTop() 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 setupAddMember(not_null<GroupCall*> call);
void resizeToList();
2020-11-25 14:09:59 +00:00
void setupList();
void setupPinnedVideo();
void setupFakeRoundCorners();
2020-11-25 14:09:59 +00:00
void updateControlsGeometry();
2020-11-25 14:09:59 +00:00
const not_null<GroupCall*> _call;
rpl::variable<PanelMode> _mode = PanelMode();
2020-11-25 14:09:59 +00:00
object_ptr<Ui::ScrollArea> _scroll;
std::unique_ptr<Controller> _listController;
not_null<Ui::VerticalLayout*> _layout;
2021-05-11 11:07:16 +00:00
const not_null<Ui::RpWidget*> _pinnedVideoWrap;
const std::unique_ptr<LargeVideo> _pinnedVideo;
rpl::variable<Ui::RpWidget*> _addMemberButton = nullptr;
ListWidget *_list = nullptr;
rpl::event_stream<> _addMemberRequests;
2020-11-25 14:09:59 +00:00
rpl::variable<bool> _canAddMembers;
2020-11-25 14:09:59 +00:00
rpl::lifetime _pinnedTrackLifetime;
2020-11-25 14:09:59 +00:00
};
} // namespace Calls