tdesktop/Telegram/SourceFiles/calls/calls_group_members.h

91 lines
2.5 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 ScrollArea;
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
struct VolumeRequest;
struct MuteRequest;
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);
[[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
private:
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 setupFakeRoundCorners();
2020-11-25 14:09:59 +00:00
void updateControlsGeometry();
2020-11-25 14:09:59 +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::SettingsButton> _addMember = { nullptr };
rpl::variable<Ui::SettingsButton*> _addMemberButton = nullptr;
2020-11-25 14:09:59 +00:00
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
};
} // namespace Calls