]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/playlist.hpp
Qt: use a QStackedWidget for the artContainer in the playlist
[vlc] / modules / gui / qt4 / components / playlist / playlist.hpp
index 2b793b76d2c5e73dbfdd7c7421cd0ea7faa92eb8..ae38a279a87a68966c0de59a9d4a1c88e7cbcf8f 100644 (file)
 
 #include "qt4.hpp"
 
-#include "dialogs_provider.hpp"              /* Media Info from ArtLabel */
-#include "components/interface_widgets.hpp"  /* CoverArt */
 //#include <vlc_playlist.h>
 
 #include <QSplitter>
 
-class PLSelector;
-class StandardPLPanel;
-class QPushButton;
+#include <QPushButton>
+#include <QSplitterHandle>
+#include <QMouseEvent>
 
-class ArtLabel : public CoverArtLabel
-{
-public:
-    ArtLabel( QWidget *parent, intf_thread_t *intf )
-            : CoverArtLabel( parent, intf ) {}
-
-    virtual void mouseDoubleClickEvent( QMouseEvent *event )
-    {
-        THEDP->mediaInfoDialog();
-        event->accept();
-    }
-};
+class StandardPLPanel;
+class LocationBar;
+class QSignalMapper;
+class SearchLineEdit;
+class QModelIndex;
+class QStackedWidget;
 
-class PlaylistWidget : public QSplitter
+class PlaylistWidget : public QWidget
 {
     Q_OBJECT
 public:
     PlaylistWidget( intf_thread_t *_p_i, QWidget * );
     virtual ~PlaylistWidget();
+
     void forceHide();
     void forceShow();
+    QStackedWidget *artContainer;
 private:
-    PLSelector      *selector;
-    ArtLabel        *art;
-    StandardPLPanel *rightPanel;
-    QPushButton     *addButton;
-    QSplitter       *leftSplitter;
-protected:
+    QSplitter            *leftSplitter;
+    QSplitter            *split;
+    StandardPLPanel      *mainView;
+
+    QAction *viewActions[ 4 /* StandardPLPanel::VIEW_COUNT*/ ];
+
+    LocationBar          *locationBar;
+    SearchLineEdit       *searchEdit;
+
     intf_thread_t *p_intf;
+
+protected:
     virtual void dropEvent( QDropEvent *);
     virtual void dragEnterEvent( QDragEnterEvent * );
     virtual void closeEvent( QCloseEvent * );
+private slots:
+    void changeView( const QModelIndex& index );
+};
 
+#ifdef Q_WS_MAC
+class PlaylistSplitter : public QSplitter
+{
+public:
+    PlaylistSplitter( QWidget *_parent ) : QSplitter( _parent ){}
+protected:
+    virtual QSplitterHandle *createHandle();
 };
+#else
+ #define PlaylistSplitter QSplitter
+#endif
+
+#ifdef Q_WS_MAC
+class SplitterHandle : public QSplitterHandle
+{
+public:
+    SplitterHandle( Qt::Orientation orientation, QSplitter * parent );
+
+protected:
+    virtual void paintEvent ( QPaintEvent * );
+
+private:
+    virtual QSize sizeHint () const;
+};
+#endif /* __APPLE__ */
+
+class LocationButton : public QPushButton
+{
+public:
+    LocationButton( const QString &, bool bold, bool arrow, QWidget * parent = NULL );
+    virtual QSize sizeHint() const;
+protected:
+    virtual void paintEvent ( QPaintEvent * event );
+private:
+    bool b_arrow;
+};
+
+class PLModel;
+class QHBoxLayout;
+class LocationBar : public QWidget
+{
+    Q_OBJECT
+public:
+    LocationBar( PLModel * );
+    void setIndex( const QModelIndex & );
+    virtual QSize sizeHint() const;
+protected:
+    virtual void resizeEvent ( QResizeEvent * event );
+
+private:
+    void layOut( const QSize& size );
+
+    PLModel *model;
+    QSignalMapper *mapper;
+    QWidgetList buttons;
+    QList<QAction*> actions;
+    LocationButton *btnMore;
+    QMenu *menuMore;
+    QList<int> widths;
+
+public slots:
+    void setRootIndex();
+private slots:
+    void invoke( int i_item_id );
+
+signals:
+    void invoked( const QModelIndex & );
+};
+
 
 #endif