lang_text_entity.h 893 B

12345678910111213141516171819202122232425262728293031323334
  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/text/text_entity.h"
  9. namespace Lang {
  10. template <typename ResultString>
  11. struct StartReplacements;
  12. template <>
  13. struct StartReplacements<TextWithEntities> {
  14. static inline TextWithEntities Call(QString &&langString) {
  15. return { std::move(langString), EntitiesInText() };
  16. }
  17. };
  18. template <typename ResultString>
  19. struct ReplaceTag;
  20. template <>
  21. struct ReplaceTag<TextWithEntities> {
  22. static TextWithEntities Call(TextWithEntities &&original, ushort tag, const TextWithEntities &replacement);
  23. static TextWithEntities Replace(TextWithEntities &&original, const TextWithEntities &replacement, int start);
  24. };
  25. } // namespace Lang