-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Expand file tree
/
Copy pathmenu_send.h
More file actions
98 lines (81 loc) · 2.15 KB
/
Copy pathmenu_send.h
File metadata and controls
98 lines (81 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
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 "api/api_common.h"
#include "menu/menu_send_details.h"
namespace style {
struct ComposeIcons;
struct PopupMenu;
} // namespace style
namespace ChatHelpers {
class Show;
} // namespace ChatHelpers
namespace Ui {
class PopupMenu;
class RpWidget;
class Show;
} // namespace Ui
namespace Data {
class Thread;
} // namespace Data
namespace SendMenu {
enum class FillMenuResult : uchar {
Prepared,
Skipped,
Failed,
};
enum class ActionType : uchar {
Send,
Schedule,
SpoilerOn,
SpoilerOff,
CaptionUp,
CaptionDown,
PhotoQualityOn,
PhotoQualityOff,
EditCover,
RemoveCover,
ChangePrice,
};
struct Action {
using Type = ActionType;
Api::SendOptions options;
Type type = Type::Send;
};
[[nodiscard]] Fn<void(Action, Details)> DefaultCallback(
std::shared_ptr<ChatHelpers::Show> show,
Fn<void(Api::SendOptions)> send);
FillMenuResult FillSendMenu(
not_null<Ui::PopupMenu*> menu,
std::shared_ptr<ChatHelpers::Show> maybeShow,
Details details,
Fn<void(Action, Details)> action,
const style::ComposeIcons *iconsOverride = nullptr,
std::optional<QPoint> desiredPositionOverride = std::nullopt);
FillMenuResult AttachSendMenuEffect(
not_null<Ui::PopupMenu*> menu,
std::shared_ptr<ChatHelpers::Show> show,
Details details,
Fn<void(Action, Details)> action,
std::optional<QPoint> desiredPositionOverride = std::nullopt);
void SetupMenuAndShortcuts(
not_null<Ui::RpWidget*> button,
std::shared_ptr<ChatHelpers::Show> maybeShow,
Fn<Details()> details,
Fn<void(Action, Details)> action,
const style::PopupMenu *stOverride = nullptr,
const style::ComposeIcons *iconsOverride = nullptr);
void SetupUnreadMentionsMenu(
not_null<Ui::RpWidget*> button,
Fn<Data::Thread*()> currentThread);
void SetupUnreadReactionsMenu(
not_null<Ui::RpWidget*> button,
Fn<Data::Thread*()> currentThread);
void SetupUnreadPollVotesMenu(
not_null<Ui::RpWidget*> button,
Fn<Data::Thread*()> currentThread);
} // namespace SendMenu