]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/panels.hpp
Qt4: move the selector from View/Model to QTreeWidget
[vlc] / modules / gui / qt4 / components / playlist / panels.hpp
index 9bb2c53ad406f42a2fe237cfceaf8412d5f8dd04..d949c40ad23af15df642f82fc44cbe881033b681 100644 (file)
 #ifndef _PLPANELS_H_
 #define _PLPANELS_H_
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "qt4.hpp"
+#include "components/playlist/playlist.hpp"
+
 #include <QModelIndex>
 #include <QWidget>
 #include <QString>
 
+#include <vlc_playlist.h>
+
+class QSignalMapper;
 class QTreeView;
 class PLModel;
 class QPushButton;
-
-/**
- * \todo Share a single model between views using a filterproxy
- */
+class QKeyEvent;
 
 class PLPanel: public QWidget
 {
     Q_OBJECT;
 public:
-    PLPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
+    PLPanel( PlaylistWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
     {
         p_intf = _p_intf;
+        parent = p;
     }
     virtual ~PLPanel() {};
 protected:
     intf_thread_t *p_intf;
+    QFrame *parent;
 public slots:
     virtual void setRoot( int ) = 0;
+    virtual void setRoot( playlist_item_t * ) = 0;
 };
 
 
@@ -57,19 +66,35 @@ class StandardPLPanel: public PLPanel
 {
     Q_OBJECT;
 public:
-    StandardPLPanel( QWidget *, intf_thread_t *,
+    StandardPLPanel( PlaylistWidget *, intf_thread_t *,
                      playlist_t *,playlist_item_t * );
     virtual ~StandardPLPanel();
-private:
+protected:
+    virtual void keyPressEvent( QKeyEvent *e );
+protected:
     PLModel *model;
+    friend class PlaylistWidget;
+private:
     QTreeView *view;
-    QPushButton *repeatButton , *randomButton;
+    QPushButton *repeatButton, *randomButton, *addButton, *gotoPlayingButton;
+    int currentRootId;
+    QSignalMapper *selectColumnsSigMapper;
 public slots:
+    void removeItem( int );
     virtual void setRoot( int );
+    virtual void setRoot( playlist_item_t * );
 private slots:
+    void deleteSelection();
     void handleExpansion( const QModelIndex& );
     void toggleRandom();
     void toggleRepeat();
+    void gotoPlayingItem();
+    void doPopup( QModelIndex index, QPoint point );
+    void search( const QString& searchText );
+    void setCurrentRootId( playlist_item_t * );
+    void popupAdd();
+    void popupSelectColumn( QPoint );
+    void toggleColumnShown( int );
 };
 
 #endif