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 ScrollArea;
|
|
|
|
} // 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 {
|
|
|
|
|
|
|
|
class GroupCall;
|
|
|
|
|
|
|
|
class GroupMembers final
|
|
|
|
: public Ui::RpWidget
|
|
|
|
, private PeerListContentDelegate {
|
|
|
|
public:
|
|
|
|
GroupMembers(
|
2020-11-30 11:31:32 +00:00
|
|
|
not_null<QWidget*> parent,
|
2020-11-25 14:09:59 +00:00
|
|
|
not_null<GroupCall*> call);
|
|
|
|
|
2020-11-27 15:51:24 +00:00
|
|
|
struct MuteRequest {
|
|
|
|
not_null<UserData*> user;
|
|
|
|
bool mute = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
[[nodiscard]] int desiredHeight() const;
|
2020-11-27 16:55:18 +00:00
|
|
|
[[nodiscard]] rpl::producer<int> desiredHeightValue() const override;
|
2020-11-27 15:51:24 +00:00
|
|
|
[[nodiscard]] rpl::producer<MuteRequest> toggleMuteRequests() const;
|
2020-11-30 11:31:32 +00:00
|
|
|
[[nodiscard]] auto kickMemberRequests() const
|
|
|
|
-> rpl::producer<not_null<UserData*>>;
|
2020-11-28 18:17:13 +00:00
|
|
|
[[nodiscard]] rpl::producer<> addMembersRequests() const {
|
|
|
|
return _addMemberRequests.events();
|
|
|
|
}
|
2020-11-25 14:09:59 +00:00
|
|
|
|
|
|
|
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();
|
2020-11-30 11:31:32 +00:00
|
|
|
void setupFakeRoundCorners();
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2020-11-28 18:17:13 +00:00
|
|
|
void setupButtons(not_null<GroupCall*> call);
|
2020-11-25 14:09:59 +00:00
|
|
|
|
|
|
|
void updateHeaderControlsGeometry(int newWidth);
|
|
|
|
|
2020-11-28 09:01:50 +00:00
|
|
|
const base::weak_ptr<GroupCall> _call;
|
2020-11-25 14:09:59 +00:00
|
|
|
object_ptr<Ui::ScrollArea> _scroll;
|
|
|
|
std::unique_ptr<PeerListController> _listController;
|
|
|
|
object_ptr<Ui::RpWidget> _header = { nullptr };
|
|
|
|
ListWidget *_list = { nullptr };
|
2020-11-28 18:17:13 +00:00
|
|
|
rpl::event_stream<> _addMemberRequests;
|
2020-11-25 14:09:59 +00:00
|
|
|
|
|
|
|
Ui::RpWidget *_titleWrap = nullptr;
|
|
|
|
Ui::FlatLabel *_title = nullptr;
|
|
|
|
Ui::IconButton *_addMember = nullptr;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Calls
|