collectible_info_box.h 917 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 DynamicImage;
  11. enum class CollectibleType {
  12. Phone,
  13. Username,
  14. };
  15. [[nodiscard]] CollectibleType DetectCollectibleType(const QString &entity);
  16. struct CollectibleInfo {
  17. QString entity;
  18. QString copyText;
  19. std::shared_ptr<DynamicImage> ownerUserpic;
  20. QString ownerName;
  21. uint64 cryptoAmount = 0;
  22. uint64 amount = 0;
  23. QString cryptoCurrency;
  24. QString currency;
  25. QString url;
  26. TimeId date = 0;
  27. };
  28. struct CollectibleDetails {
  29. TextWithEntities tonEmoji;
  30. Text::MarkedContext tonEmojiContext;
  31. };
  32. void CollectibleInfoBox(
  33. not_null<Ui::GenericBox*> box,
  34. CollectibleInfo info,
  35. CollectibleDetails details);
  36. } // namespace Ui