2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-10-21 14:38:26 +00:00
Files
tdesktop/Telegram/SourceFiles/calls/group/calls_group_common.h

161 lines
3.2 KiB
C
Raw Normal View History

/*
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/object_ptr.h"
2025-03-29 12:52:36 +05:00
#include "base/weak_ptr.h"
class UserData;
2025-03-29 12:52:36 +05:00
struct ShareBoxStyleOverrides;
namespace style {
struct Box;
struct FlatLabel;
struct IconButton;
struct InputField;
} // namespace style
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
namespace Ui {
class Show;
class GenericBox;
} // namespace Ui
2025-03-25 22:38:13 +05:00
namespace TdE2E {
class Call;
} // namespace TdE2E
namespace Window {
class SessionController;
} // namespace Window
namespace Calls::Group {
constexpr auto kDefaultVolume = 10000;
constexpr auto kMaxVolume = 20000;
constexpr auto kBlobsEnterDuration = crl::time(250);
struct MuteRequest {
2021-03-03 19:29:33 +04:00
not_null<PeerData*> peer;
bool mute = false;
bool locallyOnly = false;
};
struct VolumeRequest {
2021-03-03 19:29:33 +04:00
not_null<PeerData*> peer;
int volume = kDefaultVolume;
bool finalized = true;
bool locallyOnly = false;
};
struct ParticipantState {
2021-03-03 19:29:33 +04:00
not_null<PeerData*> peer;
std::optional<int> volume;
bool mutedByMe = false;
bool locallyOnly = false;
};
struct RejoinEvent {
not_null<PeerData*> wasJoinAs;
not_null<PeerData*> nowJoinAs;
};
2022-03-01 08:19:00 +03:00
struct RtmpInfo {
QString url;
QString key;
};
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;
TimeId scheduleDate = 0;
bool rtmp = false;
};
2025-03-25 00:11:21 +05:00
struct ConferenceInfo {
std::shared_ptr<Data::GroupCall> call;
2025-03-25 22:38:13 +05:00
std::shared_ptr<TdE2E::Call> e2e;
2025-03-25 00:11:21 +05:00
QString linkSlug;
MsgId joinMessageId;
};
enum class PanelMode {
Default,
Wide,
};
2021-05-12 19:02:45 +04:00
enum class VideoQuality {
Thumbnail,
Medium,
Full,
};
enum class Error {
NoCamera,
CameraFailed,
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>;
[[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,
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;
Fn<void(bool)> finished;
base::weak_ptr<Window::SessionController> weakWindow = nullptr;
ConferenceCallLinkStyleOverrides st;
};
void ShowConferenceCallLinkBox(
2025-03-29 12:52:36 +05:00
std::shared_ptr<Main::SessionShow> show,
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);
} // namespace Calls::Group