intro_signup.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "intro/intro_step.h"
  9. namespace Ui {
  10. class RoundButton;
  11. class InputField;
  12. class UserpicButton;
  13. } // namespace Ui
  14. namespace Intro {
  15. namespace details {
  16. class SignupWidget final : public Step {
  17. public:
  18. SignupWidget(
  19. QWidget *parent,
  20. not_null<Main::Account*> account,
  21. not_null<Data*> data);
  22. void finishInit() override;
  23. void setInnerFocus() override;
  24. void activate() override;
  25. void cancelled() override;
  26. void submit() override;
  27. rpl::producer<QString> nextButtonText() const override;
  28. protected:
  29. void resizeEvent(QResizeEvent *e) override;
  30. private:
  31. void refreshLang();
  32. void updateControlsGeometry();
  33. void nameSubmitDone(const MTPauth_Authorization &result);
  34. void nameSubmitFail(const MTP::Error &error);
  35. object_ptr<Ui::UserpicButton> _photo;
  36. object_ptr<Ui::InputField> _first;
  37. object_ptr<Ui::InputField> _last;
  38. QString _firstName, _lastName;
  39. mtpRequestId _sentRequest = 0;
  40. bool _invertOrder = false;
  41. bool _termsAccepted = false;
  42. };
  43. } // namespace details
  44. } // namespace Intro