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>
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/dive.h"
|
2015-02-11 06:28:43 +00:00
|
|
|
|
|
|
|
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-10-02 18:50:12 +00:00
|
|
|
QList<struct dive_trip*> tripList;
|
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:
|
2015-06-15 04:49:34 +00:00
|
|
|
UndoRenumberDives(QMap<int, QPair<int, int> > originalNumbers);
|
2015-02-28 04:42:37 +00:00
|
|
|
virtual void undo();
|
|
|
|
virtual void redo();
|
|
|
|
|
|
|
|
private:
|
2015-06-15 04:49:34 +00:00
|
|
|
QMap<int,QPair<int, int> > oldNumbers;
|
2015-02-28 04:42:37 +00:00
|
|
|
};
|
|
|
|
|
2015-04-10 06:39:51 +00:00
|
|
|
class UndoRemoveDivesFromTrip : public QUndoCommand {
|
|
|
|
public:
|
|
|
|
UndoRemoveDivesFromTrip(QMap<struct dive*, dive_trip*> removedDives);
|
|
|
|
virtual void undo();
|
|
|
|
virtual void redo();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QMap<struct dive*, dive_trip*> divesToUndo;
|
|
|
|
};
|
|
|
|
|
2015-02-11 06:28:43 +00:00
|
|
|
#endif // UNDOCOMMANDS_H
|