panels.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * panels.hpp : Panels for the playlist
00003  ****************************************************************************
00004  * Copyright (C) 2000-2005 the VideoLAN team
00005  * $Id: 89491796c403038339b0f626a3bf8870afa5be6e $
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 _PLPANELS_H_
00025 #define _PLPANELS_H_
00026 
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030 
00031 #include "qt4.hpp"
00032 #include "components/playlist/playlist.hpp"
00033 
00034 #include <QModelIndex>
00035 #include <QWidget>
00036 #include <QString>
00037 
00038 #include <vlc_playlist.h>
00039 
00040 class QSignalMapper;
00041 class QTreeView;
00042 class PLModel;
00043 class QPushButton;
00044 class QKeyEvent;
00045 
00046 class PLPanel: public QWidget
00047 {
00048     Q_OBJECT;
00049 public:
00050     PLPanel( PlaylistWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
00051     {
00052         p_intf = _p_intf;
00053         parent = p;
00054     }
00055     virtual ~PLPanel() {};
00056 protected:
00057     intf_thread_t *p_intf;
00058     QFrame *parent;
00059 public slots:
00060     virtual void setRoot( playlist_item_t * ) = 0;
00061 };
00062 
00063 
00064 class StandardPLPanel: public PLPanel
00065 {
00066     Q_OBJECT;
00067 public:
00068     StandardPLPanel( PlaylistWidget *, intf_thread_t *,
00069                      playlist_t *,playlist_item_t * );
00070     virtual ~StandardPLPanel();
00071 protected:
00072     virtual void keyPressEvent( QKeyEvent *e );
00073 protected:
00074     PLModel *model;
00075     friend class PlaylistWidget;
00076 private:
00077     QLabel *title;
00078     QTreeView *view;
00079     QPushButton *repeatButton, *randomButton, *addButton, *gotoPlayingButton;
00080     int currentRootId;
00081     QSignalMapper *selectColumnsSigMapper;
00082 public slots:
00083     void removeItem( int );
00084     virtual void setRoot( playlist_item_t * );
00085 private slots:
00086     void deleteSelection();
00087     void handleExpansion( const QModelIndex& );
00088     void toggleRandom();
00089     void toggleRepeat();
00090     void gotoPlayingItem();
00091     void doPopup( QModelIndex index, QPoint point );
00092     void search( const QString& searchText );
00093     void popupAdd();
00094     void popupSelectColumn( QPoint );
00095     void toggleColumnShown( int );
00096 };
00097 
00098 #endif

Generated on Wed Mar 31 08:05:23 2010 for VLC by  doxygen 1.5.6