1 /* 2 Copyright (C) 2009-2010 ProFUSION embedded systems 3 Copyright (C) 2009-2010 Samsung Electronics 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Library General Public 7 License as published by the Free Software Foundation; either 8 version 2 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Library General Public License for more details. 14 15 You should have received a copy of the GNU Library General Public License 16 along with this library; see the file COPYING.LIB. If not, write to 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef ewk_history_h 22 #define ewk_history_h 23 24 #include "ewk_eapi.h" 25 26 #include <Eina.h> 27 #include <Evas.h> 28 #include <cairo.h> 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 /** 35 * @file ewk_history.h 36 * @brief The history (back-forward list) associated with a given ewk_view. 37 * 38 * Changing the history affects immediately the view, changing the 39 * current uri, for example. 40 * 41 * When ewk_view is navigated or uris are set, history automatically 42 * updates. That's why no direct access to history structure is 43 * allowed. 44 */ 45 typedef struct _Ewk_History Ewk_History; 46 47 /** 48 * Represents one item from Ewk_History. 49 */ 50 typedef struct _Ewk_History_Item Ewk_History_Item; 51 52 53 54 EAPI Eina_Bool ewk_history_forward(Ewk_History *history); 55 EAPI Eina_Bool ewk_history_back(Ewk_History *history); 56 57 EAPI Eina_Bool ewk_history_history_item_add(Ewk_History *history, const Ewk_History_Item *item); 58 EAPI Eina_Bool ewk_history_history_item_set(Ewk_History *history, const Ewk_History_Item *item); 59 EAPI Ewk_History_Item *ewk_history_history_item_back_get(const Ewk_History *history); 60 EAPI Ewk_History_Item *ewk_history_history_item_current_get(const Ewk_History *history); 61 EAPI Ewk_History_Item *ewk_history_history_item_forward_get(const Ewk_History *history); 62 EAPI Ewk_History_Item *ewk_history_history_item_nth_get(const Ewk_History *history, int index); 63 EAPI Eina_Bool ewk_history_history_item_contains(const Ewk_History *history, const Ewk_History_Item *item); 64 65 EAPI Eina_List *ewk_history_forward_list_get(const Ewk_History *history); 66 EAPI Eina_List *ewk_history_forward_list_get_with_limit(const Ewk_History *history, int limit); 67 EAPI int ewk_history_forward_list_length(const Ewk_History *history); 68 69 EAPI Eina_List *ewk_history_back_list_get(const Ewk_History *history); 70 EAPI Eina_List *ewk_history_back_list_get_with_limit(const Ewk_History *history, int limit); 71 EAPI int ewk_history_back_list_length(const Ewk_History *history); 72 73 EAPI int ewk_history_limit_get(Ewk_History *history); 74 EAPI Eina_Bool ewk_history_limit_set(const Ewk_History *history, int limit); 75 76 EAPI Ewk_History_Item *ewk_history_item_new(const char *uri, const char *title); 77 EAPI void ewk_history_item_free(Ewk_History_Item *item); 78 EAPI void ewk_history_item_list_free(Eina_List *history_items); 79 80 EAPI const char *ewk_history_item_title_get(const Ewk_History_Item *item); 81 EAPI const char *ewk_history_item_title_alternate_get(const Ewk_History_Item *item); 82 EAPI void ewk_history_item_title_alternate_set(Ewk_History_Item *item, const char *title); 83 EAPI const char *ewk_history_item_uri_get(const Ewk_History_Item *item); 84 EAPI const char *ewk_history_item_uri_original_get(const Ewk_History_Item *item); 85 EAPI double ewk_history_item_time_last_visited_get(const Ewk_History_Item *item); 86 87 EAPI cairo_surface_t *ewk_history_item_icon_surface_get(const Ewk_History_Item *item); 88 EAPI Evas_Object *ewk_history_item_icon_object_add(const Ewk_History_Item *item, Evas *canvas); 89 90 EAPI Eina_Bool ewk_history_item_page_cache_exists(const Ewk_History_Item *item); 91 EAPI int ewk_history_item_visit_count(const Ewk_History_Item *item); 92 EAPI Eina_Bool ewk_history_item_visit_last_failed(const Ewk_History_Item *item); 93 94 #ifdef __cplusplus 95 } 96 #endif 97 #endif // ewk_history_h 98