2015-02-11 06:28:43 +00:00
|
|
|
#ifndef UNDOCOMMANDS_H
|
|
|
|
#define UNDOCOMMANDS_H
|
|
|
|
|
|
|
|
#include <QUndoCommand>
|
2015-02-28 04:42:37 +00:00
|
|
|
#include <QMap>
|
2015-02-11 06:28:43 +00:00
|
|
|
#include "dive.h"
|
|
|
|
|
|
|
|
class UndoDeleteDive : public QUndoCommand {
|
|
|
|
public:
|
2015-03-17 04:48:45 +00:00
|
|
|
UndoDeleteDive(QList<struct dive*> deletedDives);
|
2015-02-11 06:28:43 +00:00
|
|
|
virtual void undo();
|
|
|
|
virtual void redo();
|
|
|
|
|
|
|
|
private:
|
2015-03-17 04:48:45 +00:00
|
|
|
QList<struct dive*> diveList;
|
2015-02-11 06:28:43 +00:00
|
|
|
};
|
|
|
|
|
2015-02-14 17:12:05 +00:00
|
|
|
class UndoShiftTime : public QUndoCommand {
|
|
|
|
public:
|
2015-03-17 04:48:45 +00:00
|
|
|
UndoShiftTime(QList<int> changedDives, int amount);
|
2015-02-14 17:12:05 +00:00
|
|
|
virtual void undo();
|
|
|
|
virtual void redo();
|
|
|
|
|
|
|
|
private:
|
2015-03-17 04:48:45 +00:00
|
|
|
QList<int> diveList;
|
2015-02-14 17:12:05 +00:00
|
|
|
int timeChanged;
|
|
|
|
};
|
|
|
|
|
2015-02-28 04:42:37 +00:00
|
|
|
class UndoRenumberDives : public QUndoCommand {
|
|
|
|
public:
|
|
|
|
UndoRenumberDives(QMap<int,int> originalNumbers, int startNumber);
|
|
|
|
virtual void undo();
|
|
|
|
virtual void redo();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QMap<int,int> oldNumbers;
|
|
|
|
int start;
|
|
|
|
};
|
|
|
|
|
2015-02-11 06:28:43 +00:00
|
|
|
#endif // UNDOCOMMANDS_H
|