LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
documentoperation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "cad/const.h"
5 #include "undoable.h"
6 
7 namespace lc {
8  class Document;
10 
11  class StorageManager;
12 
13  namespace operation {
14 
15 
23  class DocumentOperation : public Undoable, public std::enable_shared_from_this<operation::DocumentOperation> {
24  friend class lc::Document;
25  friend class Builder;
26 
27  public:
28  DocumentOperation(Document_SPtr document, const std::string& description);
29  Document_SPtr document() const;
30 
34  virtual void execute();
35 
36  virtual ~DocumentOperation() {}
37 
38  private:
39 
44  void process();
48  virtual void start() const {};
49 
53  virtual void finnish() const {};
54 
55  Document_SPtr _document;
56  protected:
61  virtual void processInternal() = 0;
62 
63  };
64 
65  DECLARE_SHORT_SHARED_PTR(DocumentOperation)
66  }
67 }
: Abstract class for a Undoable operations All operations you wnt to beable to get place in the undo ...
Definition: undoable.h:18
DECLARE_SHORT_SHARED_PTR(Document)
Definition: cadentity.h:12
Do multiple operations on a document with only one undo cycle.
Definition: builder.h:13