Add changesWatch for webview cookie
[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 Get position of the context menu.
71    *
72    * @return position of context menu.
73    */
74   virtual Dali::Vector2 GetPosition() const = 0;
75
76   /**
77    * @brief Remove the item from the context menu.
78    *
79    * @param[in] item The context menu item to be removed
80    *
81    * @return true if succeeded, false otherwise
82    */
83   virtual bool RemoveItem(WebEngineContextMenuItem& item) = 0;
84
85   /**
86    * @brief Add the item to the context menu.
87    *
88    * @param[in] tag The tag of context menu item
89    * @param[in] title The title of context menu item
90    * @param[in] enabled If true the context menu item is enabled, false otherwise
91    *
92    * @return true if succeeded, false otherwise
93    */
94   virtual bool AppendItemAsAction(WebEngineContextMenuItem::ItemTag tag, const std::string& title, bool enabled) = 0;
95
96   /**
97    * @brief Add the item to the context menu.
98    *
99    * @param[in] tag The tag of context menu item
100    * @param[in] title The title of context menu item
101    * @param[in] iconFile The path of icon to be set on context menu item
102    * @param[in] enabled If true the context menu item is enabled, false otherwise
103    *
104    * @return true if succeeded, false otherwise
105    */
106   virtual bool AppendItem(WebEngineContextMenuItem::ItemTag tag, const std::string& title, const std::string& iconFile, bool enabled) = 0;
107
108   /**
109    * @brief Select the item from the context menu.
110    *
111    * @return true if succeeded, false otherwise
112    */
113   virtual bool SelectItem(WebEngineContextMenuItem& item) = 0;
114
115   /**
116    * @brief Hide the context menu.
117    *
118    * @return true if succeeded, false otherwise
119    */
120   virtual bool Hide() = 0;
121 };
122
123 } // namespace Dali
124
125 #endif // DALI_WEB_ENGINE_CONTEXT_MENU_H