(Canvas Renderer) Moved Devel Headers into sub-folder to improve SAM score
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine-back-forward-list.h
1 #ifndef DALI_WEB_ENGINE_BACK_FORWARD_LIST_H
2 #define DALI_WEB_ENGINE_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/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
23
24 // EXTERNAL INCLUDES
25 #include <string>
26 #include <memory>
27 #include <vector>
28
29 namespace Dali
30 {
31 class WebEngineBackForwardListItem;
32
33 /**
34  * @brief A class WebBackForwardList for back forward list of web engine.
35  */
36 class WebEngineBackForwardList
37 {
38 public:
39   /**
40    * @brief Constructor.
41    */
42   WebEngineBackForwardList() = default;
43
44   /**
45    * @brief Destructor.
46    */
47   virtual ~WebEngineBackForwardList() = default;
48
49   /**
50    * @brief Returns the current item in the @a list.
51    * @return The item of back-forward list.
52    */
53   virtual std::unique_ptr<Dali::WebEngineBackForwardListItem> GetCurrentItem() const = 0;
54
55   /**
56    * @brief Returns the previous item in the @a list.
57    * @return The previous item of back-forward list.
58    */
59   virtual std::unique_ptr<Dali::WebEngineBackForwardListItem> GetPreviousItem() const = 0;
60
61   /**
62    * @brief Returns the next item in the @a list.
63    * @return The next item of back-forward list.
64    */
65   virtual std::unique_ptr<Dali::WebEngineBackForwardListItem> GetNextItem() const = 0;
66
67   /**
68    * @brief Returns the item at a given @a index relative to the current item.
69    * @param[in] index The index of the item
70    * @return The item of back-forward list.
71    */
72   virtual std::unique_ptr<Dali::WebEngineBackForwardListItem> GetItemAtIndex(uint32_t index) const = 0;
73
74   /**
75    * @brief Returns the length of the back-forward list including the current
76    *        item.
77    * @return The length of the back-forward list including the current item,
78    *         otherwise @c 0 in case of an error
79    */
80   virtual uint32_t GetItemCount() const = 0;
81
82   /**
83    * @brief Creates a list containing the items preceding the current item limited
84    *        by @a limit.
85    *
86    * @details The WebEngineBackForwardListItem elements are located in the result
87               list starting with the oldest one.\n
88    *          If @a limit is equal to @c -1 all the items preceding the current
89    *          item are returned.
90    *
91    * @param[in] limit The number of items to retrieve
92    *
93    * @return @c Dali::Vector containing @c WebEngineBackForwardListItem elements,\n
94    */
95   virtual std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetBackwardItems(int limit) = 0;
96
97   /**
98    * @brief Creates the list containing the items following the current item
99    *        limited by @a limit.
100    *
101    * @details The @c WebEngineBackForwardListItem elements are located in the result
102    *          list starting with the oldest one.\n
103    *          If @a limit is equal to @c -1 all the items preceding the current
104    *          item are returned.
105    *
106    * @param[in] limit The number of items to retrieve
107    *
108    * @return @c Dali::Vector containing @c WebEngineBackForwardListItem elements,\n
109    */
110  virtual std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> GetForwardItems(int limit) = 0;
111 };
112
113 } // namespace Dali
114
115 #endif // DALI_WEB_ENGINE_BACK_FORWARD_LIST_H