/* 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/countryinput.h" #include "intro/intro_step.h" #include "base/timer.h" namespace Ui { class PhonePartInput; class CountryCodeInput; class RoundButton; class FlatLabel; } // namespace Ui namespace Intro { namespace details { class PhoneWidget final : public Step { public: PhoneWidget( QWidget *parent, not_null account, not_null data); void selectCountry(const QString &country); void setInnerFocus() override; void activate() override; void finished() override; void cancelled() override; void submit() override; bool hasBack() const override { return true; } protected: void resizeEvent(QResizeEvent *e) override; private: void setupQrLogin(); void phoneChanged(); void checkRequest(); void countryChanged(); void phoneSubmitDone(const MTPauth_SentCode &result); void phoneSubmitFail(const MTP::Error &error); QString fullNumber() const; void stopCheck(); void showPhoneError(rpl::producer text); void hidePhoneError(); bool _changed = false; object_ptr _country; object_ptr _code; object_ptr _phone; QString _sentPhone; mtpRequestId _sentRequest = 0; base::Timer _checkRequestTimer; }; } // namespace details } // namespace Intro