1 #ifndef DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H
2 #define DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
27 class WebEngineContextMenu;
30 * @brief A class WebEngineContextMenuItem for context menu item of web engine.
32 class WebEngineContextMenuItem
36 * @brief Enumeration that provides the tags of items for the context menu.
40 NO_ACTION = 0, ///< No action
41 OPEN_LINK_IN_NEW_WINDOW, ///< Open link in new window
42 DOWNLOAD_LINK_TO_DISK, ///< Download link to disk
43 COPY_LINK_TO_CLIPBOARD, ///< Copy link to clipboard
44 OPEN_IMAGE_IN_NEW_WINDOW, ///< Open image in new window
45 OPEN_IMAGE_IN_CURRENT_WINDOW, ///< Open image in current window
46 DOWNLOAD_IMAGE_TO_DISK, ///< Download image to disk
47 COPY_IMAGE_TO_CLIPBOARD, ///< Copy image to clipboard
48 OPEN_FRAME_IN_NEW_WINDOW, ///< Open frame in new window
51 GO_FORWARD, ///< Go forward
57 SPELLING_GUESS, ///< Spelling guess
58 NO_GUESSES_FOUND, ///< Guess found
59 IGNORE_SPELLING, ///< Ignore spelling
60 LEARN_SPELLING, ///< Learn spelling
62 SEARCH_IN_SPOTLIGHT, ///< Search in spotlight
63 SEARCH_WEB, ///< Search web
64 LOOK_UP_IN_DICTIONARY, ///< Look up in dictionary
65 OPEN_WITH_DEFAULT_APPLICATION, ///< Open with default application
66 PDF_ACTUAL_SIZE, ///< PDF actual size
67 PDF_ZOOM_IN, ///< PDF zoom in
68 PDF_ZOOM_OUT, ///< PDF zoom out
69 PDF_AUTO_SIZE, ///< PDF auto size
70 PDF_SINGLE_PAGE, ///< PDF single page
71 PDF_FACTING_PAGES, ///< PDF facting page
72 PDF_CONTINUOUS, ///< PDF continuous
73 PDF_NEXT_PAGE, ///< PDF next page
74 PDF_PREVIOUS_PAGE, ///< PDF previous page
75 OPEN_LINK, ///< Open link
76 IGNORE_GRAMMAR, ///< Ignore grammar
77 SPELLING_MENU, ///< Spelling menu
78 SHOW_SPELLING_PANEL, ///< Show spelling panel
79 CHECK_SPELLING, ///< Check spelling
80 CHECK_SPELLING_WHILE_TYPING, ///< Check spelling white typing
81 CHECK_GRAMMAR_WITH_SPELLING, ///< Check grammar with spelling
82 FONT_MENU, ///< Font menu
83 SHOW_FONTS, ///< Show fonts
86 UNDERLINE, ///< Underline
89 SHOW_COLORS, ///< Show colors
90 SPEECH_MENU, ///< Speech menu
91 START_SPEAKING, ///< Start speaking
92 STOP_SPEAKING, ///< Stop speaking
93 WRITING_DIRECTION_MENU, ///< Writing direction menu
94 DEFAULT_DIRECTION, ///< Default direction
95 LEFT_TO_RIGHT, ///< Left to right
96 RIGHT_TO_LEFT, ///< Right to left
97 PDF_SINGLE_PAGE_SCROLLING, ///< PDF single page scrolling
98 PDF_FACING_PAGES_SCROLLING, ///< PDF facing page scrolling
99 INSPECT_ELEMENT, ///< Inspect element
100 TEXT_DIRECTION_MENU, ///< Text direction menu
101 TEXT_DIRECTION_DEFAULT, ///< Text direction default
102 TEXT_DIRECTION_LEFT_TO_RIGHT, ///< Text direction left to right
103 TEXT_DIRECTION_RIGHT_TO_LEFT, ///< Text direction right to left
104 CORRECT_SPELLING_AUTOMATICALLY, ///< Correct spelling automatically
105 SUBSTITUTIONS_MENU, ///< Substitutions menu
106 SHOW_SUBSTITUTIONS, ///< Show substitutions
107 SMART_COPY_PASTE, ///< Smart copy paste
108 SMART_QUOTES, ///< Smart quotes
109 SMART_DASHES, ///< Smart dashes
110 SMART_LINKS, ///< Smart links
111 TEXT_REPLACEMENT, ///< Text replacement
112 TRANSFORMATIONS_MENU, ///< Transformation menu
113 MAKE_UPPER_CASE, ///< Make upper case
114 MAKE_LOWER_CASE, ///< Make lower case
115 CAPITALIZE, ///< Capitalize
116 CHANGE_BACK, ///< Change back
117 OPEN_MEDIA_IN_NEW_WINDOW, ///< Open media in new window
118 COPY_MEDIA_LINK_TO_CLIPBOARD, ///< Copy media link to clipboard
119 TOGGLE_MEDIA_CONTROLS, ///< Toggle media controls
120 TOGGLE_MEDIA_LOOP, ///< Toggle media loop
121 ENTER_VIDEO_FULLSCREEN, ///< Enter video fullscreen
122 MEDIA_PLAY_PAUSE, ///< Media play pause
123 MEDIA_MUTE, ///< Media mute
124 DICTATION_ALTERNATIVE, ///< Dictation alternative
125 SELECT_ALL, ///< Select all
126 SELECT_WORD, ///< Select word
127 TEXT_SELECTION_MODE, ///< Text selection mode
128 CLIPBOARD, ///< Clipboard
130 TRANSLATE, ///< Translate
131 COPY_LINK_DATA, ///< Copy link data
135 * @brief Enumeration that defines the types of the items for the context menu.
140 CHECKABLE_ACTION, ///< Checkable action
141 SEPARATOR, ///< Separator
142 SUBMENU, ///< Sub-menu
146 * @brief Constructor.
148 WebEngineContextMenuItem() = default;
153 virtual ~WebEngineContextMenuItem() = default;
156 * @brief Return the tag of context menu item.
158 * @return The tag of context menu item
160 virtual ItemTag GetTag() const = 0;
163 * @brief Return the type of context menu item.
165 * @return The type of context menu item
167 virtual ItemType GetType() const = 0;
170 * @brief Check if the item is enabled or not.
172 * @return true if it is enabled, false otherwise
174 virtual bool IsEnabled() const = 0;
177 * @brief Return the link url of context menu item.
179 * @return The current link url if succeeded, empty string otherwise
181 virtual std::string GetLinkUrl() const = 0;
184 * @brief Return the image url of context menu item.
186 * @return The current image url if succeeded, empty string otherwise
188 virtual std::string GetImageUrl() const = 0;
191 * @brief Get a title of the item.
193 * @return a title of the item if succeeded, empty string otherwise
195 virtual std::string GetTitle() const = 0;
198 * @brief Get the parent menu for the item.
200 * @return parent menu if succeeded, 0 otherwise
202 virtual std::unique_ptr<Dali::WebEngineContextMenu> GetParentMenu() const = 0;
207 #endif // DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H