tdesktop/Telegram/SourceFiles/history/view/history_view_schedule_box.h

40 lines
879 B
C
Raw Normal View History

2019-08-13 15:35:49 +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
#include "boxes/generic_box.h"
namespace Api {
struct SendOptions;
} // namespace Api
2019-08-28 16:46:47 +00:00
enum class SendMenuType;
2019-08-13 15:35:49 +00:00
namespace HistoryView {
2019-08-13 20:01:39 +00:00
[[nodiscard]] TimeId DefaultScheduleTime();
void ScheduleBox(
not_null<GenericBox*> box,
2019-08-28 16:46:47 +00:00
SendMenuType type,
FnMut<void(Api::SendOptions)> done,
2019-08-13 20:01:39 +00:00
TimeId time);
2019-08-13 15:35:49 +00:00
2019-08-20 13:21:10 +00:00
template <typename Guard, typename Submit>
[[nodiscard]] object_ptr<GenericBox> PrepareScheduleBox(
Guard &&guard,
2019-08-28 16:46:47 +00:00
SendMenuType type,
2019-08-20 13:21:10 +00:00
Submit &&submit) {
return Box(
ScheduleBox,
2019-08-28 16:46:47 +00:00
type,
2019-08-20 13:21:10 +00:00
crl::guard(std::forward<Guard>(guard), std::forward<Submit>(submit)),
DefaultScheduleTime());
}
2019-08-13 15:35:49 +00:00
} // namespace HistoryView