(Canvas Renderer) Moved Devel Headers into sub-folder to improve SAM score
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine-context-menu-item.h
1 #ifndef DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H
2 #define DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <memory>
23 #include <string>
24
25 namespace Dali
26 {
27 class WebEngineContextMenu;
28
29 /**
30  * @brief A class WebEngineContextMenuItem for context menu item of web engine.
31  */
32 class WebEngineContextMenuItem
33 {
34 public:
35   /**
36    * @brief Enumeration that provides the tags of items for the context menu.
37    */
38   enum class ItemTag
39   {
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
49     COPY,                           ///< Copy
50     GO_BACK,                        ///< Go back
51     GO_FORWARD,                     ///< Go forward
52     STOP,                           ///< Stop
53     SHARE,                          ///< Share
54     RELOAD,                         ///< Reload
55     CUT,                            ///< Cut
56     PASTE,                          ///< Paste
57     SPELLING_GUESS,                 ///< Spelling guess
58     NO_GUESSES_FOUND,               ///< Guess found
59     IGNORE_SPELLING,                ///< Ignore spelling
60     LEARN_SPELLING,                 ///< Learn spelling
61     OTHER,                          ///< Other
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
84     BOLD,                           ///< Bold
85     ITALIC,                         ///< Italic
86     UNDERLINE,                      ///< Underline
87     OUTLINE,                        ///< Outline
88     STYLES,                         ///< Style
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
129     DRAG,                           ///< Drag
130     TRANSLATE,                      ///< Translate
131     COPY_LINK_DATA,                 ///< Copy link data
132   };
133
134   /**
135    * @brief Enumeration that defines the types of the items for the context menu.
136    */
137   enum class ItemType
138   {
139     ACTION,           ///< Action
140     CHECKABLE_ACTION, ///< Checkable action
141     SEPARATOR,        ///< Separator
142     SUBMENU,          ///< Sub-menu
143   };
144
145   /**
146    * @brief Constructor.
147    */
148   WebEngineContextMenuItem() = default;
149
150   /**
151    * @brief Destructor.
152    */
153   virtual ~WebEngineContextMenuItem() = default;
154
155   /**
156    * @brief Return the tag of context menu item.
157    *
158    * @return The tag of context menu item
159    */
160   virtual ItemTag GetTag() const = 0;
161
162   /**
163    * @brief Return the type of context menu item.
164    *
165    * @return The type of context menu item
166    */
167   virtual ItemType GetType() const = 0;
168
169   /**
170    * @brief Check if the item is enabled or not.
171    *
172    * @return true if it is enabled, false otherwise
173    */
174   virtual bool IsEnabled() const = 0;
175
176   /**
177    * @brief Return the link url of context menu item.
178    *
179    * @return The current link url if succeeded, empty string otherwise
180    */
181   virtual std::string GetLinkUrl() const = 0;
182
183   /**
184    * @brief Return the image url of context menu item.
185    *
186    * @return The current image url if succeeded, empty string otherwise
187    */
188   virtual std::string GetImageUrl() const = 0;
189
190   /**
191    * @brief Get a title of the item.
192    *
193    * @return a title of the item if succeeded, empty string otherwise
194    */
195   virtual std::string GetTitle() const = 0;
196
197   /**
198    * @brief Get the parent menu for the item.
199    *
200    * @return parent menu if succeeded, 0 otherwise
201    */
202   virtual std::unique_ptr<Dali::WebEngineContextMenu> GetParentMenu() const = 0;
203 };
204
205 } // namespace Dali
206
207 #endif // DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H