]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/playlist_model.hpp
Improve drag&drop handling
[vlc] / modules / gui / qt4 / playlist_model.hpp
index 119c1f9fc8eacb32bbbc2bb5304303ce7db814b8..c39c27067641404484fdcbedca4b17f89045ddca 100644 (file)
@@ -27,6 +27,8 @@
 #include <QModelIndex>
 #include <QObject>
 #include <QEvent>
+#include <QMimeData>
+
 #include <vlc/vlc.h>
 #include <vlc/input.h>
 #include <vlc_playlist.h>
@@ -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
 {
@@ -118,6 +121,18 @@ 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 );
 private:
     void addCallbacks();
     void delCallbacks();
@@ -156,6 +171,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 );
@@ -165,6 +183,9 @@ public slots:
 private slots:
     void popupPlay();
     void popupDel();
+    void popupInfo();
+    void popupStream();
+    void popupSave();
 friend class PLItem;
 };