]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/playlist/ml_item.hpp
Qt: Rework Models.
[vlc] / modules / gui / qt4 / components / playlist / ml_item.hpp
1 /*****************************************************************************
2  * ml_item.hpp: the media library's result item
3  *****************************************************************************
4  * Copyright (C) 2008-2011 the VideoLAN Team and AUTHORS
5  * $Id$
6  *
7  * Authors: Antoine Lejeune <phytos@videolan.org>
8  *          Jean-Philippe André <jpeg@videolan.org>
9  *          Rémi Duraffort <ivoire@videolan.org>
10  *          Adrien Maglo <magsoft@videolan.org>
11  *          Srikanth Raju <srikiraju#gmail#com>
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26  *****************************************************************************/
27
28 #ifndef _MEDIA_LIBRARY_MLITEM_H
29 #define _MEDIA_LIBRARY_MLITEM_H
30
31 #ifdef HAVE_CONFIG_H
32 # include <config.h>
33 #endif
34
35 #ifdef MEDIA_LIBRARY
36
37 #include <vlc_common.h>
38 #include <vlc_interface.h>
39 #include <vlc_media_library.h>
40
41 #include "playlist_item.hpp"
42 #include "ml_model.hpp"
43 #include "qt4.hpp"
44
45 class MLModel;
46
47 class MLItem : public AbstractPLItem
48 {
49     friend class MLModel;
50
51 public:
52     MLItem( intf_thread_t *_p_intf,
53             ml_media_t *p_media, MLItem *p_parent );
54     virtual ~MLItem();
55     bool operator<( MLItem* item );
56
57 private:
58     /* AbstractPLItem */
59     int id( int type );
60     input_item_t *inputItem();
61     AbstractPLItem* child( int row ) const;
62     virtual QUrl getURI() const;
63     virtual QString getTitle() const;
64
65     /* Local */
66     QVariant data( ml_select_e meta ) const;
67     bool setData( ml_select_e meta, const QVariant &data );
68     // Media structure connections
69     ml_media_t* getMedia() const;
70
71     ml_media_t* media;
72     media_library_t* p_ml;
73 };
74
75 #endif
76 #endif