Qt: kill a bunch of warnings
[vlc/vlc-skelet.git] / modules / gui / qt4 / components / playlist / ml_item.hpp
blob6c781f425156e19d27b01a95c8f70e231abd25b6
1 /*****************************************************************************
2 * ml_item.hpp: the media library's result item
3 *****************************************************************************
4 * Copyright (C) 2008-2011 the VideoLAN Team and AUTHORS
5 * $Id$
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>
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.
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.
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 *****************************************************************************/
28 #ifndef _MEDIA_LIBRARY_MLITEM_H
29 #define _MEDIA_LIBRARY_MLITEM_H
31 #ifdef HAVE_CONFIG_H
32 # include <config.h>
33 #endif
35 #ifdef MEDIA_LIBRARY
37 #include <vlc_common.h>
38 #include <vlc_interface.h>
39 #include <vlc_media_library.h>
41 #include "ml_model.hpp"
42 #include "qt4.hpp"
44 class MLModel;
46 class MLItem
48 public:
49 MLItem( const MLModel *p_model, intf_thread_t *_p_intf,
50 ml_media_t *p_media, MLItem *p_parent );
51 virtual ~MLItem();
53 void addChild( MLItem *child, int row = -1 );
54 void delChild( int row );
55 void clearChildren();
57 MLItem* child( int row ) const;
58 int childCount() const;
60 MLItem* parent() const;
62 QVariant data( int column ) const;
63 bool setData( ml_select_e meta, const QVariant &data );
65 int rowOfChild( MLItem *item ) const;
67 // Media structure connections
68 int id() const;
69 ml_media_t* getMedia() const;
70 QUrl getUri() const;
72 bool operator<( MLItem* item );
74 private:
75 ml_media_t* media;
76 intf_thread_t* p_intf;
77 const MLModel *model;
78 media_library_t* p_ml;
79 QList< MLItem* > children;
80 MLItem *parentItem;
83 #endif
84 #endif