]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/playlist_model.hpp
Preliminary deletion support
[vlc] / modules / gui / qt4 / playlist_model.hpp
index 000034d56cfb1ea98206858ba462ec5bf3d47f65..615934cd94862eb6dc0a89aa7d1f763b1a7a03b7 100644 (file)
@@ -46,15 +46,18 @@ public:
     {
         insertChild( item, children.count(), signal );
     };
+    void remove( PLItem *removed );
     PLItem *child( int row ) { return children.value( row ); };
     int childCount() const { return children.count(); };
     QString columnString( int col ) { return strings.value( col ); };
     PLItem *parent() { return parentItem; };
 
-    void update( playlist_item_t *);
+    void update( playlist_item_t *, bool);
 protected:
     QList<PLItem*> children;
     QList<QString> strings;
+    bool current;
+    int type;
     int i_id;
     int i_input_id;
     friend class PLModel;
@@ -104,6 +107,7 @@ public:
     QModelIndex index( int r, int c, const QModelIndex &parent ) const;
     QModelIndex index( PLItem *, int c ) const;
     int itemId( const QModelIndex &index ) const;
+    bool isCurrent( const QModelIndex &index );
 
     QModelIndex parent( const QModelIndex &index) const;
     int childrenCount( const QModelIndex &parent = QModelIndex() ) const;
@@ -114,6 +118,9 @@ public:
     int i_items_to_append;
     void Rebuild();
     void rebuildRoot( playlist_item_t * );
+    bool hasRandom(); bool hasLoop(); bool hasRepeat();
+
+    void doDelete( QModelIndexList selected );
 private:
     void addCallbacks();
     void delCallbacks();
@@ -122,6 +129,8 @@ private:
     playlist_t *p_playlist;
     int i_depth;
 
+    static QIcon icons[ITEM_TYPE_NUMBER];
+
     /* Update processing */
     void ProcessInputItemUpdate( int i_input_id );
     void ProcessItemRemoval( int i_id );
@@ -132,6 +141,10 @@ private:
     void UpdateNodeChildren( PLItem * );
     void UpdateNodeChildren( playlist_item_t *, PLItem * );
 
+    /* Actions */
+    void recurseDelete( QList<PLItem*> children, QModelIndexList *fullList);
+    void doDeleteItem( PLItem *item, QModelIndexList *fullList );
+
     /* Lookups */
     PLItem *FindById( PLItem *, int );
     PLItem *FindByInput( PLItem *, int );
@@ -142,6 +155,9 @@ private:
     int i_cached_input_id;
 public slots:
     void activateItem( const QModelIndex &index );
+    void setRandom( bool );
+    void setLoop( bool );
+    void setRepeat( bool );
 friend class PLItem;
 };