Loading...
Searching...
No Matches
SendStrategy.hpp
1#pragma once
2#include <score/command/CommandStackFacade.hpp>
3
4namespace SendStrategy
5{
6struct Simple
7{
8 static void send(const score::CommandStackFacade& stack, score::Command* other)
9 {
10 stack.redoAndPush(other);
11 }
12};
13
14struct Quiet
15{
16 static void send(const score::CommandStackFacade& stack, score::Command* other)
17 {
18 stack.push(other);
19 }
20};
21
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}
31namespace RedoStrategy
32{
33struct Redo
34{
35 static void redo(const score::DocumentContext& ctx, score::Command& cmd)
36 {
37 cmd.redo(ctx);
38 }
39};
40
41struct 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