media_list_view_internal.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * libvlc_internal.h : Definition of opaque structures for libvlc exported API
00003  * Also contains some internal utility functions
00004  *****************************************************************************
00005  * Copyright (C) 2005-2009 the VideoLAN team
00006  * $Id: b45347889a812d05257bf744745423bcd307146e $
00007  *
00008  * Authors: Clément Stenac <zorglub@videolan.org>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef LIBVLC_MEDIA_LIST_VIEW_INTERNAL_H
00026 #define LIBVLC_MEDIA_LIST_VIEW_INTERNAL_H 1
00027 
00028 #ifdef HAVE_CONFIG_H
00029 # include "config.h"
00030 #endif
00031 
00032 #include <vlc/vlc.h>
00033 #include <vlc/libvlc_structures.h>
00034 #include <vlc/libvlc_media_list.h>
00035 
00036 #include <vlc_common.h>
00037 
00038 typedef libvlc_media_list_view_t * (*libvlc_media_list_view_constructor_func_t)( libvlc_media_list_t * p_mlist, libvlc_exception_t * p_e ) ;
00039 typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t * p_mlv ) ;
00040 
00041 typedef int (*libvlc_media_list_view_count_func_t)( libvlc_media_list_view_t * p_mlv,
00042         libvlc_exception_t * ) ;
00043 
00044 typedef libvlc_media_t *
00045         (*libvlc_media_list_view_item_at_index_func_t)(
00046                 libvlc_media_list_view_t * p_mlv,
00047                 int index,
00048                 libvlc_exception_t * ) ;
00049 
00050 typedef libvlc_media_list_view_t *
00051         (*libvlc_media_list_view_children_at_index_func_t)(
00052                 libvlc_media_list_view_t * p_mlv,
00053                 int index,
00054                 libvlc_exception_t * ) ;
00055 
00056 /* A way to see a media list */
00057 struct libvlc_media_list_view_t
00058 {
00059     libvlc_event_manager_t *    p_event_manager;
00060     libvlc_instance_t *         p_libvlc_instance;
00061     int                         i_refcount;
00062     vlc_mutex_t                 object_lock;
00063 
00064     libvlc_media_list_t *       p_mlist;
00065 
00066     struct libvlc_media_list_view_private_t * p_this_view_data;
00067 
00068     /* Accessors */
00069     libvlc_media_list_view_count_func_t              pf_count;
00070     libvlc_media_list_view_item_at_index_func_t      pf_item_at_index;
00071     libvlc_media_list_view_children_at_index_func_t  pf_children_at_index;
00072 
00073     libvlc_media_list_view_constructor_func_t        pf_constructor;
00074     libvlc_media_list_view_release_func_t            pf_release;
00075 
00076     /* Notification callback */
00077     void (*pf_ml_item_added)(const libvlc_event_t *, libvlc_media_list_view_t *);
00078     void (*pf_ml_item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *);
00079 };
00080 
00081 /* Media List View */
00082 libvlc_media_list_view_t * libvlc_media_list_view_new(
00083         libvlc_media_list_t * p_mlist,
00084         libvlc_media_list_view_count_func_t pf_count,
00085         libvlc_media_list_view_item_at_index_func_t pf_item_at_index,
00086         libvlc_media_list_view_children_at_index_func_t pf_children_at_index,
00087         libvlc_media_list_view_constructor_func_t pf_constructor,
00088         libvlc_media_list_view_release_func_t pf_release,
00089         void * this_view_data,
00090         libvlc_exception_t * p_e );
00091 
00092 void libvlc_media_list_view_set_ml_notification_callback(
00093         libvlc_media_list_view_t * p_mlv,
00094         void (*item_added)(const libvlc_event_t *, libvlc_media_list_view_t *),
00095         void (*item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *) );
00096 
00097 void libvlc_media_list_view_will_delete_item(
00098         libvlc_media_list_view_t * p_mlv,
00099         libvlc_media_t * p_item, int index );
00100 
00101 void libvlc_media_list_view_item_deleted(
00102         libvlc_media_list_view_t * p_mlv,
00103         libvlc_media_t * p_item, int index );
00104 
00105 void libvlc_media_list_view_will_add_item (
00106         libvlc_media_list_view_t * p_mlv,
00107         libvlc_media_t * p_item, int index );
00108 
00109 void libvlc_media_list_view_item_added(
00110         libvlc_media_list_view_t * p_mlv,
00111         libvlc_media_t * p_item, int index );
00112 
00113 #endif

Generated on Sun Nov 22 08:05:23 2009 for VLC by  doxygen 1.5.6