tdesktop/Telegram/SourceFiles/facades.h

50 lines
1.2 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));
};
}
} // namespace App
2015-12-07 13:05:00 +00:00
namespace Ui {
// Legacy global methods.
2015-12-07 18:09:05 +00:00
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);
bool skipPaintEvent(QWidget *widget, QPaintEvent *event);
} // namespace Ui