1 #ifndef DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_H
2 #define DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_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-back-forward-list-item.h>
27 #include <dali-toolkit/public-api/dali-toolkit-common.h>
31 class WebEngineBackForwardList;
35 class WebBackForwardListItem;
38 * @addtogroup dali_toolkit_controls_web_view
43 * @brief WebBackForwardList is a class for back-forward list item of WebView.
46 * For working WebBackForwardList, a Dali::WebBackForwardList should be provided.
49 class DALI_TOOLKIT_API WebBackForwardList
53 * @brief Creates a WebBackForwardList.
55 WebBackForwardList(Dali::WebEngineBackForwardList& list);
60 virtual ~WebBackForwardList() final;
63 * @brief Returns the current item in the @a list.
64 * @return The current item in list.
66 std::unique_ptr<Dali::WebEngineBackForwardListItem> GetCurrentItem();
69 * @brief Returns the previous item in the @a list.
70 * @return The previous item in list.
72 std::unique_ptr<Dali::WebEngineBackForwardListItem> GetPreviousItem();
75 * @brief Returns the next item in the @a list.
76 * @return The next item in list.
78 std::unique_ptr<Dali::WebEngineBackForwardListItem> GetNextItem();
81 * @brief Returns the item at a given @a index relative to the current item.
82 * @param[in] index The index of the item
83 * @return The current item in list.
85 std::unique_ptr<Dali::WebEngineBackForwardListItem> GetItemAtIndex(uint32_t index);
88 * @brief Returns the length of the back-forward list including the current
90 * @return The length of the back-forward list including the current item,
91 * otherwise 0 in case of an error
93 uint32_t GetItemCount() const;
96 * @brief Creates a list containing the items preceding the current item limited
99 * @details The WebEngineBackForwardListItem elements are located in the result
100 list starting with the oldest one.\n
101 * If @a limit is equal to @c -1 all the items preceding the current
104 * @param[in] limit The number of items to retrieve
106 * @return @c vector containing @c WebEngineBackForwardListItem elements,\n
108 std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetBackwardItems(int limit);
111 * @brief Creates the list containing the items following the current item
112 * limited by @a limit.
114 * @details The @c WebEngineBackForwardListItem elements are located in the result
115 * list starting with the oldest one.\n
116 * If @a limit is equal to @c -1 all the items preceding the current
119 * @param[in] limit The number of items to retrieve
121 * @return @c vector containing @c WebEngineBackForwardListItem elements,\n
123 std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetForwardItems(int limit);
126 Dali::WebEngineBackForwardList& mWebEngineBackForwardList;
133 } // namespace Toolkit
137 #endif // DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_H