#ifndef _PLAYLIST_MODEL_H_
#define _PLAYLIST_MODEL_H_
+#include <vlc/vlc.h>
+#include <vlc_input.h>
+#include <vlc_playlist.h>
+
#include <QModelIndex>
#include <QObject>
#include <QEvent>
-
-#include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc_playlist.h>
+#include <QMimeData>
+#include <QSignalMapper>
class PLModel;
+class QSignalMapper;
class PLItem
{
int type;
int i_id;
int i_input_id;
+ int i_showflags;
+
+ void updateview( void );
friend class PLModel;
private:
void init( int, int, PLItem *, PLModel * );
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
{
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 */
bool b_need_update;
int i_items_to_append;
+
void rebuild(); void rebuild( playlist_item_t *);
bool hasRandom(); bool hasLoop(); bool hasRepeat();
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( );
+
+ int shownFlags() { return rootItem->i_showflags; }
private:
void addCallbacks();
void delCallbacks();
PLItem *rootItem;
playlist_t *p_playlist;
+ intf_thread_t *p_intf;
int i_depth;
static QIcon icons[ITEM_TYPE_NUMBER];
/* Popup */
int i_popup_item, i_popup_parent;
QModelIndexList current_selection;
+ QSignalMapper *ContextUpdateMapper;
/* Lookups */
PLItem *FindById( PLItem *, int );
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 );
void popupInfo();
void popupStream();
void popupSave();
+#ifdef WIN32
+ void popupExplore();
+#endif
+ void viewchanged( int );
friend class PLItem;
};