2020-11-24 12:54:20 +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 "base/weak_ptr.h"
|
|
|
|
#include "base/timer.h"
|
|
|
|
#include "base/object_ptr.h"
|
|
|
|
#include "calls/calls_group_call.h"
|
2021-03-09 15:13:48 +00:00
|
|
|
#include "calls/calls_choose_join_as.h"
|
2020-11-24 12:54:20 +00:00
|
|
|
#include "ui/effects/animations.h"
|
|
|
|
#include "ui/rp_widget.h"
|
|
|
|
|
|
|
|
class Image;
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
class PhotoMedia;
|
|
|
|
class CloudImageView;
|
2021-03-05 16:59:35 +00:00
|
|
|
class GroupCall;
|
2020-11-24 12:54:20 +00:00
|
|
|
} // namespace Data
|
|
|
|
|
|
|
|
namespace Ui {
|
2021-03-09 13:24:32 +00:00
|
|
|
class AbstractButton;
|
2021-03-09 15:13:48 +00:00
|
|
|
class DropdownMenu;
|
2020-11-28 12:00:06 +00:00
|
|
|
class CallButton;
|
|
|
|
class CallMuteButton;
|
2020-11-24 12:54:20 +00:00
|
|
|
class IconButton;
|
|
|
|
class FlatLabel;
|
|
|
|
template <typename Widget>
|
|
|
|
class FadeWrap;
|
|
|
|
template <typename Widget>
|
|
|
|
class PaddingWrap;
|
|
|
|
class Window;
|
2020-11-25 14:09:59 +00:00
|
|
|
class ScrollArea;
|
2020-11-28 14:07:36 +00:00
|
|
|
class GenericBox;
|
2020-11-27 14:50:41 +00:00
|
|
|
class LayerManager;
|
2020-11-24 12:54:20 +00:00
|
|
|
namespace Platform {
|
|
|
|
class TitleControls;
|
|
|
|
} // namespace Platform
|
|
|
|
} // namespace Ui
|
|
|
|
|
|
|
|
namespace style {
|
|
|
|
struct CallSignalBars;
|
|
|
|
struct CallBodyLayout;
|
|
|
|
} // namespace style
|
|
|
|
|
2021-03-15 18:40:59 +00:00
|
|
|
namespace Calls::Group {
|
2020-11-24 12:54:20 +00:00
|
|
|
|
2021-03-15 18:40:59 +00:00
|
|
|
class Members;
|
2020-11-24 12:54:20 +00:00
|
|
|
|
2021-03-15 18:40:59 +00:00
|
|
|
class Panel final {
|
2020-11-24 12:54:20 +00:00
|
|
|
public:
|
2021-03-15 18:40:59 +00:00
|
|
|
Panel(not_null<GroupCall*> call);
|
|
|
|
~Panel();
|
2020-11-24 12:54:20 +00:00
|
|
|
|
2020-12-08 17:06:56 +00:00
|
|
|
[[nodiscard]] bool isActive() const;
|
2020-12-22 16:09:32 +00:00
|
|
|
void minimize();
|
|
|
|
void close();
|
2020-11-24 12:54:20 +00:00
|
|
|
void showAndActivate();
|
|
|
|
void closeBeforeDestroy();
|
|
|
|
|
|
|
|
private:
|
|
|
|
using State = GroupCall::State;
|
|
|
|
|
|
|
|
[[nodiscard]] not_null<Ui::RpWidget*> widget() const;
|
|
|
|
|
|
|
|
void paint(QRect clip);
|
|
|
|
|
|
|
|
void initWindow();
|
|
|
|
void initWidget();
|
|
|
|
void initControls();
|
|
|
|
void initWithCall(GroupCall *call);
|
|
|
|
void initLayout();
|
|
|
|
void initGeometry();
|
2021-03-16 14:13:51 +00:00
|
|
|
void setupJoinAsChangedToasts();
|
|
|
|
void setupTitleChangedToasts();
|
2020-11-24 12:54:20 +00:00
|
|
|
|
2020-11-25 14:09:59 +00:00
|
|
|
bool handleClose();
|
2020-11-24 12:54:20 +00:00
|
|
|
|
|
|
|
void updateControlsGeometry();
|
|
|
|
void showControls();
|
|
|
|
|
2020-12-15 10:49:31 +00:00
|
|
|
void endCall();
|
2020-11-28 14:07:36 +00:00
|
|
|
|
2021-03-09 15:13:48 +00:00
|
|
|
void showMainMenu();
|
|
|
|
void chooseJoinAs();
|
2020-11-28 18:17:13 +00:00
|
|
|
void addMembers();
|
2020-11-30 11:31:32 +00:00
|
|
|
void kickMember(not_null<UserData*> user);
|
|
|
|
void kickMemberSure(not_null<UserData*> user);
|
2021-03-09 13:24:32 +00:00
|
|
|
[[nodiscard]] QRect computeTitleRect() const;
|
2020-11-26 13:04:11 +00:00
|
|
|
void refreshTitle();
|
2021-03-05 16:59:35 +00:00
|
|
|
void refreshTitleGeometry();
|
|
|
|
void setupRealCallViewers(not_null<GroupCall*> call);
|
|
|
|
void subscribeToChanges(not_null<Data::GroupCall*> real);
|
2020-11-26 13:04:11 +00:00
|
|
|
|
2020-12-14 12:52:18 +00:00
|
|
|
void migrate(not_null<ChannelData*> channel);
|
|
|
|
void subscribeToPeerChanges();
|
|
|
|
|
2020-11-24 12:54:20 +00:00
|
|
|
GroupCall *_call = nullptr;
|
2020-12-14 12:52:18 +00:00
|
|
|
not_null<PeerData*> _peer;
|
2020-11-24 12:54:20 +00:00
|
|
|
|
|
|
|
const std::unique_ptr<Ui::Window> _window;
|
2020-11-27 14:50:41 +00:00
|
|
|
const std::unique_ptr<Ui::LayerManager> _layerBg;
|
2020-11-24 12:54:20 +00:00
|
|
|
|
2021-02-03 10:43:31 +00:00
|
|
|
#ifndef Q_OS_MAC
|
2020-11-24 12:54:20 +00:00
|
|
|
std::unique_ptr<Ui::Platform::TitleControls> _controls;
|
2021-02-03 10:43:31 +00:00
|
|
|
#endif // !Q_OS_MAC
|
2020-11-24 12:54:20 +00:00
|
|
|
|
|
|
|
rpl::lifetime _callLifetime;
|
|
|
|
|
2020-11-26 13:04:11 +00:00
|
|
|
object_ptr<Ui::FlatLabel> _title = { nullptr };
|
2020-12-16 15:31:16 +00:00
|
|
|
object_ptr<Ui::FlatLabel> _subtitle = { nullptr };
|
2021-03-09 13:24:32 +00:00
|
|
|
object_ptr<Ui::AbstractButton> _recordingMark = { nullptr };
|
2021-03-09 15:13:48 +00:00
|
|
|
object_ptr<Ui::IconButton> _menuToggle = { nullptr };
|
|
|
|
object_ptr<Ui::DropdownMenu> _menu = { nullptr };
|
|
|
|
object_ptr<Ui::AbstractButton> _joinAsToggle = { nullptr };
|
2021-03-15 18:40:59 +00:00
|
|
|
object_ptr<Members> _members;
|
2021-03-05 16:59:35 +00:00
|
|
|
rpl::variable<QString> _titleText;
|
2021-03-15 18:40:59 +00:00
|
|
|
ChooseJoinAsProcess _joinAsProcess;
|
2020-11-25 14:09:59 +00:00
|
|
|
|
2020-11-28 12:00:06 +00:00
|
|
|
object_ptr<Ui::CallButton> _settings;
|
|
|
|
std::unique_ptr<Ui::CallMuteButton> _mute;
|
|
|
|
object_ptr<Ui::CallButton> _hangup;
|
2020-11-24 12:54:20 +00:00
|
|
|
|
2020-12-14 12:52:18 +00:00
|
|
|
rpl::lifetime _peerLifetime;
|
|
|
|
|
2020-11-24 12:54:20 +00:00
|
|
|
};
|
|
|
|
|
2021-03-15 18:40:59 +00:00
|
|
|
} // namespace Calls::Group
|