2022-11-12 11:13:23 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-30 10:10:42 +00:00
|
|
|
#include "base/object_ptr.h"
|
|
|
|
|
2023-02-07 12:29:34 +00:00
|
|
|
class History;
|
2022-11-12 11:13:23 +00:00
|
|
|
class PeerData;
|
2023-01-30 10:10:42 +00:00
|
|
|
struct LanguageId;
|
2022-11-12 11:13:23 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
2023-01-30 10:10:42 +00:00
|
|
|
class BoxContent;
|
2022-11-12 11:13:23 +00:00
|
|
|
class GenericBox;
|
|
|
|
|
|
|
|
void TranslateBox(
|
2023-01-30 10:10:42 +00:00
|
|
|
not_null<GenericBox*> box,
|
2022-11-12 11:13:23 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
MsgId msgId,
|
2022-11-27 13:12:30 +00:00
|
|
|
TextWithEntities text,
|
|
|
|
bool hasCopyRestriction);
|
2022-11-12 11:13:23 +00:00
|
|
|
|
2022-11-18 14:00:19 +00:00
|
|
|
[[nodiscard]] bool SkipTranslate(TextWithEntities textWithEntities);
|
|
|
|
|
2023-01-30 10:10:42 +00:00
|
|
|
[[nodiscard]] object_ptr<BoxContent> EditSkipTranslationLanguages();
|
2023-02-07 12:29:34 +00:00
|
|
|
[[nodiscard]] object_ptr<BoxContent> ChooseTranslateToBox(
|
|
|
|
LanguageId bringUp,
|
|
|
|
Fn<void(LanguageId)> callback);
|
|
|
|
|
|
|
|
[[nodiscard]] LanguageId ChooseTranslateTo(not_null<History*> history);
|
|
|
|
[[nodiscard]] LanguageId ChooseTranslateTo(LanguageId offeredFrom);
|
|
|
|
[[nodiscard]] LanguageId ChooseTranslateTo(
|
|
|
|
not_null<History*> history,
|
|
|
|
LanguageId savedTo,
|
|
|
|
const std::vector<LanguageId> &skip);
|
|
|
|
[[nodiscard]] LanguageId ChooseTranslateTo(
|
|
|
|
LanguageId offeredFrom,
|
|
|
|
LanguageId savedTo,
|
|
|
|
const std::vector<LanguageId> &skip);
|
2022-11-18 10:42:12 +00:00
|
|
|
|
2022-11-12 11:13:23 +00:00
|
|
|
} // namespace Ui
|