/* 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 "passport/passport_form_controller.h" namespace Passport { struct Scope { enum class Type { Identity, Address, Phone, Email, }; Scope(Type type, not_null fields); Type type; not_null fields; std::vector> documents; bool selfieRequired = false; }; struct ScopeRow { QString title; QString description; QString ready; QString error; }; std::vector ComputeScopes( not_null controller); QString ComputeScopeRowReadyString(const Scope &scope); ScopeRow ComputeScopeRow(const Scope &scope); class ViewController { public: virtual void showAskPassword() = 0; virtual void showNoPassword() = 0; virtual void showCriticalError(const QString &error) = 0; virtual void editScope(int index) = 0; virtual void showBox( object_ptr box, LayerOptions options, anim::type animated) = 0; virtual void showToast(const QString &text) = 0; virtual void suggestReset(Fn callback) = 0; virtual int closeGetDuration() = 0; virtual ~ViewController() { } template QPointer show( object_ptr box, LayerOptions options = LayerOption::KeepOther, anim::type animated = anim::type::normal) { auto result = QPointer(box.data()); showBox(std::move(box), options, animated); return result; } }; } // namespace Passport