1 /*****************************************************************************
2 * libvlc_internal.h : Definition of opaque structures for libvlc exported API
3 * Also contains some internal utility functions
4 *****************************************************************************
5 * Copyright (C) 2005-2009 the VideoLAN team
8 * Authors: Clément Stenac <zorglub@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef LIBVLC_MEDIA_LIST_VIEW_INTERNAL_H
26 #define LIBVLC_MEDIA_LIST_VIEW_INTERNAL_H 1
33 #include <vlc/libvlc_structures.h>
34 #include <vlc/libvlc_media_list.h>
36 #include <vlc_common.h>
38 typedef libvlc_media_list_view_t * (*libvlc_media_list_view_constructor_func_t)( libvlc_media_list_t * p_mlist, libvlc_exception_t * p_e ) ;
39 typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t * p_mlv ) ;
41 typedef int (*libvlc_media_list_view_count_func_t)( libvlc_media_list_view_t * p_mlv,
42 libvlc_exception_t * ) ;
44 typedef libvlc_media_t *
45 (*libvlc_media_list_view_item_at_index_func_t)(
46 libvlc_media_list_view_t * p_mlv,
48 libvlc_exception_t * ) ;
50 typedef libvlc_media_list_view_t *
51 (*libvlc_media_list_view_children_at_index_func_t)(
52 libvlc_media_list_view_t * p_mlv,
54 libvlc_exception_t * ) ;
56 /* A way to see a media list */
57 struct libvlc_media_list_view_t
59 libvlc_event_manager_t * p_event_manager;
60 libvlc_instance_t * p_libvlc_instance;
62 vlc_mutex_t object_lock;
64 libvlc_media_list_t * p_mlist;
66 struct libvlc_media_list_view_private_t * p_this_view_data;
69 libvlc_media_list_view_count_func_t pf_count;
70 libvlc_media_list_view_item_at_index_func_t pf_item_at_index;
71 libvlc_media_list_view_children_at_index_func_t pf_children_at_index;
73 libvlc_media_list_view_constructor_func_t pf_constructor;
74 libvlc_media_list_view_release_func_t pf_release;
76 /* Notification callback */
77 void (*pf_ml_item_added)(const libvlc_event_t *, libvlc_media_list_view_t *);
78 void (*pf_ml_item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *);
82 libvlc_media_list_view_t * libvlc_media_list_view_new(
83 libvlc_media_list_t * p_mlist,
84 libvlc_media_list_view_count_func_t pf_count,
85 libvlc_media_list_view_item_at_index_func_t pf_item_at_index,
86 libvlc_media_list_view_children_at_index_func_t pf_children_at_index,
87 libvlc_media_list_view_constructor_func_t pf_constructor,
88 libvlc_media_list_view_release_func_t pf_release,
89 void * this_view_data );
91 void libvlc_media_list_view_set_ml_notification_callback(
92 libvlc_media_list_view_t * p_mlv,
93 void (*item_added)(const libvlc_event_t *, libvlc_media_list_view_t *),
94 void (*item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *) );
96 void libvlc_media_list_view_will_delete_item(
97 libvlc_media_list_view_t * p_mlv,
98 libvlc_media_t * p_item, int index );
100 void libvlc_media_list_view_item_deleted(
101 libvlc_media_list_view_t * p_mlv,
102 libvlc_media_t * p_item, int index );
104 void libvlc_media_list_view_will_add_item (
105 libvlc_media_list_view_t * p_mlv,
106 libvlc_media_t * p_item, int index );
108 void libvlc_media_list_view_item_added(
109 libvlc_media_list_view_t * p_mlv,
110 libvlc_media_t * p_item, int index );