Merge "Implement some new ewk apis in web view." into devel/master
[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) 2020 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
28 class WebEngineBackForwardList;
29
30 namespace Toolkit
31 {
32 class WebBackForwardListItem;
33
34 /**
35  * @addtogroup dali_toolkit_controls_web_view
36  * @{
37  */
38
39 /**
40  * @brief WebBackForwardList is a class for back-forward list item of WebView.
41  *
42  *
43  * For working WebBackForwardList, a Dali::WebBackForwardList should be provided.
44  *
45  */
46 class DALI_TOOLKIT_API WebBackForwardList
47 {
48 public:
49   /**
50    * @brief Creates a WebBackForwardList.
51    */
52   WebBackForwardList( const Dali::WebEngineBackForwardList& list );
53
54   /**
55    * @brief Destructor.
56    */
57   virtual ~WebBackForwardList() final;
58
59   /**
60    * @brief Returns the current item in the @a list.
61    * @return The current item in list.
62    */
63   WebBackForwardListItem* GetCurrentItem();
64
65   /**
66    * @brief Returns the item at a given @a index relative to the current item.
67    * @param[in] index The index of the item
68    * @return The current item in list.
69    */
70   WebBackForwardListItem* GetItemAtIndex(uint32_t index);
71
72   /**
73    * @brief Returns the length of the back-forward list including the current
74    *        item.
75    * @return The length of the back-forward list including the current item,
76    *         otherwise 0 in case of an error
77    */
78   uint32_t GetItemCount() const;
79
80 private:
81   const Dali::WebEngineBackForwardList&  mWebEngineBackForwardList;
82   Dali::Toolkit::WebBackForwardListItem mWebBackForwardListItem;
83
84 };
85
86 /**
87  * @}
88  */
89
90 } // namespace Toolkit
91
92 } // namespace Dali
93
94 #endif // DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_H