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