18 #ifndef PLAYLISTCOMMANDS_H 19 #define PLAYLISTCOMMANDS_H 21 #include "models/playlistmodel.h" 22 #include <QUndoCommand> 34 class AppendCommand :
public QUndoCommand
37 AppendCommand(PlaylistModel& model,
const QString& xml,
bool emitModified =
true, 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);
65 int id()
const {
return UndoIdUpdate; }
66 bool mergeWith(
const QUndoCommand *other);
68 PlaylistModel& m_model;
74 class RemoveCommand :
public QUndoCommand
77 RemoveCommand(PlaylistModel& model,
int row, QUndoCommand * parent = 0);
81 PlaylistModel& m_model;
86 class MoveCommand :
public QUndoCommand
89 MoveCommand(PlaylistModel& model,
int from,
int to, QUndoCommand * parent = 0);
93 PlaylistModel& m_model;
98 class ClearCommand :
public QUndoCommand
101 ClearCommand(PlaylistModel& model, QUndoCommand * parent = 0);
105 PlaylistModel& m_model;
109 class SortCommand :
public QUndoCommand
112 SortCommand(PlaylistModel& model,
int column, Qt::SortOrder order, QUndoCommand * parent = 0);
116 PlaylistModel& m_model;
118 Qt::SortOrder m_order;
122 class TrimClipInCommand :
public QUndoCommand
125 TrimClipInCommand(PlaylistModel& model,
int row,
int in, QUndoCommand * parent =
nullptr);
129 int id()
const {
return UndoIdTrimClipIn; }
130 bool mergeWith(
const QUndoCommand *other);
132 PlaylistModel& m_model;
139 class TrimClipOutCommand :
public QUndoCommand
142 TrimClipOutCommand(PlaylistModel& model,
int row,
int out, QUndoCommand * parent =
nullptr);
146 int id()
const {
return UndoIdTrimClipOut; }
147 bool mergeWith(
const QUndoCommand *other);
149 PlaylistModel& m_model;
158 #endif // PLAYLISTCOMMANDS_H