SendStrategy.hpp
1 #pragma once
2 #include <score/command/CommandStackFacade.hpp>
3 
4 namespace SendStrategy
5 {
6 struct Simple
7 {
8  static void send(const score::CommandStackFacade& stack, score::Command* other)
9  {
10  stack.redoAndPush(other);
11  }
12 };
13 
14 struct Quiet
15 {
16  static void send(const score::CommandStackFacade& stack, score::Command* other)
17  {
18  stack.push(other);
19  }
20 };
21 
22 struct UndoRedo
23 {
24  static void send(const score::CommandStackFacade& stack, score::Command* other)
25  {
26  other->undo(stack.context());
27  stack.redoAndPush(other);
28  }
29 };
30 }
31 namespace RedoStrategy
32 {
33 struct Redo
34 {
35  static void redo(const score::DocumentContext& ctx, score::Command& cmd)
36  {
37  cmd.redo(ctx);
38  }
39 };
40 
41 struct Quiet
42 {
43  static void redo(const score::DocumentContext& ctx, score::Command& cmd) { }
44 };
45 }
The Command class.
Definition: Command.hpp:34
A small abstraction layer over the score::CommandStack.
Definition: CommandStackFacade.hpp:20
Definition: SendStrategy.hpp:42
Definition: SendStrategy.hpp:34
Definition: SendStrategy.hpp:15
Definition: SendStrategy.hpp:7
Definition: SendStrategy.hpp:23
Definition: DocumentContext.hpp:18