Merge branch 'devel/master' into devel/graphics
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view / web-back-forward-list.h
1 #ifndef DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_H
2 #define DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h>
23 #include <dali-toolkit/public-api/dali-toolkit-common.h>
24
25 namespace Dali
26 {
27 class WebEngineBackForwardList;
28
29 namespace Toolkit
30 {
31 class WebBackForwardListItem;
32
33 /**
34  * @addtogroup dali_toolkit_controls_web_view
35  * @{
36  */
37
38 /**
39  * @brief WebBackForwardList is a class for back-forward list item of WebView.
40  *
41  *
42  * For working WebBackForwardList, a Dali::WebBackForwardList should be provided.
43  *
44  */
45 class DALI_TOOLKIT_API WebBackForwardList
46 {
47 public:
48   /**
49    * @brief Creates a WebBackForwardList.
50    */
51   WebBackForwardList(const Dali::WebEngineBackForwardList& list);
52
53   /**
54    * @brief Destructor.
55    */
56   virtual ~WebBackForwardList() final;
57
58   /**
59    * @brief Returns the current item in the @a list.
60    * @return The current item in list.
61    */
62   WebBackForwardListItem* GetCurrentItem();
63
64   /**
65    * @brief Returns the item at a given @a index relative to the current item.
66    * @param[in] index The index of the item
67    * @return The current item in list.
68    */
69   WebBackForwardListItem* GetItemAtIndex(uint32_t index);
70
71   /**
72    * @brief Returns the length of the back-forward list including the current
73    *        item.
74    * @return The length of the back-forward list including the current item,
75    *         otherwise 0 in case of an error
76    */
77   uint32_t GetItemCount() const;
78
79 private:
80   const Dali::WebEngineBackForwardList& mWebEngineBackForwardList;
81   Dali::Toolkit::WebBackForwardListItem mWebBackForwardListItem;
82 };
83
84 /**
85  * @}
86  */
87
88 } // namespace Toolkit
89
90 } // namespace Dali
91
92 #endif // DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_H