00001 /***************************************************************************** 00002 * history.h: vlc_history_t (web-browser-like back/forward history) handling 00003 ***************************************************************************** 00004 * Copyright (C) 2004 Commonwealth Scientific and Industrial Research 00005 * Organisation (CSIRO) Australia 00006 * Copyright (C) 2004 the VideoLAN team 00007 * 00008 * $Id: history.h 11664 2005-07-09 06:17:09Z courmisch $ 00009 * 00010 * Authors: Andre Pang <[email protected]> 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU General Public License as published by 00014 * the Free Software Foundation; either version 2 of the License, or 00015 * (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 00025 *****************************************************************************/ 00026 00027 #ifndef __VLC_HISTORY_H__ 00028 #define __VLC_HISTORY_H__ 00029 00030 #define XARRAY_EMBED_IN_HOST_C_FILE 00031 #include "xarray.h" 00032 00033 struct history_item_t 00034 { 00035 char * psz_name; 00036 char * psz_uri; 00037 }; 00038 00039 struct history_t 00040 { 00041 unsigned int i_index; /* current index into history */ 00042 XArray * p_xarray; 00043 }; 00044 00045 typedef struct history_item_t history_item_t; 00046 typedef struct history_t history_t; 00047 00048 00049 /***************************************************************************** 00050 * Exported prototypes 00051 *****************************************************************************/ 00052 history_t * history_New (); 00053 vlc_bool_t history_GoBackSavingCurrentItem ( history_t *, 00054 history_item_t * ); 00055 vlc_bool_t history_GoForwardSavingCurrentItem ( history_t *, 00056 history_item_t * ); 00057 vlc_bool_t history_CanGoBack ( history_t * ); 00058 vlc_bool_t history_CanGoForward ( history_t * ); 00059 history_item_t * history_Item ( history_t * ); 00060 void history_Prune ( history_t * ); 00061 void history_PruneAndInsert ( history_t *, 00062 history_item_t * ); 00063 unsigned int history_Count ( history_t * ); 00064 unsigned int history_Index ( history_t * ); 00065 00066 history_item_t * historyItem_New ( char *, char * ); 00067 00068 #endif /* __VLC_HISTORY_H__ */ 00069