]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/playlist/panels.hpp
3af5d0cdfa837086ec3fcee999cb4a113ac449cf
[vlc] / modules / gui / qt4 / components / playlist / panels.hpp
1 /*****************************************************************************
2  * panels.hpp : Panels for the playlist
3  ****************************************************************************
4  * Copyright (C) 2000-2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _PLPANELS_H_
25 #define _PLPANELS_H_
26
27 #include <vlc/vlc.h>
28 #include <QModelIndex>
29 #include <QWidget>
30 #include <QString>
31
32 class QTreeView;
33 class PLModel;
34 class QPushButton;
35 class QKeyEvent;
36
37 class PLPanel: public QWidget
38 {
39     Q_OBJECT;
40 public:
41     PLPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
42     {
43         p_intf = _p_intf;
44     }
45     virtual ~PLPanel() {};
46 protected:
47     intf_thread_t *p_intf;
48 public slots:
49     virtual void setRoot( int ) = 0;
50 };
51
52
53 class StandardPLPanel: public PLPanel
54 {
55     Q_OBJECT;
56 public:
57     StandardPLPanel( QWidget *, intf_thread_t *,
58                      playlist_t *,playlist_item_t * );
59     virtual ~StandardPLPanel();
60 protected:
61     virtual void keyPressEvent( QKeyEvent *e );
62 private:
63     PLModel *model;
64     QTreeView *view;
65     QPushButton *repeatButton , *randomButton;
66 public slots:
67     virtual void setRoot( int );
68 private slots:
69     void deleteSelection();
70     void handleExpansion( const QModelIndex& );
71     void toggleRandom();
72     void toggleRepeat();
73     void doPopup( QModelIndex index, QPoint point );
74 };
75
76 #endif