(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.h
1 #ifndef DALI_WEB_ENGINE_CONTEXT_MENU_H
2 #define DALI_WEB_ENGINE_CONTEXT_MENU_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 <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
23 #include <dali/public-api/math/vector2.h>
24 #include <memory>
25 #include <string>
26 #include <vector>
27
28 namespace Dali
29 {
30 /**
31  * @brief A class WebEngineContextMenu for context menu of web engine.
32  */
33 class WebEngineContextMenu
34 {
35 public:
36   /**
37    * @brief Constructor.
38    */
39   WebEngineContextMenu() = default;
40
41   /**
42    * @brief Destructor.
43    */
44   virtual ~WebEngineContextMenu() = default;
45
46   /**
47    * @brief Count the number of the context menu item.
48    *
49    * @return The number of current context menu item
50    */
51   virtual uint32_t GetItemCount() const = 0;
52
53   /**
54    * @brief Return the nth item in a context menu.
55    *
56    * @param[in] index The number of the item
57    *
58    * @return The nth item of context menu
59    */
60   virtual std::unique_ptr<WebEngineContextMenuItem> GetItemAt(uint32_t index) const = 0;
61
62   /**
63    * @brief Get the list of items.
64    *
65    * @return item list of context menu
66    */
67   virtual std::vector<std::unique_ptr<WebEngineContextMenuItem>> GetItemList() const = 0;
68
69   /**
70    * @brief Remove the item from the context menu.
71    *
72    * @param[in] item The context menu item to be removed
73    *
74    * @return true if succeeded, false otherwise
75    */
76   virtual bool RemoveItem(WebEngineContextMenuItem& item) = 0;
77
78   /**
79    * @brief Add the item to the context menu.
80    *
81    * @param[in] tag The tag of context menu item
82    * @param[in] title The title of context menu item
83    * @param[in] enabled If true the context menu item is enabled, false otherwise
84    *
85    * @return true if succeeded, false otherwise
86    */
87   virtual bool AppendItemAsAction(WebEngineContextMenuItem::ItemTag tag, const std::string& title, bool enabled) = 0;
88
89   /**
90    * @brief Add the item to the context menu.
91    *
92    * @param[in] tag The tag of context menu item
93    * @param[in] title The title of context menu item
94    * @param[in] iconFile The path of icon to be set on context menu item
95    * @param[in] enabled If true the context menu item is enabled, false otherwise
96    *
97    * @return true if succeeded, false otherwise
98    */
99   virtual bool AppendItem(WebEngineContextMenuItem::ItemTag tag, const std::string& title, const std::string& iconFile, bool enabled) = 0;
100
101   /**
102    * @brief Select the item from the context menu.
103    *
104    * @return true if succeeded, false otherwise
105    */
106   virtual bool SelectItem(WebEngineContextMenuItem& item) = 0;
107
108   /**
109    * @brief Hide the context menu.
110    *
111    * @return true if succeeded, false otherwise
112    */
113   virtual bool Hide() = 0;
114 };
115
116 } // namespace Dali
117
118 #endif // DALI_WEB_ENGINE_CONTEXT_MENU_H