2021-01-14 03:25:59 +03: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
|
|
|
|
|
2021-07-27 21:09:13 +03:00
|
|
|
#include "base/object_ptr.h"
|
2025-03-29 12:52:36 +05:00
|
|
|
#include "base/weak_ptr.h"
|
2021-07-27 21:09:13 +03:00
|
|
|
|
2021-01-14 03:25:59 +03:00
|
|
|
class UserData;
|
2025-03-29 12:52:36 +05:00
|
|
|
struct ShareBoxStyleOverrides;
|
|
|
|
|
|
|
|
namespace style {
|
|
|
|
struct Box;
|
|
|
|
struct FlatLabel;
|
|
|
|
struct IconButton;
|
|
|
|
struct InputField;
|
|
|
|
} // namespace style
|
2021-01-14 03:25:59 +03:00
|
|
|
|
2025-03-24 21:58:06 +04:00
|
|
|
namespace Data {
|
|
|
|
class GroupCall;
|
|
|
|
} // namespace Data
|
|
|
|
|
2025-03-29 12:52:36 +05:00
|
|
|
namespace Main {
|
|
|
|
class SessionShow;
|
|
|
|
} // namespace Main
|
|
|
|
|
2021-07-27 21:09:13 +03:00
|
|
|
namespace Ui {
|
2025-03-28 00:41:05 +05:00
|
|
|
class Show;
|
2021-07-27 21:09:13 +03:00
|
|
|
class GenericBox;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2025-03-25 22:38:13 +05:00
|
|
|
namespace TdE2E {
|
|
|
|
class Call;
|
|
|
|
} // namespace TdE2E
|
|
|
|
|
2025-04-02 00:13:14 +05:00
|
|
|
namespace tgcalls {
|
|
|
|
class VideoCaptureInterface;
|
|
|
|
} // namespace tgcalls
|
|
|
|
|
2025-03-28 00:41:05 +05:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
|
|
|
|
2025-04-01 16:09:23 +05:00
|
|
|
namespace Calls {
|
|
|
|
|
|
|
|
struct InviteRequest {
|
|
|
|
not_null<UserData*> user;
|
|
|
|
bool video = false;
|
|
|
|
};
|
2025-04-02 00:13:14 +05:00
|
|
|
|
2025-04-01 16:09:23 +05:00
|
|
|
struct InviteResult {
|
|
|
|
std::vector<not_null<UserData*>> invited;
|
|
|
|
std::vector<not_null<UserData*>> alreadyIn;
|
|
|
|
std::vector<not_null<UserData*>> privacyRestricted;
|
|
|
|
};
|
|
|
|
|
2025-04-02 00:13:14 +05:00
|
|
|
struct StartConferenceInfo {
|
|
|
|
std::shared_ptr<Data::GroupCall> call;
|
|
|
|
std::shared_ptr<TdE2E::Call> e2e;
|
|
|
|
QString linkSlug;
|
|
|
|
MsgId joinMessageId;
|
|
|
|
std::vector<InviteRequest> invite;
|
2025-04-03 16:50:55 +05:00
|
|
|
bool sharingLink = false;
|
2025-04-02 00:13:14 +05:00
|
|
|
bool migrating = false;
|
|
|
|
bool muted = false;
|
|
|
|
std::shared_ptr<tgcalls::VideoCaptureInterface> videoCapture;
|
|
|
|
QString videoCaptureScreenId;
|
|
|
|
};
|
|
|
|
|
2025-04-04 22:35:57 +05:00
|
|
|
struct ConferencePanelMigration {
|
|
|
|
QScreen *screen = nullptr;
|
|
|
|
QRect geometry;
|
|
|
|
};
|
|
|
|
|
2025-04-01 16:09:23 +05:00
|
|
|
} // namespace Calls
|
|
|
|
|
2021-01-14 03:25:59 +03:00
|
|
|
namespace Calls::Group {
|
|
|
|
|
|
|
|
constexpr auto kDefaultVolume = 10000;
|
|
|
|
constexpr auto kMaxVolume = 20000;
|
2021-05-07 17:01:54 +04:00
|
|
|
constexpr auto kBlobsEnterDuration = crl::time(250);
|
2021-01-14 03:25:59 +03:00
|
|
|
|
|
|
|
struct MuteRequest {
|
2021-03-03 19:29:33 +04:00
|
|
|
not_null<PeerData*> peer;
|
2021-01-14 03:25:59 +03:00
|
|
|
bool mute = false;
|
2021-01-15 14:22:12 +03:00
|
|
|
bool locallyOnly = false;
|
2021-01-14 03:25:59 +03:00
|
|
|
};
|
2021-02-09 12:58:19 +04:00
|
|
|
|
2021-01-14 03:25:59 +03:00
|
|
|
struct VolumeRequest {
|
2021-03-03 19:29:33 +04:00
|
|
|
not_null<PeerData*> peer;
|
2021-01-14 03:25:59 +03:00
|
|
|
int volume = kDefaultVolume;
|
|
|
|
bool finalized = true;
|
2021-01-15 14:22:12 +03:00
|
|
|
bool locallyOnly = false;
|
2021-01-14 03:25:59 +03:00
|
|
|
};
|
|
|
|
|
2021-01-15 19:05:34 +03:00
|
|
|
struct ParticipantState {
|
2021-03-03 19:29:33 +04:00
|
|
|
not_null<PeerData*> peer;
|
2021-01-15 19:05:34 +03:00
|
|
|
std::optional<int> volume;
|
|
|
|
bool mutedByMe = false;
|
|
|
|
bool locallyOnly = false;
|
|
|
|
};
|
|
|
|
|
2021-03-05 19:21:11 +04:00
|
|
|
struct RejoinEvent {
|
|
|
|
not_null<PeerData*> wasJoinAs;
|
|
|
|
not_null<PeerData*> nowJoinAs;
|
|
|
|
};
|
|
|
|
|
2022-03-01 08:19:00 +03:00
|
|
|
struct RtmpInfo {
|
|
|
|
QString url;
|
|
|
|
QString key;
|
|
|
|
};
|
|
|
|
|
2021-03-05 19:21:11 +04:00
|
|
|
struct JoinInfo {
|
|
|
|
not_null<PeerData*> peer;
|
|
|
|
not_null<PeerData*> joinAs;
|
|
|
|
std::vector<not_null<PeerData*>> possibleJoinAs;
|
2021-03-11 00:03:20 +04:00
|
|
|
QString joinHash;
|
2022-03-01 08:19:00 +03:00
|
|
|
RtmpInfo rtmpInfo;
|
2021-04-05 14:29:03 +04:00
|
|
|
TimeId scheduleDate = 0;
|
2022-02-25 14:14:15 +03:00
|
|
|
bool rtmp = false;
|
2021-03-05 19:21:11 +04:00
|
|
|
};
|
|
|
|
|
2021-04-22 20:05:17 +04:00
|
|
|
enum class PanelMode {
|
|
|
|
Default,
|
|
|
|
Wide,
|
|
|
|
};
|
|
|
|
|
2021-05-12 19:02:45 +04:00
|
|
|
enum class VideoQuality {
|
|
|
|
Thumbnail,
|
|
|
|
Medium,
|
|
|
|
Full,
|
|
|
|
};
|
|
|
|
|
2021-05-28 13:23:24 +04:00
|
|
|
enum class Error {
|
|
|
|
NoCamera,
|
2021-06-23 12:04:05 +04:00
|
|
|
CameraFailed,
|
2021-05-28 13:23:24 +04:00
|
|
|
ScreenFailed,
|
|
|
|
MutedNoCamera,
|
|
|
|
MutedNoScreen,
|
|
|
|
DisabledNoCamera,
|
|
|
|
DisabledNoScreen,
|
|
|
|
};
|
|
|
|
|
2021-06-18 17:45:22 +04:00
|
|
|
enum class StickedTooltip {
|
|
|
|
Camera = 0x01,
|
|
|
|
Microphone = 0x02,
|
|
|
|
};
|
|
|
|
constexpr inline bool is_flag_type(StickedTooltip) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
using StickedTooltips = base::flags<StickedTooltip>;
|
|
|
|
|
2021-07-27 21:09:13 +03:00
|
|
|
[[nodiscard]] object_ptr<Ui::GenericBox> ScreenSharingPrivacyRequestBox();
|
|
|
|
|
2025-03-24 21:58:06 +04:00
|
|
|
void ConferenceCallJoinConfirm(
|
|
|
|
not_null<Ui::GenericBox*> box,
|
2025-03-25 00:11:21 +05:00
|
|
|
std::shared_ptr<Data::GroupCall> call,
|
2025-04-01 00:28:01 +05:00
|
|
|
UserData *maybeInviter,
|
2025-03-25 00:11:21 +05:00
|
|
|
Fn<void()> join);
|
2025-03-24 21:58:06 +04:00
|
|
|
|
2025-03-29 12:52:36 +05:00
|
|
|
struct ConferenceCallLinkStyleOverrides {
|
|
|
|
const style::Box *box = nullptr;
|
|
|
|
const style::IconButton *close = nullptr;
|
|
|
|
const style::FlatLabel *centerLabel = nullptr;
|
|
|
|
const style::InputField *linkPreview = nullptr;
|
|
|
|
std::shared_ptr<ShareBoxStyleOverrides> shareBox;
|
|
|
|
};
|
|
|
|
[[nodiscard]] ConferenceCallLinkStyleOverrides DarkConferenceCallLinkStyle();
|
|
|
|
|
|
|
|
struct ConferenceCallLinkArgs {
|
|
|
|
bool initial = false;
|
2025-03-30 00:53:11 +05:00
|
|
|
bool joining = false;
|
|
|
|
Fn<void(QString)> finished;
|
2025-04-02 00:13:14 +05:00
|
|
|
StartConferenceInfo info;
|
2025-03-29 12:52:36 +05:00
|
|
|
ConferenceCallLinkStyleOverrides st;
|
|
|
|
};
|
2025-03-28 00:41:05 +05:00
|
|
|
void ShowConferenceCallLinkBox(
|
2025-03-29 12:52:36 +05:00
|
|
|
std::shared_ptr<Main::SessionShow> show,
|
2025-03-28 00:41:05 +05:00
|
|
|
std::shared_ptr<Data::GroupCall> call,
|
|
|
|
const QString &link,
|
2025-03-29 12:52:36 +05:00
|
|
|
ConferenceCallLinkArgs &&args);
|
|
|
|
|
|
|
|
void ExportConferenceCallLink(
|
|
|
|
std::shared_ptr<Main::SessionShow> show,
|
|
|
|
std::shared_ptr<Data::GroupCall> call,
|
|
|
|
ConferenceCallLinkArgs &&args);
|
2025-03-28 00:41:05 +05:00
|
|
|
|
2025-03-30 00:53:11 +05:00
|
|
|
struct ConferenceFactoryArgs {
|
|
|
|
std::shared_ptr<Main::SessionShow> show;
|
|
|
|
Fn<void(QString)> finished;
|
|
|
|
bool joining = false;
|
2025-04-02 00:13:14 +05:00
|
|
|
StartConferenceInfo info;
|
2025-03-30 00:53:11 +05:00
|
|
|
};
|
|
|
|
void MakeConferenceCall(ConferenceFactoryArgs &&args);
|
|
|
|
|
2021-01-14 03:25:59 +03:00
|
|
|
} // namespace Calls::Group
|