1 #ifndef DALI_WEB_ENGINE_CONTEXT_MENU_H
2 #define DALI_WEB_ENGINE_CONTEXT_MENU_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.
22 #include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
23 #include <dali/public-api/math/vector2.h>
31 * @brief A class WebEngineContextMenu for context menu of web engine.
33 class WebEngineContextMenu
39 WebEngineContextMenu() = default;
44 virtual ~WebEngineContextMenu() = default;
47 * @brief Count the number of the context menu item.
49 * @return The number of current context menu item
51 virtual uint32_t GetItemCount() const = 0;
54 * @brief Return the nth item in a context menu.
56 * @param[in] index The number of the item
58 * @return The nth item of context menu
60 virtual std::unique_ptr<WebEngineContextMenuItem> GetItemAt(uint32_t index) const = 0;
63 * @brief Get the list of items.
65 * @return item list of context menu
67 virtual std::vector<std::unique_ptr<WebEngineContextMenuItem>> GetItemList() const = 0;
70 * @brief Remove the item from the context menu.
72 * @param[in] item The context menu item to be removed
74 * @return true if succeeded, false otherwise
76 virtual bool RemoveItem(WebEngineContextMenuItem& item) = 0;
79 * @brief Add the item to the context menu.
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
85 * @return true if succeeded, false otherwise
87 virtual bool AppendItemAsAction(WebEngineContextMenuItem::ItemTag tag, const std::string& title, bool enabled) = 0;
90 * @brief Add the item to the context menu.
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
97 * @return true if succeeded, false otherwise
99 virtual bool AppendItem(WebEngineContextMenuItem::ItemTag tag, const std::string& title, const std::string& iconFile, bool enabled) = 0;
102 * @brief Select the item from the context menu.
104 * @return true if succeeded, false otherwise
106 virtual bool SelectItem(WebEngineContextMenuItem& item) = 0;
109 * @brief Hide the context menu.
111 * @return true if succeeded, false otherwise
113 virtual bool Hide() = 0;
118 #endif // DALI_WEB_ENGINE_CONTEXT_MENU_H