18 #ifndef PLAYLISTCOMMANDS_H
19 #define PLAYLISTCOMMANDS_H
21 #include "models/playlistmodel.h"
22 #include <QUndoCommand>
33 class AppendCommand :
public QUndoCommand
36 AppendCommand(PlaylistModel &model,
const QString &xml,
bool emitModified =
true,
37 QUndoCommand *parent = 0);
41 PlaylistModel &m_model;
46 class InsertCommand :
public QUndoCommand
49 InsertCommand(PlaylistModel &model,
const QString &xml,
int row, QUndoCommand *parent = 0);
53 PlaylistModel &m_model;
58 class UpdateCommand :
public QUndoCommand
61 UpdateCommand(PlaylistModel &model,
const QString &xml,
int row, QUndoCommand *parent = 0);
69 bool mergeWith(
const QUndoCommand *other);
71 PlaylistModel &m_model;
77 class RemoveCommand :
public QUndoCommand
80 RemoveCommand(PlaylistModel &model,
int row, QUndoCommand *parent = 0);
84 PlaylistModel &m_model;
89 class MoveCommand :
public QUndoCommand
92 MoveCommand(PlaylistModel &model,
int from,
int to, QUndoCommand *parent = 0);
96 PlaylistModel &m_model;
101 class ClearCommand :
public QUndoCommand
104 ClearCommand(PlaylistModel &model, QUndoCommand *parent = 0);
108 PlaylistModel &m_model;
112 class SortCommand :
public QUndoCommand
115 SortCommand(PlaylistModel &model,
int column, Qt::SortOrder order, QUndoCommand *parent = 0);
119 PlaylistModel &m_model;
121 Qt::SortOrder m_order;
125 class TrimClipInCommand :
public QUndoCommand
128 TrimClipInCommand(PlaylistModel &model,
int row,
int in, QUndoCommand *parent =
nullptr);
134 return UndoIdTrimClipIn;
136 bool mergeWith(
const QUndoCommand *other);
138 PlaylistModel &m_model;
145 class TrimClipOutCommand :
public QUndoCommand
148 TrimClipOutCommand(PlaylistModel &model,
int row,
int out, QUndoCommand *parent =
nullptr);
154 return UndoIdTrimClipOut;
156 bool mergeWith(
const QUndoCommand *other);
158 PlaylistModel &m_model;
165 class ReplaceCommand :
public QUndoCommand
168 ReplaceCommand(PlaylistModel &model,
const QString &xml,
int row, QUndoCommand *parent = 0);
172 PlaylistModel &m_model;