2018-11-26 11:55:02 +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
|
|
|
|
|
|
|
|
namespace qthelp {
|
|
|
|
class RegularExpressionMatch;
|
|
|
|
} // namespace qthelp
|
|
|
|
|
2020-06-24 07:56:16 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
2019-07-24 14:00:30 +00:00
|
|
|
|
2018-11-26 11:55:02 +00:00
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
struct LocalUrlHandler {
|
|
|
|
QString expression;
|
|
|
|
Fn<bool(
|
2020-06-24 07:56:16 +00:00
|
|
|
Window::SessionController *controller,
|
2018-11-26 11:55:02 +00:00
|
|
|
const qthelp::RegularExpressionMatch &match,
|
|
|
|
const QVariant &context)> handler;
|
|
|
|
};
|
|
|
|
|
2019-08-06 14:43:26 +00:00
|
|
|
[[nodiscard]] const std::vector<LocalUrlHandler> &LocalUrlHandlers();
|
2019-12-25 15:20:02 +00:00
|
|
|
[[nodiscard]] const std::vector<LocalUrlHandler> &InternalUrlHandlers();
|
2018-11-26 11:55:02 +00:00
|
|
|
|
2019-08-06 14:43:26 +00:00
|
|
|
[[nodiscard]] QString TryConvertUrlToLocal(QString url);
|
2019-01-21 13:42:21 +00:00
|
|
|
|
2019-08-06 14:43:26 +00:00
|
|
|
[[nodiscard]] bool InternalPassportLink(const QString &url);
|
|
|
|
|
|
|
|
[[nodiscard]] bool StartUrlRequiresActivate(const QString &url);
|
2019-01-21 13:42:21 +00:00
|
|
|
|
2018-11-26 11:55:02 +00:00
|
|
|
} // namespace Core
|