/* 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/rp_widget.h" class BoxContentDivider; namespace Ui { class VerticalLayout; class FlatLabel; template class SlideWrap; } // namespace Ui namespace Info { namespace Profile { class Button; } // namespace Profile } // namespace Info namespace Passport { class PanelController; class ScanButton; struct ScanInfo; class EditScans : public Ui::RpWidget { public: EditScans( QWidget *parent, not_null controller, const QString &header, const QString &errorMissing, std::vector &&files, std::unique_ptr &&selfie); base::optional validateGetErrorTop(); static void ChooseScan( QPointer parent, base::lambda callback); private: void setupContent(const QString &header); void chooseScan(); void chooseSelfie(); void updateScan(ScanInfo &&info); void pushScan(const ScanInfo &info); void createSelfieRow(const ScanInfo &info); base::unique_qptr> createScan( not_null parent, const ScanInfo &info, const QString &name); rpl::producer uploadButtonText() const; void toggleError(bool shown); void hideError(); void errorAnimationCallback(); bool uploadedSomeMore() const; void toggleSelfieError(bool shown); void hideSelfieError(); void selfieErrorAnimationCallback(); not_null _controller; std::vector _files; std::unique_ptr _selfie; int _initialCount = 0; QString _errorMissing; object_ptr _content; QPointer> _divider; QPointer> _header; QPointer> _uploadMoreError; QPointer _wrap; std::vector>> _rows; QPointer _upload; rpl::event_stream> _uploadTexts; bool _errorShown = false; Animation _errorAnimation; QPointer> _selfieHeader; QPointer _selfieWrap; base::unique_qptr> _selfieRow; QPointer _selfieUpload; bool _selfieErrorShown = false; Animation _selfieErrorAnimation; }; } // namespace Passport