passport_panel.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 "ui/layers/layer_widget.h"
  9. namespace Ui {
  10. class RpWidget;
  11. class SeparatePanel;
  12. class BoxContent;
  13. } // namespace Ui
  14. namespace Passport {
  15. class PanelController;
  16. class Panel {
  17. public:
  18. Panel(not_null<PanelController*> controller);
  19. int hideAndDestroyGetDuration();
  20. void showAskPassword();
  21. void showNoPassword();
  22. void showForm();
  23. void showCriticalError(const QString &error);
  24. void showEditValue(object_ptr<Ui::RpWidget> form);
  25. void showBox(
  26. object_ptr<Ui::BoxContent> box,
  27. Ui::LayerOptions options,
  28. anim::type animated);
  29. void showToast(const QString &text);
  30. rpl::producer<> backRequests() const;
  31. void setBackAllowed(bool allowed);
  32. not_null<Ui::RpWidget*> widget() const;
  33. ~Panel();
  34. private:
  35. not_null<PanelController*> _controller;
  36. std::unique_ptr<Ui::SeparatePanel> _widget;
  37. };
  38. } // namespace Passport