LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
undoable.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include "cad/const.h"
5 #include <memory>
6 namespace lc {
7  class Document;
8  namespace operation {
9 
18  class Undoable {
19  public:
24  Undoable(const std::string& text) {
25  _text = text;
26  }
27  virtual ~Undoable() {
28  // LOG4CXX_DEBUG(logger, "Undoable removed:");
29  }
30 
38  virtual void undo() const = 0;
39 
47  virtual void redo() const = 0;
48 
57  virtual std::string text() {
58  return _text;
59  }
60 
61  private:
62  std::string _text;
63  };
64 
66  }
67 }
68 
69 // UNDOABLE_H
Undoable(const std::string &text)
Name of this operartion.
Definition: undoable.h:24
virtual std::string text()
Name of the operation.
Definition: undoable.h:57
: Abstract class for a Undoable operations All operations you wnt to beable to get place in the undo ...
Definition: undoable.h:18
virtual void redo() const =0
Redo a given operation.
DECLARE_SHORT_SHARED_PTR(Document)
Definition: cadentity.h:12
virtual void undo() const =0
Undo a given operation.
std::string _text
Definition: undoable.h:62