5#ifndef MOLYBDEN_MENU_HPP
6#define MOLYBDEN_MENU_HPP
18enum class MenuItemType {
28 MenuItemType type()
const;
31 explicit MenuItem(MenuItemType type);
39 static std::shared_ptr<SeparatorMenuItem> create();
40 static std::shared_ptr<SeparatorMenuItem> cast(
41 std::shared_ptr<MenuItem> item);
46using MenuItems = std::vector<std::shared_ptr<MenuItem>>;
50 MenuItems items()
const;
53 Menu(MenuItemType type, MenuItems items);
61 static std::shared_ptr<CustomMenu> create(MenuItems items);
62 static std::shared_ptr<CustomMenu> create(std::string title, MenuItems items);
63 static std::shared_ptr<CustomMenu> cast(std::shared_ptr<MenuItem> item);
65 CustomMenu(std::string title, MenuItems items);
66 std::string title()
const;
72enum class StandardMenuRole {
83 static std::shared_ptr<StandardMenu> create(StandardMenuRole role);
84 static std::shared_ptr<StandardMenu> create(StandardMenuRole role,
86 static std::shared_ptr<StandardMenu> cast(std::shared_ptr<MenuItem> item);
90 StandardMenuRole role()
const;
93 StandardMenuRole role_;
99 std::shared_ptr<App> app;
100 std::shared_ptr<Browser> browser;
101 std::shared_ptr<CustomMenuItem> menu_item;
104using CustomMenuItemAction =
109 static std::shared_ptr<CustomMenuItem> create(std::string title,
110 CustomMenuItemAction action,
111 bool enabled =
true);
112 static std::shared_ptr<CustomMenuItem> cast(std::shared_ptr<MenuItem> item);
113 static std::shared_ptr<CustomMenuItem> fromId(int32_t
id);
116 CustomMenuItemAction action,
117 bool enabled =
true);
120 std::string title()
const;
121 void setEnabled(
bool enabled);
122 bool isEnabled()
const;
123 CustomMenuItemAction action()
const;
128 CustomMenuItemAction action,
129 bool enabled =
true);
134 bool enabled_ =
true;
135 CustomMenuItemAction action_ =
nullptr;
138enum class StandardMenuItemCommandId {
149 kPrintUsingSystemDialog,
171 kReloadBypassingCache,
186 static std::shared_ptr<StandardMenuItem> create(StandardMenuItemCommandId
id);
187 static std::shared_ptr<StandardMenuItem> cast(std::shared_ptr<MenuItem> item);
191 StandardMenuItemCommandId commandId()
const;
194 StandardMenuItemCommandId command_id_;
198std::shared_ptr<SeparatorMenuItem> Separator();
199std::shared_ptr<CustomMenu>
Menu(MenuItems items);
200std::shared_ptr<CustomMenu>
Menu(std::string title, MenuItems items);
201std::shared_ptr<CustomMenuItem> Item(std::string title,
202 CustomMenuItemAction action,
203 bool enabled =
true);
205std::shared_ptr<StandardMenu> MacApp(MenuItems items);
206std::shared_ptr<StandardMenu>
File(MenuItems items);
207std::shared_ptr<StandardMenu> Edit(MenuItems items);
208std::shared_ptr<StandardMenu> View(MenuItems items);
209std::shared_ptr<StandardMenu> Window(MenuItems items);
210std::shared_ptr<StandardMenu> Help(MenuItems items);
212std::shared_ptr<CustomMenuItem> About(
const std::shared_ptr<App>& app);
214std::shared_ptr<StandardMenuItem> MacHideApp();
215std::shared_ptr<StandardMenuItem> MacHideOthers();
216std::shared_ptr<StandardMenuItem> MacShowAll();
217std::shared_ptr<StandardMenuItem> Quit();
219std::shared_ptr<StandardMenuItem> SavePageAs();
220std::shared_ptr<StandardMenuItem> Print();
221std::shared_ptr<StandardMenuItem> PrintUsingSystemDialog();
222std::shared_ptr<StandardMenuItem> CloseWindow();
224std::shared_ptr<StandardMenuItem> Undo();
225std::shared_ptr<StandardMenuItem> Redo();
226std::shared_ptr<StandardMenuItem> Cut();
227std::shared_ptr<StandardMenuItem> Copy();
228std::shared_ptr<StandardMenuItem> Paste();
229std::shared_ptr<StandardMenuItem> PasteAndMatchStyle();
230std::shared_ptr<StandardMenuItem> Delete();
231std::shared_ptr<StandardMenuItem> SelectAll();
232std::shared_ptr<StandardMenuItem> Find();
233std::shared_ptr<StandardMenuItem> FindNext();
234std::shared_ptr<StandardMenuItem> FindPrevious();
236std::shared_ptr<StandardMenuItem> GoBack();
237std::shared_ptr<StandardMenuItem> GoForward();
238std::shared_ptr<StandardMenuItem> Stop();
239std::shared_ptr<StandardMenuItem> Reload();
240std::shared_ptr<StandardMenuItem> ReloadBypassingCache();
241std::shared_ptr<StandardMenuItem> ZoomNormal();
242std::shared_ptr<StandardMenuItem> ZoomIn();
243std::shared_ptr<StandardMenuItem> ZoomOut();
244std::shared_ptr<StandardMenuItem> FullScreen();
245std::shared_ptr<StandardMenuItem>
DevTools();
246std::shared_ptr<StandardMenuItem> ViewSource();
248std::shared_ptr<StandardMenuItem> MinimizeWindow();
249std::shared_ptr<StandardMenuItem> MaximizeWindow();
The file data.
Definition upload_data.hpp:255