2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
3 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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.
28 * @file ewk_back_forward_list.h
29 * @brief Describes the Ewk Back Forward List API.
32 #ifndef ewk_back_forward_list_h
33 #define ewk_back_forward_list_h
35 #include "ewk_back_forward_list_item.h"
42 /** Creates a type name for Ewk_Back_Forward_List */
43 typedef struct _Ewk_Back_Forward_List Ewk_Back_Forward_List;
46 * Returns the current item in the @a list.
48 * @param list the back-forward list instance
50 * @return the current item in the @a list or @c NULL in case of error
52 EXPORT_API Ewk_Back_Forward_List_Item *ewk_back_forward_list_current_item_get(const Ewk_Back_Forward_List *list);
55 * Returns the item that precedes the current item in the @a list.
57 * @param list the back-forward list instance
59 * @return the item that precedes the current item the @a list or @c NULL in case of error
61 EXPORT_API Ewk_Back_Forward_List_Item *ewk_back_forward_list_previous_item_get(const Ewk_Back_Forward_List *list);
64 * Returns the item that follows the current item in the @a list.
66 * @param list the back-forward list instance
68 * @return the item that follows the current item in the @a list or @c NULL in case of error
70 EXPORT_API Ewk_Back_Forward_List_Item *ewk_back_forward_list_next_item_get(const Ewk_Back_Forward_List *list);
73 * Returns the item at a given @a index relative to the current item.
75 * @param list the back-forward list instance
76 * @param index the index of the item
78 * @return the item at a given @a index relative to the current item or @c NULL in case of error
80 EXPORT_API Ewk_Back_Forward_List_Item *ewk_back_forward_list_item_at_index_get(const Ewk_Back_Forward_List *list, int index);
83 * Returns the length of the back-forward list including current item.
85 * @param list the back-forward list instance
87 * @return the length of the back-forward list including current item or @c 0 in case of error
89 EXPORT_API unsigned ewk_back_forward_list_count(Ewk_Back_Forward_List *list);
92 * Creates the list containing the items preceding the current item limited by @a limit.
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.
97 * @param list the back-forward list instance
98 * @param limit the number of items to retrieve
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()
104 EXPORT_API Eina_List *ewk_back_forward_list_n_back_items_copy(const Ewk_Back_Forward_List *list, int limit);
107 * Creates the list containing the items following the current item limited by @a limit.
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.
112 * @param list the back-forward list instance
113 * @param limit the number of items to retrieve
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()
119 EXPORT_API Eina_List *ewk_back_forward_list_n_forward_items_copy(const Ewk_Back_Forward_List *list, int limit);
122 * Creates the list containing the items preceding the current item.
124 * The @c Ewk_Back_Forward_List_Item elements are located in the result list starting with the oldest one.
126 * @param list the back-forward list instance
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()
132 * @see ewk_back_forward_list_n_back_items_copy
134 #define ewk_back_forward_list_back_items_copy(list) \
135 ewk_back_forward_list_n_back_items_copy(list, -1)
138 * Creates the list containing the items following the current item.
140 * The @c Ewk_Back_Forward_List_Item elements are located in the result list starting with the oldest one.
142 * @param list the back-forward list instance
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()
148 * @see ewk_back_forward_list_n_forward_items_copy
150 #define ewk_back_forward_list_forward_items_copy(list) \
151 ewk_back_forward_list_n_forward_items_copy(list, -1)
157 #endif // ewk_back_forward_list_h