]> git.sesse.net Git - vlc/blob - modules/gui/skins2/vars/playtree.hpp
Improve ensureVisible
[vlc] / modules / gui / skins2 / vars / playtree.hpp
1 /*****************************************************************************
2  * playtree.hpp
3  *****************************************************************************
4  * Copyright (C) 2005 VideoLAN
5  * $Id$
6  *
7  * Authors: Antoine Cellerier <dionoea@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #ifndef PLAYTREE_HPP
25 #define PLAYTREE_HPP
26
27 #include "../utils/var_tree.hpp"
28
29 /// Variable for VLC playlist (new tree format)
30 class Playtree: public VarTree
31 {
32     public:
33         Playtree( intf_thread_t *pIntf );
34         virtual ~Playtree();
35
36         /// Remove the selected elements from the list
37         virtual void delSelected();
38
39         /// Execute the action associated to this item
40         virtual void action( VarTree *pItem );
41
42         /// Function called to notify playlist changes
43         void onChange();
44
45         /// Function called to notify playlist item update
46         void onUpdateItem( int id );
47
48         /// Function called to notify playlist item  append
49         void onAppend( playlist_add_t * );
50
51         /// Items waiting to be appended
52         int i_items_to_append;
53
54     private:
55         /// VLC playlist object
56         playlist_t *m_pPlaylist;
57         /// Iconv handle
58         vlc_iconv_t iconvHandle;
59
60         /// Build the list from the VLC playlist
61         void buildTree();
62
63         /// Update Node's children
64         void buildNode( playlist_item_t *p_node, VarTree &m_pNode );
65 };
66
67 #endif