Add APIs of webview back forward list 26/253026/12
authorzhouleonlei <zhouleon.lei@samsung.com>
Thu, 4 Feb 2021 03:19:47 +0000 (11:19 +0800)
committerzhouleonlei <zhouleon.lei@samsung.com>
Tue, 6 Apr 2021 06:31:09 +0000 (14:31 +0800)
API added list:
ewk_back_forward_list_previous_item_get
ewk_back_forward_list_next_item_get

Change-Id: I9ace41c545d64831e96a76483bcc5db935238f59

dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h [changed mode: 0644->0755]
dali/devel-api/adaptor-framework/web-engine-back-forward-list.h [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index cc0f82b..0dee5c4
  *
  */
 
-// EXTERNAL INCLUDES
+// INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
+
+// EXTERNAL INCLUDES
 #include <string>
+#include <memory>
+#include <vector>
 
 namespace Dali
 {
@@ -46,14 +50,26 @@ public:
    * @brief Returns the current item in the @a list.
    * @return The item of back-forward list.
    */
-  virtual WebEngineBackForwardListItem& GetCurrentItem() const = 0;
+  virtual std::unique_ptr<Dali::WebEngineBackForwardListItem> GetCurrentItem() const = 0;
+
+  /**
+   * @brief Returns the previous item in the @a list.
+   * @return The previous item of back-forward list.
+   */
+  virtual std::unique_ptr<Dali::WebEngineBackForwardListItem> GetPreviousItem() const = 0;
+
+  /**
+   * @brief Returns the next item in the @a list.
+   * @return The next item of back-forward list.
+   */
+  virtual std::unique_ptr<Dali::WebEngineBackForwardListItem> GetNextItem() const = 0;
 
   /**
    * @brief Returns the item at a given @a index relative to the current item.
    * @param[in] index The index of the item
    * @return The item of back-forward list.
    */
-  virtual WebEngineBackForwardListItem& GetItemAtIndex(uint32_t index) const = 0;
+  virtual std::unique_ptr<Dali::WebEngineBackForwardListItem> GetItemAtIndex(uint32_t index) const = 0;
 
   /**
    * @brief Returns the length of the back-forward list including the current
@@ -62,6 +78,36 @@ public:
    *         otherwise @c 0 in case of an error
    */
   virtual uint32_t GetItemCount() const = 0;
+
+  /**
+   * @brief Creates a list containing the items preceding the current item limited
+   *        by @a limit.
+   *
+   * @details The WebEngineBackForwardListItem elements are located in the result
+              list starting with the oldest one.\n
+   *          If @a limit is equal to @c -1 all the items preceding the current
+   *          item are returned.
+   *
+   * @param[in] limit The number of items to retrieve
+   *
+   * @return @c Dali::Vector containing @c WebEngineBackForwardListItem elements,\n
+   */
+  virtual std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetBackwardItems(int limit) = 0;
+
+  /**
+   * @brief Creates the list containing the items following the current item
+   *        limited by @a limit.
+   *
+   * @details The @c WebEngineBackForwardListItem elements are located in the result
+   *          list starting with the oldest one.\n
+   *          If @a limit is equal to @c -1 all the items preceding the current
+   *          item are returned.
+   *
+   * @param[in] limit The number of items to retrieve
+   *
+   * @return @c Dali::Vector containing @c WebEngineBackForwardListItem elements,\n
+   */
+ virtual std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetForwardItems(int limit) = 0;
 };
 
 } // namespace Dali