/* 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 "ui/effects/animations.h" struct TextWithTags; namespace ChatHelpers { class Show; class TabbedPanel; } // namespace ChatHelpers namespace Ui { class EmojiButton; class InputField; class SendButton; class RpWidget; } // namespace Ui namespace Calls::Group { class ReactionPanel; class MessageField final { public: MessageField( not_null parent, std::shared_ptr show, PeerData *peer); ~MessageField(); void resizeToWidth(int newWidth); void move(int x, int y); void toggle(bool shown); void raise(); [[nodiscard]] int height() const; [[nodiscard]] rpl::producer heightValue() const; [[nodiscard]] rpl::producer submitted() const; [[nodiscard]] rpl::producer<> closeRequests() const; [[nodiscard]] rpl::producer<> closed() const; [[nodiscard]] rpl::lifetime &lifetime(); private: void createControls(PeerData *peer); void setupBackground(); void shownAnimationCallback(); void updateEmojiPanelGeometry(); void updateWrapSize(int widthOverride = 0); void updateHeight(); const not_null _parent; const std::shared_ptr _show; const std::unique_ptr _wrap; int _limit = 0; Ui::InputField *_field = nullptr; Ui::SendButton *_send = nullptr; Ui::EmojiButton *_emojiToggle = nullptr; std::unique_ptr _emojiPanel; std::unique_ptr _reactionPanel; rpl::variable _fieldFocused; rpl::variable _fieldEmpty = true; rpl::variable _width; rpl::variable _height; bool _shown = false; Ui::Animations::Simple _shownAnimation; std::unique_ptr _cache; rpl::event_stream _submitted; rpl::event_stream<> _closeRequests; rpl::event_stream<> _closed; rpl::lifetime _lifetime; }; } // namespace Calls::Group