2019-09-16 11:14:06 +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
|
|
|
|
|
2019-09-19 09:34:37 +00:00
|
|
|
#include "ui/integration.h"
|
2019-09-16 11:14:06 +00:00
|
|
|
|
2020-06-09 09:36:40 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2020-11-10 16:38:21 +00:00
|
|
|
namespace HistoryView {
|
|
|
|
class ElementDelegate;
|
|
|
|
} // namespace HistoryView
|
|
|
|
|
2019-09-16 11:14:06 +00:00
|
|
|
namespace Core {
|
|
|
|
|
2020-11-10 16:38:21 +00:00
|
|
|
struct MarkedTextContext {
|
2020-06-16 15:10:39 +00:00
|
|
|
enum class HashtagMentionType : uchar {
|
|
|
|
Telegram,
|
|
|
|
Twitter,
|
|
|
|
Instagram,
|
|
|
|
};
|
|
|
|
|
2020-11-10 16:38:21 +00:00
|
|
|
Main::Session *session = nullptr;
|
|
|
|
HashtagMentionType type = HashtagMentionType::Telegram;
|
2022-06-24 06:49:11 +00:00
|
|
|
Fn<void()> customEmojiRepaint;
|
2022-11-07 10:31:46 +00:00
|
|
|
int customEmojiLoopLimit = 0;
|
2020-11-10 16:38:21 +00:00
|
|
|
};
|
|
|
|
|
2021-04-20 12:40:54 +00:00
|
|
|
class UiIntegration final : public Ui::Integration {
|
2020-11-10 16:38:21 +00:00
|
|
|
public:
|
2019-09-16 11:14:06 +00:00
|
|
|
void postponeCall(FnMut<void()> &&callable) override;
|
|
|
|
void registerLeaveSubscription(not_null<QWidget*> widget) override;
|
|
|
|
void unregisterLeaveSubscription(not_null<QWidget*> widget) override;
|
|
|
|
|
|
|
|
QString emojiCacheFolder() override;
|
2021-07-01 07:47:29 +00:00
|
|
|
QString openglCheckFilePath() override;
|
|
|
|
QString angleBackendFilePath() override;
|
2021-06-11 19:01:07 +00:00
|
|
|
|
2019-09-16 11:14:06 +00:00
|
|
|
void textActionsUpdated() override;
|
|
|
|
void activationFromTopPanel() override;
|
|
|
|
|
2021-04-27 08:46:51 +00:00
|
|
|
bool screenIsLocked() override;
|
2020-03-30 08:18:50 +00:00
|
|
|
|
2019-09-16 11:14:06 +00:00
|
|
|
std::shared_ptr<ClickHandler> createLinkHandler(
|
2020-06-16 15:10:39 +00:00
|
|
|
const EntityLinkData &data,
|
|
|
|
const std::any &context) override;
|
2019-09-16 11:14:06 +00:00
|
|
|
bool handleUrlClick(
|
|
|
|
const QString &url,
|
|
|
|
const QVariant &context) override;
|
|
|
|
rpl::producer<> forcePopupMenuHideRequests() override;
|
|
|
|
const Ui::Emoji::One *defaultEmojiVariant(
|
|
|
|
const Ui::Emoji::One *emoji) override;
|
2022-06-23 11:36:06 +00:00
|
|
|
std::unique_ptr<Ui::Text::CustomEmoji> createCustomEmoji(
|
|
|
|
const QString &data,
|
|
|
|
const std::any &context) override;
|
2022-09-16 20:23:27 +00:00
|
|
|
Fn<void()> createSpoilerRepaint(const std::any &context) override;
|
2023-06-23 16:05:58 +00:00
|
|
|
bool allowClickHandlerActivation(
|
|
|
|
const std::shared_ptr<ClickHandler> &handler,
|
|
|
|
const ClickContext &context) override;
|
2019-09-16 11:14:06 +00:00
|
|
|
|
|
|
|
QString phraseContextCopyText() override;
|
|
|
|
QString phraseContextCopyEmail() override;
|
|
|
|
QString phraseContextCopyLink() override;
|
|
|
|
QString phraseContextCopySelected() override;
|
|
|
|
QString phraseFormattingTitle() override;
|
|
|
|
QString phraseFormattingLinkCreate() override;
|
|
|
|
QString phraseFormattingLinkEdit() override;
|
|
|
|
QString phraseFormattingClear() override;
|
|
|
|
QString phraseFormattingBold() override;
|
|
|
|
QString phraseFormattingItalic() override;
|
|
|
|
QString phraseFormattingUnderline() override;
|
|
|
|
QString phraseFormattingStrikeOut() override;
|
|
|
|
QString phraseFormattingMonospace() override;
|
2021-12-19 14:07:57 +00:00
|
|
|
QString phraseFormattingSpoiler() override;
|
2022-04-29 16:20:15 +00:00
|
|
|
QString phraseButtonOk() override;
|
2022-07-07 04:39:33 +00:00
|
|
|
QString phraseButtonClose() override;
|
2022-04-29 16:20:15 +00:00
|
|
|
QString phraseButtonCancel() override;
|
2022-07-07 04:39:33 +00:00
|
|
|
QString phrasePanelCloseWarning() override;
|
|
|
|
QString phrasePanelCloseUnsaved() override;
|
|
|
|
QString phrasePanelCloseAnyway() override;
|
2022-07-15 12:09:55 +00:00
|
|
|
QString phraseBotSharePhone() override;
|
|
|
|
QString phraseBotSharePhoneTitle() override;
|
|
|
|
QString phraseBotSharePhoneConfirm() override;
|
2023-08-29 17:36:12 +00:00
|
|
|
QString phraseBotAllowWrite() override;
|
|
|
|
QString phraseBotAllowWriteTitle() override;
|
|
|
|
QString phraseBotAllowWriteConfirm() override;
|
2019-09-16 11:14:06 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-06-14 07:22:39 +00:00
|
|
|
[[nodiscard]] bool OpenGLLastCheckFailed();
|
2021-06-11 19:01:07 +00:00
|
|
|
|
2019-09-16 11:14:06 +00:00
|
|
|
} // namespace Core
|