#include "qt4.hpp"
#include "components/playlist/playlist.hpp"
-#include <QModelIndex>
#include <QWidget>
-#include <QString>
-#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
{
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 };
- bool eventFilter(QObject *obj, QEvent *event);
+ int currentViewIndex() const;
+protected:
PLModel *model;
+ MLModel *mlmodel;
+ virtual void wheelEvent( QWheelEvent *e );
+
private:
intf_thread_t *p_intf;
- QWidget *parent;
- QLabel *title;
- QPushButton *addButton;
- QGridLayout *layout;
+ PLSelector *p_selector;
+
+ QTreeView *treeView;
+ PlIconView *iconView;
+ PlListView *listView;
+ PicFlowView *picFlowView;
+
+ QAbstractItemView *currentView;
- QTreeView *treeView;
- PlIconView *iconView;
+ QStackedLayout *viewStack;
- int currentRootId;
QSignalMapper *selectColumnsSigMapper;
- void doPopup( QModelIndex index, QPoint point );
+ int lastActivatedId;
+ int currentRootIndexId;
+
+ void createTreeView();
+ void createIconView();
+ void createListView();
+ void createCoverView();
+ void changeModel ( bool b_ml );
+ bool eventFilter ( QObject * watched, QEvent * event );
+
public slots:
- void removeItem( int );
- virtual void setRoot( playlist_item_t * );
+ void setRootItem( playlist_item_t *, bool );
+ void browseInto( const QModelIndex& );
+
private slots:
void deleteSelection();
void handleExpansion( const QModelIndex& );
+ void activate( const QModelIndex & );
+
+ void browseInto();
+ void browseInto( int );
+
void gotoPlayingItem();
+
void search( const QString& searchText );
- void popupAdd();
+ void searchDelayed( const QString& searchText );
+
+ void popupPlView( const QPoint & );
void popupSelectColumn( QPoint );
void toggleColumnShown( int );
- void toggleView();
- void playlistPopup( const QPoint & );
+
+ void showView( int );
+ void cycleViews();
+
+signals:
+ void viewChanged( const QModelIndex& );
};
+
+static const QString viewNames[ StandardPLPanel::VIEW_COUNT ]
+ = { qtr( "Icon View" ),
+ qtr( "Detailed View" ),
+ qtr( "List View" ),
+ qtr( "PictureFlow View ") };
+
#endif