2020-08-09 11:28:39 +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
|
|
|
|
|
2023-05-17 11:51:04 +00:00
|
|
|
namespace style {
|
|
|
|
struct ComposeIcons;
|
|
|
|
} // namespace style
|
|
|
|
|
2020-08-09 11:50:32 +00:00
|
|
|
namespace Api {
|
|
|
|
struct SendOptions;
|
|
|
|
} // namespace Api
|
|
|
|
|
2020-08-09 11:28:39 +00:00
|
|
|
namespace Ui {
|
|
|
|
class PopupMenu;
|
2022-03-27 10:01:34 +00:00
|
|
|
class RpWidget;
|
2020-08-09 11:28:39 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2022-10-13 10:32:03 +00:00
|
|
|
namespace Data {
|
|
|
|
class Thread;
|
|
|
|
} // namespace Data
|
2022-10-08 11:14:38 +00:00
|
|
|
|
2020-08-10 12:22:54 +00:00
|
|
|
namespace SendMenu {
|
|
|
|
|
|
|
|
enum class Type {
|
2020-08-09 11:28:39 +00:00
|
|
|
Disabled,
|
|
|
|
SilentOnly,
|
|
|
|
Scheduled,
|
|
|
|
ScheduledToUser, // For "Send when online".
|
|
|
|
Reminder,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class FillMenuResult {
|
|
|
|
Success,
|
|
|
|
None,
|
|
|
|
};
|
|
|
|
|
2020-08-09 11:50:32 +00:00
|
|
|
Fn<void()> DefaultSilentCallback(Fn<void(Api::SendOptions)> send);
|
|
|
|
Fn<void()> DefaultScheduleCallback(
|
|
|
|
not_null<Ui::RpWidget*> parent,
|
2020-08-10 12:22:54 +00:00
|
|
|
Type type,
|
2020-08-09 11:50:32 +00:00
|
|
|
Fn<void(Api::SendOptions)> send);
|
2023-04-22 18:26:09 +00:00
|
|
|
Fn<void()> DefaultWhenOnlineCallback(Fn<void(Api::SendOptions)> send);
|
2020-08-09 11:50:32 +00:00
|
|
|
|
2020-08-09 11:28:39 +00:00
|
|
|
FillMenuResult FillSendMenu(
|
|
|
|
not_null<Ui::PopupMenu*> menu,
|
2020-11-19 03:18:45 +00:00
|
|
|
Type type,
|
2020-08-09 11:28:39 +00:00
|
|
|
Fn<void()> silent,
|
2023-04-22 18:26:09 +00:00
|
|
|
Fn<void()> schedule,
|
2023-05-17 11:51:04 +00:00
|
|
|
Fn<void()> whenOnline,
|
|
|
|
const style::ComposeIcons *iconsOverride = nullptr);
|
2020-08-09 11:28:39 +00:00
|
|
|
|
2020-08-10 12:22:54 +00:00
|
|
|
void SetupMenuAndShortcuts(
|
2020-08-09 11:28:39 +00:00
|
|
|
not_null<Ui::RpWidget*> button,
|
2020-08-10 12:22:54 +00:00
|
|
|
Fn<Type()> type,
|
2020-08-09 11:28:39 +00:00
|
|
|
Fn<void()> silent,
|
2023-04-22 18:26:09 +00:00
|
|
|
Fn<void()> schedule,
|
|
|
|
Fn<void()> whenOnline);
|
2020-08-10 12:22:54 +00:00
|
|
|
|
2021-08-12 07:06:16 +00:00
|
|
|
void SetupUnreadMentionsMenu(
|
|
|
|
not_null<Ui::RpWidget*> button,
|
2022-10-13 10:32:03 +00:00
|
|
|
Fn<Data::Thread*()> currentThread);
|
2021-08-12 07:06:16 +00:00
|
|
|
|
2022-01-26 16:01:40 +00:00
|
|
|
void SetupUnreadReactionsMenu(
|
|
|
|
not_null<Ui::RpWidget*> button,
|
2022-10-13 10:32:03 +00:00
|
|
|
Fn<Data::Thread*()> currentThread);
|
2022-01-26 16:01:40 +00:00
|
|
|
|
2020-08-10 12:22:54 +00:00
|
|
|
} // namespace SendMenu
|