/* 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_call.h" #include "ui/effects/animations.h" #include "ui/rp_widget.h" class Image; namespace Data { class PhotoMedia; class CloudImageView; } // namespace Data namespace Ui { class IconButton; class FlatLabel; template class FadeWrap; template class PaddingWrap; class Window; namespace Platform { class TitleControls; } // namespace Platform } // namespace Ui namespace style { struct CallSignalBars; struct CallBodyLayout; } // namespace style namespace Calls { class Userpic; class SignalBars; class VideoBubble; class Panel final { public: Panel(not_null call); ~Panel(); void showAndActivate(); void replaceCall(not_null call); void closeBeforeDestroy(); private: class Incoming; class Button; using State = Call::State; using Type = Call::Type; enum class AnswerHangupRedialState : uchar { Answer, Hangup, Redial, }; [[nodiscard]] not_null widget() const; void paint(QRect clip); void initWindow(); void initWidget(); void initControls(); void reinitWithCall(Call *call); void initLayout(); void initGeometry(); void handleClose(); QRect signalBarsRect() const; void paintSignalBarsBg(Painter &p); void updateControlsGeometry(); void updateHangupGeometry(); void updateStatusGeometry(); void updateOutgoingVideoBubbleGeometry(); void stateChanged(State state); void showControls(); void updateStatusText(State state); void startDurationUpdateTimer(crl::time currentDuration); void setIncomingSize(QSize size); void refreshIncomingGeometry(); void refreshOutgoingPreviewInBody(State state); void toggleFullScreen(bool fullscreen); void createRemoteAudioMute(); void refreshAnswerHangupRedialLabel(); [[nodiscard]] QRect incomingFrameGeometry() const; [[nodiscard]] QRect outgoingFrameGeometry() const; Call *_call = nullptr; not_null _user; const std::unique_ptr _window; std::unique_ptr _incoming; #ifdef Q_OS_WIN std::unique_ptr _controls; #endif // Q_OS_WIN QSize _incomingFrameSize; rpl::lifetime _callLifetime; not_null _bodySt; object_ptr