19 #ifndef PLAYLISTMODEL_H 20 #define PLAYLISTMODEL_H 22 #include <QAbstractTableModel> 23 #include <qmimedata.h> 24 #include <QStringList> 25 #include "mltcontroller.h" 26 #include "MltPlaylist.h" 28 #define kDetailedMode "detailed" 29 #define kIconsMode "icons" 30 #define kTiledMode "tiled" 32 class PlaylistModel :
public QAbstractTableModel
54 FIELD_INDEX = Qt::UserRole,
62 static const int THUMBNAIL_WIDTH = 80;
63 static const int THUMBNAIL_HEIGHT = 45;
65 explicit PlaylistModel(QObject *parent = 0);
67 int rowCount(
const QModelIndex& parent = QModelIndex())
const;
68 int columnCount(
const QModelIndex& parent = QModelIndex())
const;
69 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
70 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const;
71 Qt::DropActions supportedDropActions()
const;
72 bool insertRows(
int row,
int count,
const QModelIndex & parent = QModelIndex());
73 bool removeRows(
int row,
int count,
const QModelIndex & parent = QModelIndex());
74 bool moveRows(
const QModelIndex &sourceParent,
int sourceRow,
int count,
const QModelIndex &destinationParent,
int destinationChild);
75 Qt::ItemFlags flags(
const QModelIndex &index)
const;
76 QStringList mimeTypes()
const;
77 QMimeData *mimeData(
const QModelIndexList &indexes)
const;
78 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent);
79 QModelIndex incrementIndex(
const QModelIndex& index)
const;
80 QModelIndex decrementIndex(
const QModelIndex& index)
const;
81 QModelIndex createIndex(
int row,
int column)
const;
82 void createIfNeeded();
83 void showThumbnail(
int row);
84 void refreshThumbnails();
85 Mlt::Playlist* playlist() {
return m_playlist; }
86 void setPlaylist(Mlt::Playlist& playlist);
88 ViewMode viewMode()
const;
89 void setViewMode(ViewMode mode);
97 void dropped(
const QMimeData *data,
int row);
98 void moveClip(
int from,
int to);
103 void append(Mlt::Producer&);
104 void insert(Mlt::Producer&,
int row);
105 void remove(
int row);
106 void update(
int row, Mlt::Producer& producer);
107 void appendBlank(
int frames);
108 void insertBlank(
int frames,
int row);
110 void move(
int from,
int to);
113 Mlt::Playlist* m_playlist;
118 #endif // PLAYLISTMODEL_H