movecanvascommand.h
Go to the documentation of this file.
1 #ifndef MOVECANVASCOMMAND_H
2 #define MOVECANVASCOMMAND_H
3 
4 #include "command.h"
6 
7 namespace dnai
8 {
9  namespace commands
10  {
11  class MoveCanvasCommand : public Command
12  {
13  public:
14  MoveCanvasCommand(views::CanvasNode* canvas, const QPointF& pos, bool save);
18  void execute() const override;
19  void executeSave() override;
20 
24  void unExcute() const override;
25 
26  QString infos() const override;
27 
28  private:
29  QPointF m_pos;
30  QPointF m_lastPos;
32  };
33  }
34 }
35 
36 #endif // MOVECANVASCOMMAND_H
void executeSave() override
Save current state of the command for the reverse unExcute()
Definition: movecanvascommand.cpp:19
Definition: movecanvascommand.h:11
views::CanvasNode * m_canvas
Definition: movecanvascommand.h:31
void execute() const override
Execute the command.
Definition: movecanvascommand.cpp:14
Definition: command.h:11
QString infos() const override
Get display info for this command.
Definition: movecanvascommand.cpp:31
void unExcute() const override
Reverse the command.
Definition: movecanvascommand.cpp:26
Definition: api.h:13
QPointF m_lastPos
Definition: movecanvascommand.h:30
Definition: canvasnode.h:13
MoveCanvasCommand(views::CanvasNode *canvas, const QPointF &pos, bool save)
Definition: movecanvascommand.cpp:8
QPointF m_pos
Definition: movecanvascommand.h:29