tdesktop/Telegram/SourceFiles/facades.h

76 lines
1.7 KiB
C
Raw Normal View History

2015-12-07 13:05:00 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2015-12-07 13:05:00 +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"
class History;
namespace Main {
class Session;
} // namespace Main
2021-07-26 23:45:01 +00:00
namespace Window {
class SessionController;
} // namespace Window
2015-12-07 13:05:00 +00:00
namespace App {
template <typename Guard, typename Lambda>
[[nodiscard]] inline auto LambdaDelayed(int duration, Guard &&object, Lambda &&lambda) {
auto guarded = crl::guard(
std::forward<Guard>(object),
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));
};
}
bool insertBotCommand(const QString &cmd);
void activateBotCommand(
2021-07-26 23:45:01 +00:00
Window::SessionController *sessionController,
not_null<const HistoryItem*> msg,
int row,
int column);
} // namespace App
2015-12-07 13:05:00 +00:00
namespace Ui {
// Legacy global methods.
2015-12-07 18:09:05 +00:00
void showPeerProfile(not_null<PeerData*> peer);
void showPeerProfile(not_null<const History*> history);
2020-06-10 18:08:17 +00:00
void showPeerHistory(not_null<const PeerData*> peer, MsgId msgId);
void showPeerHistory(not_null<const History*> history, MsgId msgId);
void showChatsList(not_null<Main::Session*> session);
PeerData *getPeerForMouseAction();
bool skipPaintEvent(QWidget *widget, QPaintEvent *event);
} // 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);
} // namespace Notify