4104cf267ffbb7a13b4628464006e20aab2776f6
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_back_forward_list.h
1 /*
2  * Copyright (C) 2012 Intel Corporation. All rights reserved.
3  * Copyright (C) 2014 Samsung Electronics. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24  * THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 /**
28  * @file    ewk_back_forward_list.h
29  * @brief   Describes the Ewk Back Forward List API.
30  */
31
32 #ifndef ewk_back_forward_list_h
33 #define ewk_back_forward_list_h
34
35 #include "ewk_back_forward_list_item.h"
36 #include <tizen.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 /** Creates a type name for Ewk_Back_Forward_List */
43 typedef struct _Ewk_Back_Forward_List Ewk_Back_Forward_List;
44
45 /**
46 * Returns the current item in the @a list.
47 *
48 * @param list the back-forward list instance
49 *
50 * @return the current item in the @a list or @c NULL in case of error
51 */
52 EXPORT_API Ewk_Back_Forward_List_Item *ewk_back_forward_list_current_item_get(const Ewk_Back_Forward_List *list);
53
54 /**
55 * Returns the item that precedes the current item in the @a list.
56 *
57 * @param list the back-forward list instance
58 *
59 * @return the item that precedes the current item the @a list or @c NULL in case of error
60 */
61 EXPORT_API Ewk_Back_Forward_List_Item *ewk_back_forward_list_previous_item_get(const Ewk_Back_Forward_List *list);
62
63 /**
64 * Returns the item that follows the current item in the @a list.
65 *
66 * @param list the back-forward list instance
67 *
68 * @return the item that follows the current item in the @a list or @c NULL in case of error
69 */
70 EXPORT_API Ewk_Back_Forward_List_Item *ewk_back_forward_list_next_item_get(const Ewk_Back_Forward_List *list);
71
72 /**
73 * Returns the item at a given @a index relative to the current item.
74 *
75 * @param list the back-forward list instance
76 * @param index the index of the item
77 *
78 * @return the item at a given @a index relative to the current item or @c NULL in case of error
79 */
80 EXPORT_API Ewk_Back_Forward_List_Item *ewk_back_forward_list_item_at_index_get(const Ewk_Back_Forward_List *list, int index);
81
82 /**
83 * Returns the length of the back-forward list including current item.
84 *
85 * @param list the back-forward list instance
86 *
87 * @return the length of the back-forward list including current item or @c 0 in case of error
88 */
89 EXPORT_API unsigned ewk_back_forward_list_count(Ewk_Back_Forward_List *list);
90
91 /**
92 * Creates the list containing the items preceding the current item limited by @a limit.
93 *
94 * The @c Ewk_Back_Forward_List_Item elements are located in the result list starting with the oldest one.
95 * if @a limit is equal to @c -1 all the items preceding the current item are returned.
96 *
97 * @param list the back-forward list instance
98 * @param limit the number of items to retrieve
99 *
100 * @return @c Eina_List containing @c Ewk_Back_Forward_List_Item elements or @c NULL in case of error,
101 *            the Eina_List and its items should be freed after use. Use ewk_back_forward_list_item_unref()
102 *            to free the items
103 */
104 EXPORT_API Eina_List *ewk_back_forward_list_n_back_items_copy(const Ewk_Back_Forward_List *list, int limit);
105
106 /**
107 * Creates the list containing the items following the current item limited by @a limit.
108 *
109 * The @c Ewk_Back_Forward_List_Item elements are located in the result list starting with the oldest one.
110 * if @a limit is equal to @c -1 all the items preceding the current item are returned.
111 *
112 * @param list the back-forward list instance
113 * @param limit the number of items to retrieve
114 *
115 * @return @c Eina_List containing @c Ewk_Back_Forward_List_Item elements or @c NULL in case of error,
116 *            the Eina_List and its items should be freed after use. Use ewk_back_forward_list_item_unref()
117 *            to free the items
118 */
119 EXPORT_API Eina_List *ewk_back_forward_list_n_forward_items_copy(const Ewk_Back_Forward_List *list, int limit);
120
121 /**
122 * Creates the list containing the items preceding the current item.
123 *
124 * The @c Ewk_Back_Forward_List_Item elements are located in the result list starting with the oldest one.
125 *
126 * @param list the back-forward list instance
127 *
128 * @return @c Eina_List containing @c Ewk_Back_Forward_List_Item elements or @c NULL in case of error,
129 *            the Eina_List and its items should be freed after use. Use ewk_back_forward_list_item_unref()
130 *            to free the items
131 *
132 * @see ewk_back_forward_list_n_back_items_copy
133 */
134 #define ewk_back_forward_list_back_items_copy(list) \
135    ewk_back_forward_list_n_back_items_copy(list, -1)
136
137 /**
138 * Creates the list containing the items following the current item.
139 *
140 * The @c Ewk_Back_Forward_List_Item elements are located in the result list starting with the oldest one.
141 *
142 * @param list the back-forward list instance
143 *
144 * @return @c Eina_List containing @c Ewk_Back_Forward_List_Item elements or @c NULL in case of error,
145 *            the Eina_List and its items should be freed after use. Use ewk_back_forward_list_item_unref()
146 *            to free the items
147 *
148 * @see ewk_back_forward_list_n_forward_items_copy
149 */
150 #define ewk_back_forward_list_forward_items_copy(list) \
151    ewk_back_forward_list_n_forward_items_copy(list, -1)
152
153 #ifdef __cplusplus
154 }
155 #endif
156
157 #endif // ewk_back_forward_list_h
158