2015-12-07 13:05:00 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2015-12-07 13:05:00 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2015-12-07 13:05:00 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-04-06 14:38:10 +00:00
|
|
|
#include "base/type_traits.h"
|
2019-09-26 10:55:35 +00:00
|
|
|
#include "base/call_delayed.h"
|
2019-11-13 14:12:04 +00:00
|
|
|
#include "mtproto/mtproto_proxy_data.h"
|
2016-10-14 17:10:15 +00:00
|
|
|
|
2019-09-13 06:06:02 +00:00
|
|
|
class History;
|
2016-10-14 18:27:42 +00:00
|
|
|
|
2021-08-31 11:50:49 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2021-07-26 23:45:01 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
2016-08-27 04:49:18 +00:00
|
|
|
|
2015-12-07 13:05:00 +00:00
|
|
|
namespace App {
|
2017-10-27 17:00:56 +00:00
|
|
|
|
2018-06-04 15:35:11 +00:00
|
|
|
template <typename Guard, typename Lambda>
|
2019-08-16 17:07:30 +00:00
|
|
|
[[nodiscard]] inline auto LambdaDelayed(int duration, Guard &&object, Lambda &&lambda) {
|
2018-06-04 15:35:11 +00:00
|
|
|
auto guarded = crl::guard(
|
|
|
|
std::forward<Guard>(object),
|
2017-10-27 17:00:56 +00:00
|
|
|
std::forward<Lambda>(lambda));
|
|
|
|
return [saved = std::move(guarded), duration] {
|
|
|
|
auto copy = saved;
|
2019-09-26 10:55:35 +00:00
|
|
|
base::call_delayed(duration, std::move(copy));
|
2017-10-27 17:00:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-03-27 18:11:51 +00:00
|
|
|
bool insertBotCommand(const QString &cmd);
|
2017-12-18 15:44:50 +00:00
|
|
|
void activateBotCommand(
|
2021-07-26 23:45:01 +00:00
|
|
|
Window::SessionController *sessionController,
|
2017-12-18 15:44:50 +00:00
|
|
|
not_null<const HistoryItem*> msg,
|
|
|
|
int row,
|
|
|
|
int column);
|
2016-03-31 14:06:40 +00:00
|
|
|
|
2016-04-11 10:59:01 +00:00
|
|
|
} // namespace App
|
2015-12-07 13:05:00 +00:00
|
|
|
|
2016-01-11 15:43:29 +00:00
|
|
|
namespace Ui {
|
2016-12-13 17:07:56 +00:00
|
|
|
|
2019-09-13 06:06:02 +00:00
|
|
|
// Legacy global methods.
|
2015-12-07 18:09:05 +00:00
|
|
|
|
2020-06-18 18:04:16 +00:00
|
|
|
void showPeerProfile(not_null<PeerData*> peer);
|
2018-01-13 12:45:11 +00:00
|
|
|
void showPeerProfile(not_null<const History*> history);
|
2016-04-30 17:04:14 +00:00
|
|
|
|
2020-06-10 18:08:17 +00:00
|
|
|
void showPeerHistory(not_null<const PeerData*> peer, MsgId msgId);
|
2018-01-13 12:45:11 +00:00
|
|
|
void showPeerHistory(not_null<const History*> history, MsgId msgId);
|
2020-06-18 18:04:16 +00:00
|
|
|
void showChatsList(not_null<Main::Session*> session);
|
2016-04-11 10:59:01 +00:00
|
|
|
PeerData *getPeerForMouseAction();
|
2015-12-12 22:29:33 +00:00
|
|
|
|
2016-05-12 16:05:20 +00:00
|
|
|
bool skipPaintEvent(QWidget *widget, QPaintEvent *event);
|
|
|
|
|
2016-04-11 10:59:01 +00:00
|
|
|
} // namespace Ui
|
2015-12-07 13:05:00 +00:00
|
|
|
|
2015-12-27 21:37:48 +00:00
|
|
|
enum ClipStopperType {
|
|
|
|
ClipStopperMediaview,
|
|
|
|
ClipStopperSavedGifsPanel,
|
|
|
|
};
|
|
|
|
|
2015-12-07 13:05:00 +00:00
|
|
|
namespace Notify {
|
|
|
|
|
2020-06-10 18:08:17 +00:00
|
|
|
bool switchInlineBotButtonReceived(
|
|
|
|
not_null<Main::Session*> session,
|
|
|
|
const QString &query,
|
|
|
|
UserData *samePeerBot = nullptr,
|
|
|
|
MsgId samePeerReplyTo = 0);
|
2016-01-01 09:58:05 +00:00
|
|
|
|
2016-04-11 10:59:01 +00:00
|
|
|
} // namespace Notify
|