]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/standardpanel.hpp
Qt: rename playlist root* functions and getters for clarity
[vlc] / modules / gui / qt4 / components / playlist / standardpanel.hpp
index d2341305d45f8b1cb2754ac15c4f9763ecc23473..15128dee3d64cb1006ee64a385054378cbf7d4ef 100644 (file)
 #include "qt4.hpp"
 #include "components/playlist/playlist.hpp"
 
-#include <QModelIndex>
 #include <QWidget>
-#include <QString>
-#include <QToolBar>
 
-#include <vlc_playlist.h>
+#include <vlc_playlist.h> /* playlist_item_t */
 
 class QSignalMapper;
-class QTreeView;
-class QListView;
 class PLModel;
-class QPushButton;
+class MLModel;
 class QKeyEvent;
 class QWheelEvent;
+class QStackedLayout;
+class QModelIndex;
+
+class QAbstractItemView;
+class QTreeView;
 class PlIconView;
 class PlListView;
+class PicFlowView;
+
 class LocationBar;
+class PLSelector;
+class PlaylistWidget;
 
 class StandardPLPanel: public QWidget
 {
@@ -55,43 +59,37 @@ class StandardPLPanel: public QWidget
 
 public:
     StandardPLPanel( PlaylistWidget *, intf_thread_t *,
-                     playlist_t *,playlist_item_t * );
+                     playlist_item_t *, PLSelector *, PLModel *, MLModel * );
     virtual ~StandardPLPanel();
-protected:
-    friend class PlaylistWidget;
 
-    virtual void keyPressEvent( QKeyEvent *e );
-    virtual void wheelEvent( QWheelEvent *e );
+    enum { ICON_VIEW = 0,
+           TREE_VIEW ,
+           LIST_VIEW,
+           PICTUREFLOW_VIEW,
+           VIEW_COUNT };
 
-    PLModel *model;
-private:
-    enum {
-      TREE_VIEW = 0,
-      ICON_VIEW,
-      LIST_VIEW,
+    int currentViewIndex() const;
 
-      VIEW_COUNT
-    };
+protected:
+    PLModel *model;
+    MLModel *mlmodel;
+    virtual void wheelEvent( QWheelEvent *e );
 
+private:
     intf_thread_t *p_intf;
 
-    QWidget     *parent;
-    QLabel      *title;
-    QToolButton *addButton;
-    QGridLayout *layout;
-    LocationBar *locationBar;
-    SearchLineEdit *searchEdit;
+    PLSelector  *p_selector;
+
+    QTreeView         *treeView;
+    PlIconView        *iconView;
+    PlListView        *listView;
+    PicFlowView       *picFlowView;
 
-    QTreeView   *treeView;
-    PlIconView  *iconView;
-    PlListView  *listView;
     QAbstractItemView *currentView;
 
-    QAction *viewActions[ VIEW_COUNT ];
-    QAction *iconViewAction, *treeViewAction;
-    int currentRootId;
+    QStackedLayout    *viewStack;
+
     QSignalMapper *selectColumnsSigMapper;
-    QSignalMapper *viewSelectionMapper;
 
     int lastActivatedId;
     int currentRootIndexId;
@@ -99,55 +97,43 @@ private:
     void createTreeView();
     void createIconView();
     void createListView();
+    void createCoverView();
+    void changeModel ( bool b_ml );
+    bool eventFilter ( QObject * watched, QEvent * event );
 
 public slots:
-    void setRoot( playlist_item_t * );
+    void setRootItem( playlist_item_t *, bool );
     void browseInto( const QModelIndex& );
-    void browseInto( );
+
 private slots:
     void deleteSelection();
     void handleExpansion( const QModelIndex& );
-    void handleRootChange();
+    void activate( const QModelIndex & );
+
+    void browseInto();
+    void browseInto( int );
+
     void gotoPlayingItem();
+
     void search( const QString& searchText );
-    void popupAdd();
-    void popupSelectColumn( QPoint );
+    void searchDelayed( const QString& searchText );
+
     void popupPlView( const QPoint & );
+    void popupSelectColumn( QPoint );
     void toggleColumnShown( int );
+
     void showView( int );
     void cycleViews();
-    void activate( const QModelIndex & );
-    void browseInto( input_item_t * );
-};
 
-class LocationBar : public QWidget
-{
-    Q_OBJECT;
-public:
-    LocationBar( PLModel * );
-    void setIndex( const QModelIndex & );
 signals:
-    void invoked( const QModelIndex & );
-public slots:
-    void setRootIndex();
-private slots:
-    void invoke( int i_item_id );
-private:
-    PLModel *model;
-    QSignalMapper *mapper;
-    QHBoxLayout *box;
-    QList<QWidget*> buttons;
+    void viewChanged( const QModelIndex& );
 };
 
-class LocationButton : public QPushButton
-{
-public:
-    LocationButton( const QString &, bool bold, bool arrow );
-private:
-    void paintEvent ( QPaintEvent * event );
-    QSize sizeHint() const;
-    QFontMetrics *metrics;
-    bool b_arrow;
-};
+
+static const QString viewNames[ StandardPLPanel::VIEW_COUNT ]
+                                = { qtr( "Icon View" ),
+                                    qtr( "Detailed View" ),
+                                    qtr( "List View" ),
+                                    qtr( "PictureFlow View ") };
 
 #endif