Merge "Add render threading for GlWindow" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine-plugin.h
old mode 100644 (file)
new mode 100755 (executable)
index 7b42614..fbf8d1c
@@ -27,6 +27,10 @@ namespace Dali
 {
 class KeyEvent;
 class TouchEvent;
+class WebEngineBackForwardList;
+class WebEngineContext;
+class WebEngineCookieManager;
+class WebEngineSettings;
 
 /**
  * @brief WebEnginePlugin is an abstract interface, used by dali-adaptor to access WebEngine plugin.
@@ -45,61 +49,34 @@ public:
    */
   typedef Signal<void(const std::string&, int)> WebEnginePageLoadErrorSignalType;
 
+  // forward declaration.
+  enum class ScrollEdge;
+
   /**
-   * @brief Enumeration for cache model options.
+   * @brief WebView signal type related with scroll edge reached.
    */
-  enum class CacheModel
-  {
-    /**
-     * @brief Use the smallest cache capacity.
-     */
-    DOCUMENT_VIEWER,
-
-    /**
-     * @brief Use the bigger cache capacity than DocumentBrowser.
-     */
-    DOCUMENT_BROWSER,
-
-    /**
-     * @brief Use the biggest cache capacity.
-     */
-    PRIMARY_WEB_BROWSER
-  };
+  typedef Signal< void( const ScrollEdge )> WebEngineScrollEdgeReachedSignalType;
 
   /**
-   * @brief Enumeration for the cookies accept policies.
+   * @brief Enumeration for the scroll edge.
    */
-  enum class CookieAcceptPolicy
+  enum class ScrollEdge
   {
-    /**
-     * @brief Accepts every cookie sent from any page.
-     */
-    ALWAYS,
-
-    /**
-     * @brief Rejects all the cookies.
-     */
-    NEVER,
-
-    /**
-     * @brief Accepts only cookies set by the main document that is loaded.
-     */
-    NO_THIRD_PARTY
+    LEFT,   ///< Left edge reached.
+    RIGHT,  ///< Right edge reached.
+    TOP,    ///< Top edge reached.
+    BOTTOM, ///< Bottom edge reached.
   };
 
   /**
    * @brief Constructor.
    */
-  WebEnginePlugin()
-  {
-  }
+  WebEnginePlugin() = default;
 
   /**
    * @brief Destructor.
    */
-  virtual ~WebEnginePlugin()
-  {
-  }
+  virtual ~WebEnginePlugin() = default;
 
   /**
    * @brief Creates WebEngine instance.
@@ -117,6 +94,26 @@ public:
   virtual void Destroy() = 0;
 
   /**
+   * @brief Get settings of WebEngine.
+   */
+  virtual WebEngineSettings& GetSettings() const = 0;
+
+  /**
+   * @brief Get context of WebEngine.
+   */
+  virtual WebEngineContext& GetContext() const = 0;
+
+  /**
+   * @brief Get cookie manager of WebEngine.
+   */
+  virtual WebEngineCookieManager& GetCookieManager() const = 0;
+
+  /**
+   * @brief Get back-forward list of WebEngine.
+   */
+  virtual WebEngineBackForwardList& GetBackForwardList() const = 0;
+
+  /**
    * @brief Loads a web page based on a given URL.
    *
    * @param [in] url The URL of the resource to load
@@ -140,7 +137,7 @@ public:
    *
    * @param [in] htmlString The string to use as the contents of the web page
    */
-  virtual void LoadHTMLString(const std::string& htmlString) = 0;
+  virtual void LoadHtmlString(const std::string& htmlString) = 0;
 
   /**
    * @brief Reloads the Web.
@@ -163,6 +160,31 @@ public:
   virtual void Resume() = 0;
 
   /**
+   * @brief Scrolls the webpage of view by deltaX and deltaY.
+   */
+  virtual void ScrollBy( int deltaX, int deltaY ) = 0;
+
+  /**
+   * @brief Scroll to the specified position of the given view.
+   */
+  virtual void SetScrollPosition( int x, int y ) = 0;
+
+  /**
+   * @brief Gets the current scroll position of the given view.
+   */
+  virtual void GetScrollPosition( int& x, int& y ) const = 0;
+
+  /**
+   * @brief Gets the possible scroll size of the given view.
+   */
+  virtual void GetScrollSize( int& width, int& height ) const = 0;
+
+  /**
+   * @brief Gets the last known content's size.
+   */
+  virtual void GetContentSize( int& width, int& height ) const = 0;
+
+  /**
    * @brief Returns whether forward is possible.
    *
    * @return True if forward is possible, false otherwise
@@ -208,44 +230,6 @@ public:
   virtual void ClearHistory() = 0;
 
   /**
-   * @brief Clears the cache of Web.
-   */
-  virtual void ClearCache() = 0;
-
-  /**
-   * @brief Clears all the cookies of Web.
-   */
-  virtual void ClearCookies() = 0;
-
-  /**
-   * @brief Get cache model option. The default is DOCUMENT_VIEWER.
-   *
-   * @return The cache model option
-   */
-  virtual CacheModel GetCacheModel() const = 0;
-
-  /**
-   * @brief Set cache model option. The default is DOCUMENT_VIEWER.
-   *
-   * @param[in] cacheModel The cache model option
-   */
-  virtual void SetCacheModel(CacheModel cacheModel) = 0;
-
-  /**
-   * @brief Gets the cookie acceptance policy. The default is NO_THIRD_PARTY.
-   *
-   * @return The cookie acceptance policy
-   */
-  virtual CookieAcceptPolicy GetCookieAcceptPolicy() const = 0;
-
-  /**
-   * @brief Sets the cookie acceptance policy. The default is NO_THIRD_PARTY.
-   *
-   * @param[in] policy The cookie acceptance policy
-   */
-  virtual void SetCookieAcceptPolicy(CookieAcceptPolicy policy) = 0;
-
-  /**
    * @brief Get user agent string.
    *
    * @return The string value of user agent
@@ -260,62 +244,6 @@ public:
   virtual void SetUserAgent(const std::string& userAgent) = 0;
 
   /**
-   * @brief Returns whether JavaScript can be executable. The default is true.
-   *
-   * @return true if JavaScript executing is enabled, false otherwise
-   */
-  virtual bool IsJavaScriptEnabled() const = 0;
-
-  /**
-   * @brief Enables/disables JavaScript executing. The default is enabled.
-   *
-   * @param[in] enabled True if JavaScript executing is enabled, false otherwise
-   */
-  virtual void EnableJavaScript(bool enabled) = 0;
-
-  /**
-   * @brief Returns whether images can be loaded automatically. The default is true.
-   *
-   * @return true if images are loaded automatically, false otherwise
-   */
-  virtual bool AreImagesAutomaticallyLoaded() const = 0;
-
-  /**
-   * @brief Enables/disables auto loading of images. The default is enabled.
-   *
-   * @param[in] automatic True if images are loaded automatically, false otherwise
-   */
-  virtual void LoadImagesAutomatically(bool automatic) = 0;
-
-  /**
-   * @brief Gets the default text encoding name (e.g. UTF-8).
-   *
-   * @return The default text encoding name
-   */
-  virtual const std::string& GetDefaultTextEncodingName() const = 0;
-
-  /**
-   * @brief Sets the default text encoding name (e.g. UTF-8).
-   *
-   * @param[in] defaultTextEncodingName The default text encoding name
-   */
-  virtual void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName) = 0;
-
-  /**
-   * @brief Returns the default font size in pixel. The default value is 16.
-   *
-   * @return The default font size
-   */
-  virtual int GetDefaultFontSize() const = 0;
-
-  /**
-   * @brief Sets the default font size in pixel. The default value is 16.
-   *
-   * @param[in] defaultFontSize A new default font size to set
-   */
-  virtual void SetDefaultFontSize(int defaultFontSize) = 0;
-
-  /**
    * @brief Sets size of Web Page.
    */
   virtual void SetSize(int width, int height) = 0;
@@ -331,6 +259,11 @@ public:
   virtual bool SendKeyEvent(const KeyEvent& event) = 0;
 
   /**
+   * @brief Sets focus.
+   */
+  virtual void SetFocus( bool focused ) = 0;
+
+  /**
    * @brief Connects to this signal to be notified when page loading is started.
    *
    * @return A signal object to connect with.
@@ -350,6 +283,13 @@ public:
    * @return A signal object to connect with.
    */
   virtual WebEnginePageLoadErrorSignalType& PageLoadErrorSignal() = 0;
+
+  /**
+   * @brief Connects to this signal to be notified when scroll edge is reached.
+   *
+   * @return A signal object to connect with.
+   */
+  virtual WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal() = 0;
 };
 
 } // namespace Dali