Add APIs for showing/hiding context menu. 42/260242/4
authorhuayong.xu <huayong.xu@samsung.com>
Tue, 22 Jun 2021 09:04:22 +0000 (17:04 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Mon, 5 Jul 2021 02:46:22 +0000 (10:46 +0800)
1) Remove APIs for customizing context menu and selecting some menu
   item.
2) Remove GetPosition of context menu.
3) Rename some APIs in web context.

Change-Id: I70a3fe2b5d41e72e58af762e60105c69eefc09a7

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

index 7ccdabb..2593a9d 100755 (executable)
@@ -67,13 +67,6 @@ public:
   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
old mode 100644 (file)
new mode 100755 (executable)
index bb82dce..4db0aba
@@ -126,6 +126,13 @@ public:
   virtual void SetProxyUri(const std::string& uri) = 0;
 
   /**
+   * @brief Get the proxy URI from the network backend of specific context.
+   *
+   * @return current proxy URI or null if it's not set
+   */
+  virtual std::string GetProxyUri() const = 0;
+
+  /**
    * @brief Set a proxy auth credential to network backend of specific context.
    * @details Normally, proxy auth credential should be got from the callback
    *          set by ewk_view_authentication_callback_set, once the username in
@@ -137,6 +144,21 @@ public:
   virtual void SetDefaultProxyAuth(const std::string& username, const std::string& password) = 0;
 
   /**
+   * @brief Set the given proxy to network backend of specific context.
+   *
+   * @param[in] proxy URI to set
+   * @param[in] bypass rule to set
+   */
+  virtual void SetProxyBypassRule(const std::string& proxy, const std::string& bypass) = 0;
+
+  /**
+   * @brief Get the proxy bypass rule from the network backend of specific context.
+   *
+   * @return current proxy bypass rule or null string if it's not set
+   */
+  virtual std::string GetProxyBypassRule() const = 0;
+
+  /**
    * @brief Add CA certificates to persistent NSS certificate database
    * Function accepts a path to a CA certificate file, a path to a directory
    * containing CA certificate files, or a colon-seprarated list of those.
@@ -147,6 +169,15 @@ public:
   virtual void SetCertificateFilePath(const std::string& certificatePath) = 0;
 
   /**
+   * @brief Get CA certifcate file path
+   *
+   * It returns an internal string and should not be modified.
+   *
+   * @return certificate_file path which is set during ewk_context_certificate_file_set or null string otherwise
+   */
+  virtual std::string GetCertificateFilePath() const = 0;
+
+  /**
    * @brief Request for deleting all web databases.
    */
   virtual void DeleteAllWebDatabase() = 0;
@@ -260,29 +291,20 @@ public:
   virtual bool IsCacheEnabled() const = 0;
 
   /**
-   * @brief Get CA certifcate file path
-   *
-   * It returns an internal string and should not be modified.
+   * @brief Set application id for context.
    *
-   * @return @c certificate_file is path which is set during ewk_context_certificate_file_set or @c null string otherwise
+   * @param[in] appId application id
    */
-  virtual std::string GetContextCertificateFile() const = 0;
+  virtual void SetAppId(const std::string& appId) = 0;
 
   /**
-   * @brief Set application id for @a context.
-   *
-   * @param[in] appID application id
-   */
-  virtual void SetContextAppId(const std::string& appID) = 0;
-
-  /**
-   * @brief Set application version for @a context.
+   * @brief Set application version for context.
    *
    * @param[in] appVersion application version
    *
-   * @return @c true if successful, @c false otherwise
+   * @return true if successful, false otherwise
    */
-  virtual bool SetContextAppVersion(const std::string& appVersion) = 0;
+  virtual bool SetAppVersion(const std::string& appVersion) = 0;
 
   /**
    * @brief To declare application type
@@ -290,14 +312,14 @@ public:
    * @param[in] applicationType The Application_Type enum
    *
    */
-  virtual void SetContextApplicationType(const ApplicationType applicationType) = 0;
+  virtual void SetApplicationType(const ApplicationType applicationType) = 0;
 
   /**
    * @brief Set time offset
    *
    * @param[in] timeOffset The value will be added to system time as offset
    */
-  virtual void SetContextTimeOffset(float timeOffset) = 0;
+  virtual void SetTimeOffset(float timeOffset) = 0;
 
   /**
    * @brief Set timezone offset
@@ -305,7 +327,23 @@ public:
    * @param[in] timeZoneOffset offset for time zone.
    * @param[in] daylightSavingTime The value is for daylight saving time use.
    */
-  virtual void SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime) = 0;
+  virtual void SetTimeZoneOffset(float timeZoneOffset, float daylightSavingTime) = 0;
+
+  /**
+   * @brief Set default zoom factor
+   *
+   * @param[in] zoomFactor default zoom factor
+   */
+  virtual void SetDefaultZoomFactor(float zoomFactor) = 0;
+
+  /**
+   * @brief Get default zoom factor
+   *
+   * Gets default zoom factor for all pages opened with this context.
+   *
+   * @return default zoom factor or negative value on error
+   */
+  virtual float GetDefaultZoomFactor() const = 0;
 
   /**
    * @brief Register url schemes as CORS enabled
@@ -328,22 +366,6 @@ public:
   virtual void RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes) = 0;
 
   /**
-   * @brief Set default zoom factor
-   *
-   * @param[in] zoomFactor default zoom factor
-   */
-  virtual void SetDefaultZoomFactor(float zoomFactor) = 0;
-
-  /**
-   * @brief Get default zoom factor
-   *
-   * Gets default zoom factor for all pages opened with this context.
-   *
-   * @return @c default zoom factor or negative value on error
-   */
-  virtual float GetContextDefaultZoomFactor() const = 0;
-
-  /**
    * @brief Request for deleting all web application caches.
    *
    * @return @c true on success, otherwise @c false
@@ -375,28 +397,6 @@ public:
   virtual void DeleteAllFormCandidateData() = 0;
 
   /**
-   * @brief Get the proxy URI from the network backend of specific context.
-   *
-   * @return current proxy URI or @c null string if it's not set
-   */
-  virtual std::string GetContextProxy() const = 0;
-
-  /**
-   * @brief Set the given proxy to network backend of specific context.
-   *
-   * @param[in] proxy URI to set
-   * @param[in] bypass rule to set
-   */
-  virtual void SetContextProxy(const std::string& proxy, const std::string& bypass) = 0;
-
-  /**
-   * @brief Get the proxy bypass rule from the network backend of specific context.
-   *
-   * @return current proxy bypass rule or @c null string if it's not set
-   */
-  virtual std::string GetProxyBypassRule() const = 0;
-
-  /**
    * @brief Notify low memory to free unused memory.
    *
    * @return @c true on success or @c false otherwise.
index 421ca6f..7facdac 100755 (executable)
@@ -39,7 +39,6 @@ class WebEngineCertificate;
 class WebEngineConsoleMessage;
 class WebEngineContext;
 class WebEngineContextMenu;
-class WebEngineContextMenuItem;
 class WebEngineCookieManager;
 class WebEngineFormRepostDecision;
 class WebEngineHitTest;
@@ -105,7 +104,7 @@ public:
   using WebEngineRequestInterceptorSignalType = Signal<void(std::shared_ptr<Dali::WebEngineRequestInterceptor>)>;
 
   /**
-   * @brief WebView signal type related with console message will be logged.
+   * @brief WebView signal type related with console message logged.
    */
   using WebEngineConsoleMessageSignalType = Signal<void(std::shared_ptr<Dali::WebEngineConsoleMessage>)>;
 
@@ -120,14 +119,14 @@ public:
   using WebEngineHttpAuthHandlerSignalType = Signal<void(std::shared_ptr<Dali::WebEngineHttpAuthHandler>)>;
 
   /**
-   * @brief WebView signal type related with context menu customized.
+   * @brief WebView signal type related with context menu shown.
    */
-  using WebEngineContextMenuCustomizedSignalType = Signal<void(std::shared_ptr<Dali::WebEngineContextMenu>)>;
+  using WebEngineContextMenuShownSignalType = Signal<void(std::shared_ptr<Dali::WebEngineContextMenu>)>;
 
   /**
-   * @brief WebView signal type related with context menu item selected.
+   * @brief WebView signal type related with context menu hidden.
    */
-  using WebEngineContextMenuItemSelectedSignalType = Signal<void(std::shared_ptr<Dali::WebEngineContextMenuItem>)>;
+  using WebEngineContextMenuHiddenSignalType = Signal<void(std::shared_ptr<Dali::WebEngineContextMenu>)>;
 
   /**
    * @brief Alert callback when JavaScript alert is called with a message.
@@ -281,7 +280,7 @@ public:
    *
    * @return Url of string type
    */
-  virtual const std::string& GetUrl() = 0;
+  virtual std::string GetUrl() const = 0;
 
   /**
    * @brief Load a given string as web contents.
@@ -536,7 +535,7 @@ public:
    *
    * @return The string value of user agent
    */
-  virtual const std::string& GetUserAgent() const = 0;
+  virtual std::string GetUserAgent() const = 0;
 
   /**
    * @brief Set user agent string.
@@ -847,18 +846,18 @@ public:
   virtual WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal() = 0;
 
   /**
-   * @brief Connect to this signal to be notified when context menu would be customized.
+   * @brief Connect to this signal to be notified when context menu would be shown.
    *
    * @return A signal object to connect with.
    */
-  virtual WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal() = 0;
+  virtual WebEngineContextMenuShownSignalType& ContextMenuShownSignal() = 0;
 
   /**
-   * @brief Connect to this signal to be notified when context menu item is selected.
+   * @brief Connect to this signal to be notified when context menu would be hidden.
    *
    * @return A signal object to connect with.
    */
-  virtual WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal() = 0;
+  virtual WebEngineContextMenuHiddenSignalType& ContextMenuHiddenSignal() = 0;
 };
 
 // specialization has to be done in the same namespace
index c273867..3758a00 100755 (executable)
@@ -132,7 +132,7 @@ Dali::PixelData WebEngine::GetFavicon() const
   return GetImplementation(*this).GetFavicon();
 }
 
-const std::string& WebEngine::GetUrl()
+std::string WebEngine::GetUrl() const
 {
   return GetImplementation(*this).GetUrl();
 }
@@ -317,7 +317,7 @@ void WebEngine::ClearAllTilesResources()
   GetImplementation(*this).ClearAllTilesResources();
 }
 
-const std::string& WebEngine::GetUserAgent() const
+std::string WebEngine::GetUserAgent() const
 {
   return GetImplementation(*this).GetUserAgent();
 }
@@ -547,14 +547,14 @@ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHa
   return GetImplementation(*this).HttpAuthHandlerSignal();
 }
 
-Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& WebEngine::ContextMenuCustomizedSignal()
+Dali::WebEnginePlugin::WebEngineContextMenuShownSignalType& WebEngine::ContextMenuShownSignal()
 {
-  return GetImplementation(*this).ContextMenuCustomizedSignal();
+  return GetImplementation(*this).ContextMenuShownSignal();
 }
 
-Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& WebEngine::ContextMenuItemSelectedSignal()
+Dali::WebEnginePlugin::WebEngineContextMenuHiddenSignalType& WebEngine::ContextMenuHiddenSignal()
 {
-  return GetImplementation(*this).ContextMenuItemSelectedSignal();
+  return GetImplementation(*this).ContextMenuHiddenSignal();
 }
 
 } // namespace Dali
index 99cc150..9ea8f00 100755 (executable)
@@ -160,7 +160,7 @@ public:
   /**
    * @brief Get the url.
    */
-  const std::string& GetUrl();
+  std::string GetUrl() const;
 
   /**
    * @brief Load a given string as web contents.
@@ -417,7 +417,7 @@ public:
    *
    * @return The string value of user agent
    */
-  const std::string& GetUserAgent() const;
+  std::string GetUserAgent() const;
 
   /**
    * @brief Set user agent string.
@@ -730,18 +730,18 @@ public:
   Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
 
   /**
-   * @brief Connect to this signal to be notified when context menu would be customized.
+   * @brief Connect to this signal to be notified when context menu would be shown.
    *
    * @return A signal object to connect with.
    */
-  Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
+  Dali::WebEnginePlugin::WebEngineContextMenuShownSignalType& ContextMenuShownSignal();
 
   /**
-   * @brief Connect to this signal to be notified when context menu item is selected.
+   * @brief Connect to this signal to be notified when context menu would be hidden.
    *
    * @return A signal object to connect with.
    */
-  Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
+  Dali::WebEnginePlugin::WebEngineContextMenuHiddenSignalType& ContextMenuHiddenSignal();
 
 private: // Not intended for application developers
   /**
index dd1a7d1..b6539f8 100755 (executable)
@@ -226,12 +226,12 @@ Dali::PixelData WebEngine::GetFavicon() const
   return mPlugin->GetFavicon();
 }
 
-const std::string& WebEngine::GetUrl()
+std::string WebEngine::GetUrl() const
 {
   return mPlugin->GetUrl();
 }
 
-const std::string& WebEngine::GetUserAgent() const
+std::string WebEngine::GetUserAgent() const
 {
   return mPlugin->GetUserAgent();
 }
@@ -641,14 +641,14 @@ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHa
   return mPlugin->HttpAuthHandlerSignal();
 }
 
-Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& WebEngine::ContextMenuCustomizedSignal()
+Dali::WebEnginePlugin::WebEngineContextMenuShownSignalType& WebEngine::ContextMenuShownSignal()
 {
-  return mPlugin->ContextMenuCustomizedSignal();
+  return mPlugin->ContextMenuShownSignal();
 }
 
-Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& WebEngine::ContextMenuItemSelectedSignal()
+Dali::WebEnginePlugin::WebEngineContextMenuHiddenSignalType& WebEngine::ContextMenuHiddenSignal()
 {
-  return mPlugin->ContextMenuItemSelectedSignal();
+  return mPlugin->ContextMenuHiddenSignal();
 }
 
 } // namespace Adaptor
index c730049..0dda54b 100755 (executable)
@@ -112,12 +112,12 @@ public:
   /**
    * @copydoc Dali::WebEngine::GetUrl()
    */
-  const std::string& GetUrl();
+  std::string GetUrl() const;
 
   /**
    * @copydoc Dali::WebEngine::GetUserAgent()
    */
-  const std::string& GetUserAgent() const;
+  std::string GetUserAgent() const;
 
   /**
    * @copydoc Dali::WebEngine::SetUserAgent()
@@ -525,14 +525,14 @@ public:
   Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
 
   /**
-   * @copydoc Dali::WebEngine::ContextMenuCustomizedSignal()
+   * @copydoc Dali::WebEngine::ContextMenuShownSignal()
    */
-  Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
+  Dali::WebEnginePlugin::WebEngineContextMenuShownSignalType& ContextMenuShownSignal();
 
   /**
-   * @copydoc Dali::WebEngine::ContextMenuItemSelectedSignal()
+   * @copydoc Dali::WebEngine::ContextMenuHiddenSignal()
    */
-  Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
+  Dali::WebEnginePlugin::WebEngineContextMenuHiddenSignalType& ContextMenuHiddenSignal();
 
 private:
   /**