// This file is part of Desktop App Toolkit, // a set of libraries for developing nice desktop applications. // // For license and copyright information please follow this link: // https://github.com/desktop-app/legal/blob/master/LEGAL // #pragma once #include "ui/effects/spoiler_mess.h" #include "ui/effects/animations.h" #include "ui/click_handler.h" namespace Ui::Text { struct Modification; class String; class SpoilerClickHandler final : public ClickHandler { public: SpoilerClickHandler( not_null text, Fn filter); [[nodiscard]] not_null text() const; void setText(not_null text); void onClick(ClickContext context) const override; private: not_null _text; const Fn _filter; }; class PreClickHandler final : public ClickHandler { public: PreClickHandler(not_null text, uint16 offset, uint16 length); [[nodiscard]] not_null text() const; void setText(not_null text); void onClick(ClickContext context) const override; private: not_null _text; uint16 _offset = 0; uint16 _length = 0; }; struct SpoilerData { explicit SpoilerData(Fn repaint) : animation(std::move(repaint)) { } SpoilerAnimation animation; std::shared_ptr link; Animations::Simple revealAnimation; bool revealed = false; }; struct QuoteDetails { QString language; std::shared_ptr copy; int copyWidth = 0; int maxWidth = 0; int minHeight = 0; int scrollLeft = 0; bool blockquote = false; bool pre = false; }; struct ExtendedData { std::vector links; std::vector quotes; std::unique_ptr spoiler; std::vector modifications; }; } // namespace Ui::Text