CreateCommentBlock.hpp
1 #pragma once
2 
3 #include <Process/TimeValue.hpp>
4 
5 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
6 
7 #include <score/command/Command.hpp>
8 #include <score/model/Identifier.hpp>
9 #include <score/model/path/Path.hpp>
10 #include <score/tools/std/Optional.hpp>
11 
12 namespace Scenario
13 {
14 class CommentBlockModel;
15 
16 namespace Command
17 {
18 class CreateCommentBlock final : public score::Command
19 {
20  SCORE_COMMAND_DECL(CommandFactoryName(), CreateCommentBlock, "Create a comment block")
21 public:
23  const Scenario::ProcessModel& scenarioPath, TimeVal date, double yPosition);
24 
25  void undo(const score::DocumentContext& ctx) const override;
26  void redo(const score::DocumentContext& ctx) const override;
27 
28 protected:
29  void serializeImpl(DataStreamInput&) const override;
30  void deserializeImpl(DataStreamOutput&) override;
31 
32 private:
33  Path<ProcessModel> m_path;
34  TimeVal m_date;
35  double m_y{};
36 
38 };
39 class RemoveCommentBlock final : public score::Command
40 {
41  SCORE_COMMAND_DECL(CommandFactoryName(), RemoveCommentBlock, "Remove a comment block")
42 public:
45 
46  void undo(const score::DocumentContext& ctx) const override;
47  void redo(const score::DocumentContext& ctx) const override;
48 
49 protected:
50  void serializeImpl(DataStreamInput&) const override;
51  void deserializeImpl(DataStreamOutput&) override;
52 
53 private:
54  Path<ProcessModel> m_path;
56  QByteArray m_block;
57 };
58 }
59 }
Definition: CreateCommentBlock.hpp:19
Definition: CreateCommentBlock.hpp:40
Definition: CommentBlockModel.hpp:25
The core hierarchical and temporal process of score.
Definition: ScenarioModel.hpp:37
The id_base_t class.
Definition: Identifier.hpp:57
The Command class.
Definition: Command.hpp:34
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: TimeValue.hpp:21
Definition: DocumentContext.hpp:18