playlist_item.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * playlist_item.hpp : Item for a playlist tree
00003  ****************************************************************************
00004  * Copyright (C) 2006 the VideoLAN team
00005  * $Id: 6caafcb9a776558da0a208a05410e9b60b4f3042 $
00006  *
00007  * Authors: Clément Stenac <zorglub@videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef _PLAYLIST_ITEM_H_
00025 #define _PLAYLIST_ITEM_H_
00026 
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030 
00031 #include <QList>
00032 
00033 
00034 class PLItem
00035 {
00036     friend class PLModel;
00037 public:
00038     PLItem( playlist_item_t *, PLItem *parent );
00039     PLItem( playlist_item_t * );
00040     ~PLItem();
00041 
00042     int row() const;
00043 
00044     void insertChild( PLItem *, int p, bool signal = true );
00045     void appendChild( PLItem *item, bool signal = true )
00046     {
00047         children.insert( children.count(), item );
00048     };
00049     void removeChild( PLItem * );
00050     void removeChildren();
00051     void takeChildAt( int );
00052 
00053     PLItem *child( int row ) { return children.value( row ); }
00054     int childCount() const { return children.count(); }
00055 
00056     PLItem *parent() { return parentItem; }
00057     input_item_t *inputItem() { return p_input; }
00058     int id() { return i_id; }
00059     bool operator< ( PLItem& );
00060 
00061 protected:
00062     QList<PLItem*> children;
00063     int i_id;
00064     input_item_t *p_input;
00065 
00066 private:
00067     void init( playlist_item_t *, PLItem * );
00068     PLItem *parentItem;
00069 };
00070 
00071 #endif
00072 

Generated on Tue May 25 08:04:57 2010 for VLC by  doxygen 1.5.6