]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/playlist_model.hpp
Qt4 - Open: Try to repair Open File. Add the beginning of DirectShow.
[vlc] / modules / gui / qt4 / playlist_model.hpp
index 0746183aa1bdb7862c56253ce6fab3f2315ac18a..5909fbc0e11bc94997e2f63bfd6d97d460ba96b7 100644 (file)
 #include <QModelIndex>
 #include <QObject>
 #include <QEvent>
+#include <QMimeData>
+
 #include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_input.h>
 #include <vlc_playlist.h>
 
 class PLModel;
@@ -71,6 +73,7 @@ private:
 static int ItemUpdate_Type = QEvent::User + 2;
 static int ItemDelete_Type = QEvent::User + 3;
 static int ItemAppend_Type = QEvent::User + 4;
+static int PLUpdate_Type = QEvent::User + 5;
 
 class PLEvent : public QEvent
 {
@@ -93,7 +96,8 @@ class PLModel : public QAbstractItemModel
     Q_OBJECT
 
 public:
-    PLModel( playlist_t *, playlist_item_t *, int, QObject *parent = 0);
+    PLModel( playlist_t *, intf_thread_t *,
+             playlist_item_t *, int, QObject *parent = 0);
     ~PLModel();
 
     /* All types of lookups / QModel stuff */
@@ -118,7 +122,19 @@ public:
     /* Actions made by the views */
     void popup( QModelIndex & index, QPoint &point, QModelIndexList list );
     void doDelete( QModelIndexList selected );
+    void search( QString search );
     void sort( int column, Qt::SortOrder order );
+    void removeItem( int );
+
+    /* DnD handling */
+    Qt::DropActions supportedDropActions() const;
+    QMimeData* mimeData(const QModelIndexList &indexes) const;
+    bool dropMimeData(const QMimeData *data, Qt::DropAction action,
+                      int row, int column, const QModelIndex &target);
+    QStringList mimeTypes() const;
+
+    void sendArt( QString url );
+    void removeArt( );
 private:
     void addCallbacks();
     void delCallbacks();
@@ -127,6 +143,7 @@ private:
     PLItem *rootItem;
 
     playlist_t *p_playlist;
+    intf_thread_t *p_intf;
     int i_depth;
 
     static QIcon icons[ITEM_TYPE_NUMBER];
@@ -157,6 +174,9 @@ private:
     PLItem *p_cached_item_bi;
     int i_cached_id;
     int i_cached_input_id;
+signals:
+    void artSet( QString );
+    void shouldRemove( int );
 public slots:
     void activateItem( const QModelIndex &index );
     void activateItem( playlist_item_t *p_item );
@@ -166,6 +186,9 @@ public slots:
 private slots:
     void popupPlay();
     void popupDel();
+    void popupInfo();
+    void popupStream();
+    void popupSave();
 friend class PLItem;
 };