]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/playlist/panels.hpp
4654b09e3f44a20476bddefd1c35ce64dd1cc4e9
[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 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include "qt4.hpp"
32 #include "components/playlist/playlist.hpp"
33
34 #include <QModelIndex>
35 #include <QWidget>
36 #include <QString>
37
38 class QSignalMapper;
39 class QTreeView;
40 class PLModel;
41 class QPushButton;
42 class QKeyEvent;
43
44 class PLPanel: public QWidget
45 {
46     Q_OBJECT;
47 public:
48     PLPanel( PlaylistWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
49     {
50         p_intf = _p_intf;
51         parent = p;
52     }
53     virtual ~PLPanel() {};
54 protected:
55     intf_thread_t *p_intf;
56     QFrame *parent;
57 public slots:
58     virtual void setRoot( int ) = 0;
59 };
60
61
62 class StandardPLPanel: public PLPanel
63 {
64     Q_OBJECT;
65 public:
66     StandardPLPanel( PlaylistWidget *, intf_thread_t *,
67                      playlist_t *,playlist_item_t * );
68     virtual ~StandardPLPanel();
69 protected:
70     virtual void keyPressEvent( QKeyEvent *e );
71 protected:
72     PLModel *model;
73     friend class PlaylistWidget;
74 private:
75     QTreeView *view;
76     QPushButton *repeatButton, *randomButton, *addButton, *gotoPlayingButton;
77     int currentRootId;
78     QSignalMapper *selectColumnsSigMapper;
79 public slots:
80     void removeItem( int );
81     virtual void setRoot( int );
82 private slots:
83     void deleteSelection();
84     void handleExpansion( const QModelIndex& );
85     void toggleRandom();
86     void toggleRepeat();
87     void gotoPlayingItem();
88     void doPopup( QModelIndex index, QPoint point );
89     void search( const QString& searchText );
90     void setCurrentRootId( int );
91     void popupAdd();
92     void popupSelectColumn( QPoint );
93     void toggleColumnShown( int );
94 };
95
96 #endif