5#ifndef MOLYBDEN_CONTEXT_MENU_HPP
6#define MOLYBDEN_CONTEXT_MENU_HPP
20 bool is_frame =
false;
22 bool is_image =
false;
23 bool is_video =
false;
24 bool is_audio =
false;
25 bool is_canvas =
false;
26 bool is_editable =
false;
29enum class ContextMenuItemType {
30 kStandardContextMenuItem,
32 kCustomContextMenuItem,
38 ContextMenuItemType type()
const;
44 ContextMenuItemType type_;
49 static std::shared_ptr<SeparatorContextMenuItem> create();
50 static std::shared_ptr<SeparatorContextMenuItem> cast(
51 std::shared_ptr<ContextMenuItem> item);
56using ContextMenuItems = std::vector<std::shared_ptr<ContextMenuItem>>;
60 ContextMenuItems items()
const;
63 ContextMenu(ContextMenuItemType type, ContextMenuItems items);
66 ContextMenuItems items_;
71 static std::shared_ptr<CustomContextMenu> create(ContextMenuItems items);
72 static std::shared_ptr<CustomContextMenu> create(std::string title,
73 ContextMenuItems items);
74 static std::shared_ptr<CustomContextMenu> cast(
75 std::shared_ptr<ContextMenuItem> item);
78 std::string title()
const;
87 std::shared_ptr<App> app;
88 std::shared_ptr<Browser> browser;
89 std::shared_ptr<CustomContextMenuItem> context_menu_item;
92using CustomContextMenuItemAction =
97 static std::shared_ptr<CustomContextMenuItem> create(
99 CustomContextMenuItemAction action,
100 bool enabled =
true);
101 static std::shared_ptr<CustomContextMenuItem> cast(
102 std::shared_ptr<ContextMenuItem> item);
103 static std::shared_ptr<CustomContextMenuItem> fromId(int32_t
id);
106 CustomContextMenuItemAction action,
107 bool enabled =
true);
110 std::string title()
const;
111 bool isEnabled()
const;
112 CustomContextMenuItemAction action()
const;
117 CustomContextMenuItemAction action,
118 bool enabled =
true);
123 bool enabled_ =
true;
124 CustomContextMenuItemAction action_ =
nullptr;
127enum class StandardContextMenuItemCommandId {
178 static std::shared_ptr<StandardContextMenuItem> create(
179 StandardContextMenuItemCommandId
id);
180 static std::shared_ptr<StandardContextMenuItem> cast(
181 std::shared_ptr<ContextMenuItem> item);
185 StandardContextMenuItemCommandId commandId()
const;
188 StandardContextMenuItemCommandId command_id_;
191namespace context_menu {
193std::shared_ptr<SeparatorContextMenuItem> Separator();
194std::shared_ptr<CustomContextMenu>
Menu(std::string title,
195 ContextMenuItems items);
196std::shared_ptr<CustomContextMenu>
Menu(ContextMenuItems items);
197std::shared_ptr<CustomContextMenuItem> Item(std::string title,
198 CustomContextMenuItemAction action,
199 bool enabled =
true);
201std::shared_ptr<StandardContextMenuItem> GoBack();
202std::shared_ptr<StandardContextMenuItem> GoForward();
203std::shared_ptr<StandardContextMenuItem> Reload();
204std::shared_ptr<StandardContextMenuItem> SavePageAs();
205std::shared_ptr<StandardContextMenuItem> Print();
206std::shared_ptr<StandardContextMenuItem> ExitFullScreen();
207std::shared_ptr<StandardContextMenuItem> InspectElement();
209std::shared_ptr<StandardContextMenuItem> SaveLinkAs();
210std::shared_ptr<StandardContextMenuItem> CopyLinkAddress();
211std::shared_ptr<StandardContextMenuItem> CopyEmailAddress();
213std::shared_ptr<StandardContextMenuItem> SaveImageAs();
214std::shared_ptr<StandardContextMenuItem> CopyImageAddress();
215std::shared_ptr<StandardContextMenuItem> CopyImage();
217std::shared_ptr<StandardContextMenuItem> SaveAudioAs();
218std::shared_ptr<StandardContextMenuItem> CopyAudioLocation();
220std::shared_ptr<StandardContextMenuItem> SaveVideoAs();
221std::shared_ptr<StandardContextMenuItem> CopyVideoLocation();
222std::shared_ptr<StandardContextMenuItem> PictureInPicture();
224std::shared_ptr<StandardContextMenuItem> Loop();
225std::shared_ptr<StandardContextMenuItem> Controls();
226std::shared_ptr<StandardContextMenuItem> RotateCW();
227std::shared_ptr<StandardContextMenuItem> RotateCCW();
229std::shared_ptr<StandardContextMenuItem> ReloadFrame();
230std::shared_ptr<StandardContextMenuItem> ViewFrameSource();
232std::shared_ptr<StandardContextMenuItem> Undo();
233std::shared_ptr<StandardContextMenuItem> Redo();
234std::shared_ptr<StandardContextMenuItem> Cut();
235std::shared_ptr<StandardContextMenuItem> Copy();
236std::shared_ptr<StandardContextMenuItem> Paste();
237std::shared_ptr<StandardContextMenuItem> PasteAndMatchStyle();
238std::shared_ptr<StandardContextMenuItem> SelectAll();
Definition context_menu.hpp:176