username_box.h 781 B

12345678910111213141516171819202122232425262728293031323334353637
  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. namespace Ui {
  9. class GenericBox;
  10. class VerticalLayout;
  11. } // namespace Ui
  12. class PeerData;
  13. void UsernamesBox(
  14. not_null<Ui::GenericBox*> box,
  15. not_null<PeerData*> peer);
  16. struct UsernameCheckInfo final {
  17. [[nodiscard]] static UsernameCheckInfo PurchaseAvailable(
  18. const QString &username,
  19. not_null<PeerData*> peer);
  20. enum class Type {
  21. Good,
  22. Error,
  23. Default,
  24. };
  25. Type type;
  26. TextWithEntities text;
  27. };
  28. void AddUsernameCheckLabel(
  29. not_null<Ui::VerticalLayout*> container,
  30. rpl::producer<UsernameCheckInfo> checkInfo);