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