Add APIs for context menu into web engine. 12/254412/5
authorhuayong.xu <huayong.xu@samsung.com>
Tue, 2 Mar 2021 12:01:34 +0000 (20:01 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Thu, 8 Apr 2021 06:02:01 +0000 (14:02 +0800)
This patch is to add some APIs for context menu in web engine.

Change-Id: Ibe799a73677556f14f6bb9345996db7178956f30

dali/devel-api/adaptor-framework/web-engine-context-menu-item.h [new file with mode: 0755]
dali/devel-api/adaptor-framework/web-engine-context-menu.h [new file with mode: 0755]
dali/devel-api/adaptor-framework/web-engine-plugin.h [changed mode: 0644->0755]
dali/devel-api/adaptor-framework/web-engine.cpp [changed mode: 0755->0644]
dali/devel-api/adaptor-framework/web-engine.h [changed mode: 0755->0644]
dali/devel-api/file.list
dali/internal/web-engine/common/web-engine-impl.cpp [changed mode: 0755->0644]
dali/internal/web-engine/common/web-engine-impl.h

diff --git a/dali/devel-api/adaptor-framework/web-engine-context-menu-item.h b/dali/devel-api/adaptor-framework/web-engine-context-menu-item.h
new file mode 100755 (executable)
index 0000000..bb801ba
--- /dev/null
@@ -0,0 +1,207 @@
+#ifndef DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H
+#define DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <memory>
+#include <string>
+
+namespace Dali
+{
+class WebEngineContextMenu;
+
+/**
+ * @brief A class WebEngineContextMenuItem for context menu item of web engine.
+ */
+class WebEngineContextMenuItem
+{
+public:
+  /**
+   * @brief Enumeration that provides the tags of items for the context menu.
+   */
+  enum class ItemTag
+  {
+    NO_ACTION = 0,                  ///< No action
+    OPEN_LINK_IN_NEW_WINDOW,        ///< Open link in new window
+    DOWNLOAD_LINK_TO_DISK,          ///< Download link to disk
+    COPY_LINK_TO_CLIPBOARD,         ///< Copy link to clipboard
+    OPEN_IMAGE_IN_NEW_WINDOW,       ///< Open image in new window
+    OPEN_IMAGE_IN_CURRENT_WINDOW,   ///< Open image in current window
+    DOWNLOAD_IMAGE_TO_DISK,         ///< Download image to disk
+    COPY_IMAGE_TO_CLIPBOARD,        ///< Copy image to clipboard
+    OPEN_FRAME_IN_NEW_WINDOW,       ///< Open frame in new window
+    COPY,                           ///< Copy
+    GO_BACK,                        ///< Go back
+    GO_FORWARD,                     ///< Go forward
+    STOP,                           ///< Stop
+    SHARE,                          ///< Share
+    RELOAD,                         ///< Reload
+    CUT,                            ///< Cut
+    PASTE,                          ///< Paste
+    SPELLING_GUESS,                 ///< Spelling guess
+    NO_GUESSES_FOUND,               ///< Guess found
+    IGNORE_SPELLING,                ///< Ignore spelling
+    LEARN_SPELLING,                 ///< Learn spelling
+    OTHER,                          ///< Other
+    SEARCH_IN_SPOTLIGHT,            ///< Search in spotlight
+    SEARCH_WEB,                     ///< Search web
+    LOOK_UP_IN_DICTIONARY,          ///< Look up in dictionary
+    OPEN_WITH_DEFAULT_APPLICATION,  ///< Open with default application
+    PDF_ACTUAL_SIZE,                ///< PDF actual size
+    PDF_ZOOM_IN,                    ///< PDF zoom in
+    PDF_ZOOM_OUT,                   ///< PDF zoom out
+    PDF_AUTO_SIZE,                  ///< PDF auto size
+    PDF_SINGLE_PAGE,                ///< PDF single page
+    PDF_FACTING_PAGES,              ///< PDF facting page
+    PDF_CONTINUOUS,                 ///< PDF continuous
+    PDF_NEXT_PAGE,                  ///< PDF next page
+    PDF_PREVIOUS_PAGE,              ///< PDF previous page
+    OPEN_LINK,                      ///< Open link
+    IGNORE_GRAMMAR,                 ///< Ignore grammar
+    SPELLING_MENU,                  ///< Spelling menu
+    SHOW_SPELLING_PANEL,            ///< Show spelling panel
+    CHECK_SPELLING,                 ///< Check spelling
+    CHECK_SPELLING_WHILE_TYPING,    ///< Check spelling white typing
+    CHECK_GRAMMAR_WITH_SPELLING,    ///< Check grammar with spelling
+    FONT_MENU,                      ///< Font menu
+    SHOW_FONTS,                     ///< Show fonts
+    BOLD,                           ///< Bold
+    ITALIC,                         ///< Italic
+    UNDERLINE,                      ///< Underline
+    OUTLINE,                        ///< Outline
+    STYLES,                         ///< Style
+    SHOW_COLORS,                    ///< Show colors
+    SPEECH_MENU,                    ///< Speech menu
+    START_SPEAKING,                 ///< Start speaking
+    STOP_SPEAKING,                  ///< Stop speaking
+    WRITING_DIRECTION_MENU,         ///< Writing direction menu
+    DEFAULT_DIRECTION,              ///< Default direction
+    LEFT_TO_RIGHT,                  ///< Left to right
+    RIGHT_TO_LEFT,                  ///< Right to left
+    PDF_SINGLE_PAGE_SCROLLING,      ///< PDF single page scrolling
+    PDF_FACING_PAGES_SCROLLING,     ///< PDF facing page scrolling
+    INSPECT_ELEMENT,                ///< Inspect element
+    TEXT_DIRECTION_MENU,            ///< Text direction menu
+    TEXT_DIRECTION_DEFAULT,         ///< Text direction default
+    TEXT_DIRECTION_LEFT_TO_RIGHT,   ///< Text direction left to right
+    TEXT_DIRECTION_RIGHT_TO_LEFT,   ///< Text direction right to left
+    CORRECT_SPELLING_AUTOMATICALLY, ///< Correct spelling automatically
+    SUBSTITUTIONS_MENU,             ///< Substitutions menu
+    SHOW_SUBSTITUTIONS,             ///< Show substitutions
+    SMART_COPY_PASTE,               ///< Smart copy paste
+    SMART_QUOTES,                   ///< Smart quotes
+    SMART_DASHES,                   ///< Smart dashes
+    SMART_LINKS,                    ///< Smart links
+    TEXT_REPLACEMENT,               ///< Text replacement
+    TRANSFORMATIONS_MENU,           ///< Transformation menu
+    MAKE_UPPER_CASE,                ///< Make upper case
+    MAKE_LOWER_CASE,                ///< Make lower case
+    CAPITALIZE,                     ///< Capitalize
+    CHANGE_BACK,                    ///< Change back
+    OPEN_MEDIA_IN_NEW_WINDOW,       ///< Open media in new window
+    COPY_MEDIA_LINK_TO_CLIPBOARD,   ///< Copy media link to clipboard
+    TOGGLE_MEDIA_CONTROLS,          ///< Toggle media controls
+    TOGGLE_MEDIA_LOOP,              ///< Toggle media loop
+    ENTER_VIDEO_FULLSCREEN,         ///< Enter video fullscreen
+    MEDIA_PLAY_PAUSE,               ///< Media play pause
+    MEDIA_MUTE,                     ///< Media mute
+    DICTATION_ALTERNATIVE,          ///< Dictation alternative
+    SELECT_ALL,                     ///< Select all
+    SELECT_WORD,                    ///< Select word
+    TEXT_SELECTION_MODE,            ///< Text selection mode
+    CLIPBOARD,                      ///< Clipboard
+    DRAG,                           ///< Drag
+    TRANSLATE,                      ///< Translate
+    COPY_LINK_DATA,                 ///< Copy link data
+  };
+
+  /**
+   * @brief Enumeration that defines the types of the items for the context menu.
+   */
+  enum class ItemType
+  {
+    ACTION,           ///< Action
+    CHECKABLE_ACTION, ///< Checkable action
+    SEPARATOR,        ///< Separator
+    SUBMENU,          ///< Sub-menu
+  };
+
+  /**
+   * @brief Constructor.
+   */
+  WebEngineContextMenuItem() = default;
+
+  /**
+   * @brief Destructor.
+   */
+  virtual ~WebEngineContextMenuItem() = default;
+
+  /**
+   * @brief Return the tag of context menu item.
+   *
+   * @return The tag of context menu item
+   */
+  virtual ItemTag GetTag() const = 0;
+
+  /**
+   * @brief Return the type of context menu item.
+   *
+   * @return The type of context menu item
+   */
+  virtual ItemType GetType() const = 0;
+
+  /**
+   * @brief Check if the item is enabled or not.
+   *
+   * @return true if it is enabled, false otherwise
+   */
+  virtual bool IsEnabled() const = 0;
+
+  /**
+   * @brief Return the link url of context menu item.
+   *
+   * @return The current link url if succeeded, empty string otherwise
+   */
+  virtual std::string GetLinkUrl() const = 0;
+
+  /**
+   * @brief Return the image url of context menu item.
+   *
+   * @return The current image url if succeeded, empty string otherwise
+   */
+  virtual std::string GetImageUrl() const = 0;
+
+  /**
+   * @brief Get a title of the item.
+   *
+   * @return a title of the item if succeeded, empty string otherwise
+   */
+  virtual std::string GetTitle() const = 0;
+
+  /**
+   * @brief Get the parent menu for the item.
+   *
+   * @return parent menu if succeeded, 0 otherwise
+   */
+  virtual std::unique_ptr<Dali::WebEngineContextMenu> GetParentMenu() const = 0;
+};
+
+} // namespace Dali
+
+#endif // DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_H
diff --git a/dali/devel-api/adaptor-framework/web-engine-context-menu.h b/dali/devel-api/adaptor-framework/web-engine-context-menu.h
new file mode 100755 (executable)
index 0000000..7ccdabb
--- /dev/null
@@ -0,0 +1,125 @@
+#ifndef DALI_WEB_ENGINE_CONTEXT_MENU_H
+#define DALI_WEB_ENGINE_CONTEXT_MENU_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
+#include <dali/public-api/math/vector2.h>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace Dali
+{
+/**
+ * @brief A class WebEngineContextMenu for context menu of web engine.
+ */
+class WebEngineContextMenu
+{
+public:
+  /**
+   * @brief Constructor.
+   */
+  WebEngineContextMenu() = default;
+
+  /**
+   * @brief Destructor.
+   */
+  virtual ~WebEngineContextMenu() = default;
+
+  /**
+   * @brief Count the number of the context menu item.
+   *
+   * @return The number of current context menu item
+   */
+  virtual uint32_t GetItemCount() const = 0;
+
+  /**
+   * @brief Return the nth item in a context menu.
+   *
+   * @param[in] index The number of the item
+   *
+   * @return The nth item of context menu
+   */
+  virtual std::unique_ptr<WebEngineContextMenuItem> GetItemAt(uint32_t index) const = 0;
+
+  /**
+   * @brief Get the list of items.
+   *
+   * @return item list of context menu
+   */
+  virtual std::vector<std::unique_ptr<WebEngineContextMenuItem>> GetItemList() const = 0;
+
+  /**
+   * @brief Get position of the context menu.
+   *
+   * @return position of context menu.
+   */
+  virtual Dali::Vector2 GetPosition() const = 0;
+
+  /**
+   * @brief Remove the item from the context menu.
+   *
+   * @param[in] item The context menu item to be removed
+   *
+   * @return true if succeeded, false otherwise
+   */
+  virtual bool RemoveItem(WebEngineContextMenuItem& item) = 0;
+
+  /**
+   * @brief Add the item to the context menu.
+   *
+   * @param[in] tag The tag of context menu item
+   * @param[in] title The title of context menu item
+   * @param[in] enabled If true the context menu item is enabled, false otherwise
+   *
+   * @return true if succeeded, false otherwise
+   */
+  virtual bool AppendItemAsAction(WebEngineContextMenuItem::ItemTag tag, const std::string& title, bool enabled) = 0;
+
+  /**
+   * @brief Add the item to the context menu.
+   *
+   * @param[in] tag The tag of context menu item
+   * @param[in] title The title of context menu item
+   * @param[in] iconFile The path of icon to be set on context menu item
+   * @param[in] enabled If true the context menu item is enabled, false otherwise
+   *
+   * @return true if succeeded, false otherwise
+   */
+  virtual bool AppendItem(WebEngineContextMenuItem::ItemTag tag, const std::string& title, const std::string& iconFile, bool enabled) = 0;
+
+  /**
+   * @brief Select the item from the context menu.
+   *
+   * @return true if succeeded, false otherwise
+   */
+  virtual bool SelectItem(WebEngineContextMenuItem& item) = 0;
+
+  /**
+   * @brief Hide the context menu.
+   *
+   * @return true if succeeded, false otherwise
+   */
+  virtual bool Hide() = 0;
+};
+
+} // namespace Dali
+
+#endif // DALI_WEB_ENGINE_CONTEXT_MENU_H
old mode 100644 (file)
new mode 100755 (executable)
index c87fbe4..ad74323
@@ -35,6 +35,8 @@ class WebEngineBackForwardList;
 class WebEngineCertificate;
 class WebEngineConsoleMessage;
 class WebEngineContext;
+class WebEngineContextMenu;
+class WebEngineContextMenuItem;
 class WebEngineCookieManager;
 class WebEngineFormRepostDecision;
 class WebEngineHttpAuthHandler;
@@ -114,6 +116,16 @@ public:
   using WebEngineHttpAuthHandlerSignalType = Signal<void(std::shared_ptr<Dali::WebEngineHttpAuthHandler>)>;
 
   /**
+   * @brief WebView signal type related with context menu customized.
+   */
+  using WebEngineContextMenuCustomizedSignalType = Signal<void(std::shared_ptr<Dali::WebEngineContextMenu>)>;
+
+  /**
+   * @brief WebView signal type related with context menu item selected.
+   */
+  using WebEngineContextMenuItemSelectedSignalType = Signal<void(std::shared_ptr<Dali::WebEngineContextMenuItem>)>;
+
+  /**
    * @brief Alert callback when JavaScript alert is called with a message.
    *  It returns true if a pop-up is created successfully, false otherwise.
    */
@@ -256,7 +268,7 @@ public:
   virtual NativeImageInterfacePtr GetNativeImageSource() = 0;
 
   /**
-   * @brief Returns the URL of the Web.
+   * @brief Return the URL of the Web.
    *
    * @return Url of string type
    */
@@ -426,7 +438,7 @@ public:
   virtual void GoBack() = 0;
 
   /**
-   * @brief Evaluates JavaScript code represented as a string.
+   * @brief Evaluate JavaScript code represented as a string.
    *
    * @param[in] script The JavaScript code
    * @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
@@ -502,7 +514,7 @@ public:
   virtual void SetUserAgent(const std::string& userAgent) = 0;
 
   /**
-   * @brief Sets size of Web Page.
+   * @brief Set size of Web Page.
    */
   virtual void SetSize(int width, int height) = 0;
 
@@ -761,7 +773,7 @@ public:
   virtual WebEngineFrameRenderedSignalType& FrameRenderedSignal() = 0;
 
   /**
-   * @brief Connects to this signal to be notified when http request need be intercepted.
+   * @brief Connect to this signal to be notified when http request need be intercepted.
    *
    * @return A signal object to connect with.
    */
@@ -775,32 +787,46 @@ public:
   virtual WebEngineConsoleMessageSignalType& ConsoleMessageSignal() = 0;
 
   /**
-   * @brief Connects to this signal to be notified when new policy would be decided.
+   * @brief Connect to this signal to be notified when new policy would be decided.
    *
    * @return A signal object to connect with.
    */
   virtual WebEnginePolicyDecisionSignalType& PolicyDecisionSignal() = 0;
 
   /**
-   * @brief Connects to this signal to be notified when certificate need be confirmed.
+   * @brief Connect to this signal to be notified when certificate need be confirmed.
    *
    * @return A signal object to connect with.
    */
   virtual WebEngineCertificateSignalType& CertificateConfirmSignal() = 0;
 
   /**
-   * @brief Connects to this signal to be notified when ssl certificate is changed.
+   * @brief Connect to this signal to be notified when ssl certificate is changed.
    *
    * @return A signal object to connect with.
    */
   virtual WebEngineCertificateSignalType& SslCertificateChangedSignal() = 0;
 
   /**
-   * @brief Connects to this signal to be notified when http authentication need be confirmed.
+   * @brief Connect to this signal to be notified when http authentication need be confirmed.
    *
    * @return A signal object to connect with.
    */
   virtual WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal() = 0;
+
+  /**
+   * @brief Connect to this signal to be notified when context menu would be customized.
+   *
+   * @return A signal object to connect with.
+   */
+  virtual WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal() = 0;
+
+  /**
+   * @brief Connect to this signal to be notified when context menu item is selected.
+   *
+   * @return A signal object to connect with.
+   */
+  virtual WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal() = 0;
 };
 
 // specialization has to be done in the same namespace
old mode 100755 (executable)
new mode 100644 (file)
index c7edd4c..243fb75
@@ -22,6 +22,8 @@
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
 #include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
 #include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
 #include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
 #include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
@@ -355,14 +357,14 @@ bool WebEngine::SendKeyEvent(const KeyEvent& event)
   return GetImplementation(*this).SendKeyEvent(event);
 }
 
-bool WebEngine::SendHoverEvent( const HoverEvent& event )
+bool WebEngine::SendHoverEvent(const HoverEvent& event)
 {
-  return GetImplementation( *this ).SendHoverEvent( event );
+  return GetImplementation(*this).SendHoverEvent(event);
 }
 
-bool WebEngine::SendWheelEvent( const WheelEvent& event )
+bool WebEngine::SendWheelEvent(const WheelEvent& event)
 {
-  return GetImplementation( *this ).SendWheelEvent( event );
+  return GetImplementation(*this).SendWheelEvent(event);
 }
 
 void WebEngine::SetFocus(bool focused)
@@ -535,4 +537,14 @@ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHa
   return GetImplementation(*this).HttpAuthHandlerSignal();
 }
 
+Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& WebEngine::ContextMenuCustomizedSignal()
+{
+  return GetImplementation(*this).ContextMenuCustomizedSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& WebEngine::ContextMenuItemSelectedSignal()
+{
+  return GetImplementation(*this).ContextMenuItemSelectedSignal();
+}
+
 } // namespace Dali
old mode 100755 (executable)
new mode 100644 (file)
index ca3ea6f..fee7cfc
@@ -87,7 +87,7 @@ public:
   static WebEngine DownCast(BaseHandle handle);
 
   /**
-   * @brief Creates WebEngine instance.
+   * @brief Create WebEngine instance.
    *
    * @param [in] width The width of Web
    * @param [in] height The height of Web
@@ -97,7 +97,7 @@ public:
   void Create(int width, int height, const std::string& locale, const std::string& timezoneId);
 
   /**
-   * @brief Creates WebEngine instance.
+   * @brief Create WebEngine instance.
    *
    * @param [in] width The width of Web
    * @param [in] height The height of Web
@@ -107,12 +107,12 @@ public:
   void Create(int width, int height, int argc, char** argv);
 
   /**
-   * @brief Destroys WebEngine instance.
+   * @brief Destroy WebEngine instance.
    */
   void Destroy();
 
   /**
-   * @brief Gets native image source to render.
+   * @brief Get native image source to render.
    */
   NativeImageInterfacePtr GetNativeImageSource();
 
@@ -137,33 +137,33 @@ public:
   Dali::WebEngineBackForwardList& GetBackForwardList() const;
 
   /**
-   * @brief Loads a web page based on a given URL.
+   * @brief Load a web page based on a given URL.
    *
    * @param [in] url The URL of the resource to load
    */
   void LoadUrl(const std::string& url);
 
   /**
-   * @brief Returns the title of the Web.
+   * @brief Return the title of the Web.
    *
    * @return The title of web page
    */
   std::string GetTitle() const;
 
   /**
-   * @brief Returns the Favicon of the Web.
+   * @brief Return the Favicon of the Web.
    *
    * @return FavIcon of Dali::PixelData& type
    */
   Dali::PixelData GetFavicon() const;
 
   /**
-   * @brief Gets the url.
+   * @brief Get the url.
    */
   const std::string& GetUrl();
 
   /**
-   * @brief Loads a given string as web contents.
+   * @brief Load a given string as web contents.
    *
    * @param [in] htmlString The string to use as the contents of the web page
    */
@@ -181,7 +181,7 @@ public:
   bool LoadHtmlStringOverrideCurrentEntry(const std::string& html, const std::string& basicUri, const std::string& unreachableUrl);
 
   /**
-   * @brief Requests loading the given contents by MIME type into the view object
+   * @brief Request loading the given contents by MIME type into the view object
    *
    * @param[in] contents The content to load
    * @param[in] contentSize The size of contents (in bytes)
@@ -194,27 +194,27 @@ public:
   bool LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri);
 
   /**
-   * @brief Reloads the Web.
+   * @brief Reload the Web.
    */
   void Reload();
 
   /**
-   * @brief Reloads the current page's document without cache
+   * @brief Reload the current page's document without cache
    */
   bool ReloadWithoutCache();
 
   /**
-   * @brief Stops loading web contents on the current page.
+   * @brief Stop loading web contents on the current page.
    */
   void StopLoading();
 
   /**
-   * @brief Suspends the operation associated with the view.
+   * @brief Suspend the operation associated with the view.
    */
   void Suspend();
 
   /**
-   * @brief Resumes the operation associated with the view object after calling Suspend().
+   * @brief Resume the operation associated with the view object after calling Suspend().
    */
   void Resume();
 
@@ -264,7 +264,7 @@ public:
   bool StopInspectorServer();
 
   /**
-   * @brief Scrolls web page of view by deltaX and deltaY.
+   * @brief Scroll web page of view by deltaX and deltaY.
    *
    * @param[in] deltaX horizontal offset to scroll
    * @param[in] deltaY vertical offset to scroll
@@ -272,7 +272,7 @@ public:
   void ScrollBy(int deltaX, int deltaY);
 
   /**
-   * @brief Scrolls edge of view by deltaX and deltaY.
+   * @brief Scroll edge of view by deltaX and deltaY.
    *
    * @param[in] deltaX horizontal offset to scroll
    * @param[in] deltaY vertical offset to scroll
@@ -282,51 +282,51 @@ public:
   bool ScrollEdgeBy(int deltaX, int deltaY);
 
   /**
-   * @brief Sets an absolute scroll of the given view.
+   * @brief Set an absolute scroll of the given view.
    */
   void SetScrollPosition(int x, int y);
 
   /**
-   * @brief Gets the current scroll position of the given view.
+   * @brief Get the current scroll position of the given view.
    */
   Dali::Vector2 GetScrollPosition() const;
 
   /**
-   * @brief Gets the possible scroll size of the given view.
+   * @brief Get the possible scroll size of the given view.
    */
   Dali::Vector2 GetScrollSize() const;
 
   /**
-   * @brief Gets the last known content's size.
+   * @brief Get the last known content's size.
    */
   Dali::Vector2 GetContentSize() const;
 
   /**
-   * @brief Returns whether forward is possible.
+   * @brief Return whether forward is possible.
    *
    * @return True if forward is possible, false otherwise
    */
   bool CanGoForward();
 
   /**
-   * @brief Goes to forward.
+   * @brief Go to forward.
    */
   void GoForward();
 
   /**
-   * @brief Returns whether backward is possible.
+   * @brief Return whether backward is possible.
    *
    * @return True if backward is possible, false otherwise
    */
   bool CanGoBack();
 
   /**
-   * @brief Goes to back.
+   * @brief Go to back.
    */
   void GoBack();
 
   /**
-   * @brief Evaluates JavaScript code represented as a string.
+   * @brief Evaluate JavaScript code represented as a string.
    *
    * @param[in] script The JavaScript code
    * @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
@@ -380,12 +380,12 @@ public:
   void JavaScriptPromptReply(const std::string& result);
 
   /**
-   * @brief Clears the history of Web.
+   * @brief Clear the history of Web.
    */
   void ClearHistory();
 
   /**
-   * @brief Clears all tiles resources of Web.
+   * @brief Clear all tiles resources of Web.
    */
   void ClearAllTilesResources();
 
@@ -404,52 +404,52 @@ public:
   void SetUserAgent(const std::string& userAgent);
 
   /**
-   * @brief Sets the size of Web Pages.
+   * @brief Set the size of Web Pages.
    */
   void SetSize(int width, int height);
 
   /**
-   * @brief Sets background color of web page.
+   * @brief Set background color of web page.
    *
    * @param[in] color Background color
    */
   void SetDocumentBackgroundColor(Dali::Vector4 color);
 
   /**
-   * @brief Clears tiles when hidden.
+   * @brief Clear tiles when hidden.
    *
    * @param[in] cleared Whether tiles are cleared or not
    */
   void ClearTilesWhenHidden(bool cleared);
 
   /**
-   * @brief Sets multiplier of cover area of tile.
+   * @brief Set multiplier of cover area of tile.
    *
    * @param[in] multiplier The multiplier of cover area
    */
   void SetTileCoverAreaMultiplier(float multiplier);
 
   /**
-   * @brief Enables cursor by client.
+   * @brief Enable cursor by client.
    *
    * @param[in] enabled Whether cursor is enabled or not
    */
   void EnableCursorByClient(bool enabled);
 
   /**
-   * @brief Gets the selected text.
+   * @brief Get the selected text.
    *
    * @return the selected text
    */
   std::string GetSelectedText() const;
 
   /**
-   * @brief Sends Touch Events.
+   * @brief Send Touch Events.
    */
   bool SendTouchEvent(const TouchEvent& touch);
 
   /**
-   * @brief Sends key Events.
+   * @brief Send key Events.
    */
   bool SendKeyEvent(const KeyEvent& event);
 
@@ -460,58 +460,58 @@ public:
   void SetFocus(bool focused);
 
   /**
-   * @brief Enables/disables mouse events. The default is enabled.
+   * @brief Enable/disable mouse events. The default is enabled.
    *
    * @param[in] enabled True if mouse events are enabled, false otherwise
    */
-  void EnableMouseEvents( bool enabled );
+  void EnableMouseEvents(bool enabled);
 
   /**
-   * @brief Enables/disables key events. The default is enabled.
+   * @brief Enable/disable key events. The default is enabled.
    *
    * @param[in] enabled True if key events are enabled, false otherwise
    */
-  void EnableKeyEvents( bool enabled );
+  void EnableKeyEvents(bool enabled);
 
   /**
-   * @brief Sets zoom factor of the current page.
+   * @brief Set zoom factor of the current page.
    * @param[in] zoomFactor a new factor to be set.
    */
   void SetPageZoomFactor(float zoomFactor);
 
   /**
-   * @brief Queries the current zoom factor of the page。
+   * @brief Query the current zoom factor of the page。
    * @return The current page zoom factor.
    */
   float GetPageZoomFactor() const;
 
   /**
-   * @brief Sets the current text zoom level。.
+   * @brief Set the current text zoom level。.
    * @param[in] zoomFactor a new factor to be set.
    */
   void SetTextZoomFactor(float zoomFactor);
 
   /**
-   * @brief Gets the current text zoom level.
+   * @brief Get the current text zoom level.
    * @return The current text zoom factor.
    */
   float GetTextZoomFactor() const;
 
   /**
-   * @brief Gets the current load progress of the page.
+   * @brief Get the current load progress of the page.
    * @return The load progress of the page.
    */
   float GetLoadProgressPercentage() const;
 
   /**
-   * @brief Scales the current page, centered at the given point.
+   * @brief Scale the current page, centered at the given point.
    * @param[in] scaleFactor a new factor to be scaled.
    * @param[in] point a center coordinate.
    */
   void SetScaleFactor(float scaleFactor, Dali::Vector2 point);
 
   /**
-   * @brief Gets the current scale factor of the page.
+   * @brief Get the current scale factor of the page.
    * @return The current scale factor.
    */
   float GetScaleFactor() const;
@@ -531,7 +531,7 @@ public:
   bool SetVisibility(bool visible);
 
   /**
-   * @brief Searches and highlights the given string in the document.
+   * @brief Search and highlights the given string in the document.
    * @param[in] text The text to find
    * @param[in] options The options to find
    * @param[in] maxMatchCount The maximum match count to find
@@ -578,7 +578,7 @@ public:
   bool CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback);
 
   /**
-   * @brief Sets callback which alled upon geolocation permission request.
+   * @brief Set callback which alled upon geolocation permission request.
    *
    * @param[in] callback The callback for requesting geolocation permission
    */
@@ -597,115 +597,129 @@ public:
   void EnableVideoHole(bool enabled);
 
   /**
-   * @brief Sends hover events.
+   * @brief Send hover events.
    * @param[in] event The hover event would be sent.
    */
-  bool SendHoverEvent( const HoverEvent& event );
+  bool SendHoverEvent(const HoverEvent& event);
 
   /**
-   * @brief Sends wheel events.
+   * @brief Send wheel events.
    * @param[in] event The wheel event would be sent.
    */
-  bool SendWheelEvent( const WheelEvent& event );
+  bool SendWheelEvent(const WheelEvent& event);
 
   /**
-   * @brief Connects to this signal to be notified when page loading is started.
+   * @brief Connect to this signal to be notified when page loading is started.
    *
    * @return A signal object to connect with
    */
   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when page loading is in progress.
+   * @brief Connect to this signal to be notified when page loading is in progress.
    *
    * @return A signal object to connect with
    */
   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadInProgressSignal();
 
   /**
-   * @brief Connects to this signal to be notified when page loading is finished.
+   * @brief Connect to this signal to be notified when page loading is finished.
    *
    * @return A signal object to connect with
    */
   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadFinishedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when an error occurs in page loading.
+   * @brief Connect to this signal to be notified when an error occurs in page loading.
    *
    * @return A signal object to connect with
    */
   Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal();
 
   /**
-   * @brief Connects to this signal to be notified when scroll edge is reached.
+   * @brief Connect to this signal to be notified when scroll edge is reached.
    *
    * @return A signal object to connect with
    */
   Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when url is changed.
+   * @brief Connect to this signal to be notified when url is changed.
    *
    * @return A signal object to connect with
    */
   Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& UrlChangedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when form repost decision is requested.
+   * @brief Connect to this signal to be notified when form repost decision is requested.
    *
    * @return A signal object to connect with.
    */
   Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& FormRepostDecisionSignal();
 
   /**
-   * @brief Connects to this signal to be notified when frame is rendered.
+   * @brief Connect to this signal to be notified when frame is rendered.
    *
    * @return A signal object to connect with.
    */
   Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& FrameRenderedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when http request need be intercepted.
+   * @brief Connect to this signal to be notified when http request need be intercepted.
    *
    * @return A signal object to connect with.
    */
   Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType& RequestInterceptorSignal();
 
   /**
-   * @brief Connects to this signal to be notified when console message will be logged.
+   * @brief Connect to this signal to be notified when console message will be logged.
    *
    * @return A signal object to connect with.
    */
   Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType& ConsoleMessageSignal();
 
   /**
-   * @brief Connects to this signal to be notified when new policy would be decided.
+   * @brief Connect to this signal to be notified when new policy would be decided.
    *
    * @return A signal object to connect with.
    */
   Dali::WebEnginePlugin::WebEnginePolicyDecisionSignalType& PolicyDecisionSignal();
 
   /**
-   * @brief Connects to this signal to be notified when certificate need be confirmed.
+   * @brief Connect to this signal to be notified when certificate need be confirmed.
    *
    * @return A signal object to connect with.
    */
   Dali::WebEnginePlugin::WebEngineCertificateSignalType& CertificateConfirmSignal();
 
   /**
-   * @brief Connects to this signal to be notified when ssl certificate is changed.
+   * @brief Connect to this signal to be notified when ssl certificate is changed.
    *
    * @return A signal object to connect with.
    */
   Dali::WebEnginePlugin::WebEngineCertificateSignalType& SslCertificateChangedSignal();
 
   /**
-   * @brief Connects to this signal to be notified when http authentication need be confirmed.
+   * @brief Connect to this signal to be notified when http authentication need be confirmed.
    *
    * @return A signal object to connect with.
    */
   Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
 
+  /**
+   * @brief Connect to this signal to be notified when context menu would be customized.
+   *
+   * @return A signal object to connect with.
+   */
+  Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
+
+  /**
+   * @brief Connect to this signal to be notified when context menu item is selected.
+   *
+   * @return A signal object to connect with.
+   */
+  Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
+
 private: // Not intended for application developers
   /**
    * @brief Internal constructor
index 847830e..6f6d767 100755 (executable)
@@ -89,11 +89,13 @@ SET( devel_api_adaptor_framework_header_files
   ${adaptor_devel_api_dir}/adaptor-framework/video-player.h
   ${adaptor_devel_api_dir}/adaptor-framework/video-player-plugin.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine.h
-  ${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list-item.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list.h
+  ${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list-item.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-certificate.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-console-message.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-context.h
+  ${adaptor_devel_api_dir}/adaptor-framework/web-engine-context-menu.h
+  ${adaptor_devel_api_dir}/adaptor-framework/web-engine-context-menu-item.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-cookie-manager.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-form-repost-decision.h
   ${adaptor_devel_api_dir}/adaptor-framework/web-engine-frame.h
old mode 100755 (executable)
new mode 100644 (file)
index be477de..d7e9fec
@@ -29,6 +29,7 @@
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
 #include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
 #include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
 #include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
 #include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
@@ -550,14 +551,14 @@ void WebEngine::EnableVideoHole(bool enabled)
   mPlugin->EnableVideoHole(enabled);
 }
 
-bool WebEngine::SendHoverEvent( const Dali::HoverEvent& event )
+bool WebEngine::SendHoverEvent(const Dali::HoverEvent& event)
 {
-  return mPlugin->SendHoverEvent( event );
+  return mPlugin->SendHoverEvent(event);
 }
 
-bool WebEngine::SendWheelEvent( const Dali::WheelEvent& event )
+bool WebEngine::SendWheelEvent(const Dali::WheelEvent& event)
 {
-  return mPlugin->SendWheelEvent( event );
+  return mPlugin->SendWheelEvent(event);
 }
 
 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
@@ -630,6 +631,16 @@ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHa
   return mPlugin->HttpAuthHandlerSignal();
 }
 
+Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& WebEngine::ContextMenuCustomizedSignal()
+{
+  return mPlugin->ContextMenuCustomizedSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& WebEngine::ContextMenuItemSelectedSignal()
+{
+  return mPlugin->ContextMenuItemSelectedSignal();
+}
+
 } // namespace Adaptor
 } // namespace Internal
 } // namespace Dali
index b572c76..d015ea5 100755 (executable)
@@ -514,6 +514,16 @@ public:
    */
   Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
 
+  /**
+   * @copydoc Dali::WebEngine::ContextMenuCustomizedSignal()
+   */
+  Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
+
+  /**
+   * @copydoc Dali::WebEngine::ContextMenuItemSelectedSignal()
+   */
+  Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
+
 private:
   /**
    * @brief Constructor.