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:
|
|
|
|
UndoDeleteDive(QList<struct dive*> diveList);
|
|
|
|
virtual void undo();
|
|
|
|
virtual void redo();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QList<struct dive*> dives;
|
|
|
|
};
|
|
|
|
|
2015-02-14 17:12:05 +00:00
|
|
|
class UndoShiftTime : public QUndoCommand {
|
|
|
|
public:
|
|
|
|
UndoShiftTime(QList<int> diveList, int amount);
|
|
|
|
virtual void undo();
|
|
|
|
virtual void redo();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QList<int> dives;
|
|
|
|
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
|