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 {
|
2021-04-23 14:47:03 +00:00
|
|
|
class RpWidget;
|
2020-11-25 14:09:59 +00:00
|
|
|
class ScrollArea;
|
2021-04-23 14:47:03 +00:00
|
|
|
class VerticalLayout;
|
2020-12-16 15:31:16 +00:00
|
|
|
class SettingsButton;
|
2020-11-25 14:09:59 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2020-11-27 14:50:41 +00:00
|
|
|
namespace Data {
|
|
|
|
class GroupCall;
|
|
|
|
} // namespace Data
|
|
|
|
|
2020-11-25 14:09:59 +00:00
|
|
|
namespace Calls {
|
2021-03-15 18:40:59 +00:00
|
|
|
class GroupCall;
|
|
|
|
} // namespace Calls
|
|
|
|
|
|
|
|
namespace Calls::Group {
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2021-05-24 09:06:34 +00:00
|
|
|
class Viewport;
|
2021-05-07 15:37:28 +00:00
|
|
|
class MembersRow;
|
2021-01-14 00:25:59 +00:00
|
|
|
struct VolumeRequest;
|
|
|
|
struct MuteRequest;
|
2021-04-22 16:05:17 +00:00
|
|
|
enum class PanelMode;
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2021-03-15 18:40:59 +00:00
|
|
|
class Members final
|
2020-11-25 14:09:59 +00:00
|
|
|
: public Ui::RpWidget
|
|
|
|
, private PeerListContentDelegate {
|
|
|
|
public:
|
2021-03-15 18:40:59 +00:00
|
|
|
Members(
|
2020-11-30 11:31:32 +00:00
|
|
|
not_null<QWidget*> parent,
|
2021-05-24 09:06:34 +00:00
|
|
|
not_null<GroupCall*> call,
|
|
|
|
PanelMode mode);
|
2021-05-07 15:37:28 +00:00
|
|
|
~Members();
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2021-05-29 19:57:21 +00:00
|
|
|
[[nodiscard]] not_null<Viewport*> viewport() const;
|
2020-11-27 15:51:24 +00:00
|
|
|
[[nodiscard]] int desiredHeight() const;
|
2020-11-27 16:55:18 +00:00
|
|
|
[[nodiscard]] rpl::producer<int> desiredHeightValue() const override;
|
2020-12-16 15:31:16 +00:00
|
|
|
[[nodiscard]] rpl::producer<int> fullCountValue() const;
|
2021-01-14 00:25:59 +00:00
|
|
|
[[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*>>;
|
2020-11-28 18:17:13 +00:00
|
|
|
[[nodiscard]] rpl::producer<> addMembersRequests() const {
|
|
|
|
return _addMemberRequests.events();
|
|
|
|
}
|
2021-05-11 15:00:37 +00:00
|
|
|
[[nodiscard]] rpl::producer<> enlargeVideo() const;
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2021-05-07 15:37:28 +00:00
|
|
|
[[nodiscard]] MembersRow *lookupRow(not_null<PeerData*> peer) const;
|
|
|
|
|
2021-04-22 16:05:17 +00:00
|
|
|
void setMode(PanelMode mode);
|
2021-05-21 13:15:45 +00:00
|
|
|
[[nodiscard]] QRect getInnerGeometry() const;
|
2021-04-22 16:05:17 +00:00
|
|
|
|
2020-11-25 14:09:59 +00:00
|
|
|
private:
|
2021-05-07 15:37:28 +00:00
|
|
|
class Controller;
|
2021-05-12 15:02:45 +00:00
|
|
|
struct VideoTile;
|
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;
|
2020-12-21 19:43:23 +00:00
|
|
|
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;
|
|
|
|
|
2020-12-16 15:31:16 +00:00
|
|
|
void setupAddMember(not_null<GroupCall*> call);
|
|
|
|
void resizeToList();
|
2020-11-25 14:09:59 +00:00
|
|
|
void setupList();
|
2020-11-30 11:31:32 +00:00
|
|
|
void setupFakeRoundCorners();
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2021-05-24 11:13:23 +00:00
|
|
|
void trackViewportGeometry();
|
2020-12-16 15:31:16 +00:00
|
|
|
void updateControlsGeometry();
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2021-04-05 12:28:25 +00:00
|
|
|
const not_null<GroupCall*> _call;
|
2021-04-23 14:47:03 +00:00
|
|
|
rpl::variable<PanelMode> _mode = PanelMode();
|
2020-11-25 14:09:59 +00:00
|
|
|
object_ptr<Ui::ScrollArea> _scroll;
|
2021-05-07 15:37:28 +00:00
|
|
|
std::unique_ptr<Controller> _listController;
|
2021-04-23 14:47:03 +00:00
|
|
|
not_null<Ui::VerticalLayout*> _layout;
|
2021-05-24 11:13:23 +00:00
|
|
|
const not_null<Ui::RpWidget*> _videoWrap;
|
2021-05-29 19:57:21 +00:00
|
|
|
std::unique_ptr<Viewport> _viewport;
|
2021-05-12 15:02:45 +00:00
|
|
|
rpl::event_stream<> _enlargeVideoClicks;
|
2021-05-06 15:57:40 +00:00
|
|
|
rpl::variable<Ui::RpWidget*> _addMemberButton = nullptr;
|
2021-04-23 14:47:03 +00:00
|
|
|
ListWidget *_list = nullptr;
|
2020-11-28 18:17:13 +00:00
|
|
|
rpl::event_stream<> _addMemberRequests;
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2020-12-14 12:52:18 +00:00
|
|
|
rpl::variable<bool> _canAddMembers;
|
2020-11-25 14:09:59 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Calls
|