translate_box.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 "base/object_ptr.h"
  9. class History;
  10. class PeerData;
  11. struct LanguageId;
  12. namespace Ui {
  13. class BoxContent;
  14. class GenericBox;
  15. void TranslateBox(
  16. not_null<GenericBox*> box,
  17. not_null<PeerData*> peer,
  18. MsgId msgId,
  19. TextWithEntities text,
  20. bool hasCopyRestriction);
  21. [[nodiscard]] bool SkipTranslate(TextWithEntities textWithEntities);
  22. [[nodiscard]] object_ptr<BoxContent> EditSkipTranslationLanguages();
  23. [[nodiscard]] object_ptr<BoxContent> ChooseTranslateToBox(
  24. LanguageId bringUp,
  25. Fn<void(LanguageId)> callback);
  26. [[nodiscard]] LanguageId ChooseTranslateTo(not_null<History*> history);
  27. [[nodiscard]] LanguageId ChooseTranslateTo(LanguageId offeredFrom);
  28. [[nodiscard]] LanguageId ChooseTranslateTo(
  29. not_null<History*> history,
  30. LanguageId savedTo,
  31. const std::vector<LanguageId> &skip);
  32. [[nodiscard]] LanguageId ChooseTranslateTo(
  33. LanguageId offeredFrom,
  34. LanguageId savedTo,
  35. const std::vector<LanguageId> &skip);
  36. } // namespace Ui