CommentBlockModel.hpp
1 #pragma once
2 
3 #include <Process/TimeValue.hpp>
4 
5 #include <score/model/IdentifiedObject.hpp>
6 #include <score/model/Identifier.hpp>
7 #include <score/selection/Selectable.hpp>
9 #include <score/serialization/JSONVisitor.hpp>
10 #include <score/tools/Metadata.hpp>
11 
12 #include <QObject>
13 
14 #include <score_plugin_scenario_export.h>
15 
16 #include <verdigris>
17 class DataStream;
18 class JSONObject;
19 class QTextDocument;
20 
21 namespace Scenario
22 {
23 class SCORE_PLUGIN_SCENARIO_EXPORT CommentBlockModel final
24  : public IdentifiedObject<CommentBlockModel>
25 {
26  W_OBJECT(CommentBlockModel)
27 
28  SCORE_SERIALIZE_FRIENDS
29 
30 public:
31  Selectable selection{this};
32 
34  const Id<CommentBlockModel>& id, const TimeVal& date, double yPos,
35  QObject* parent);
36 
37  template <typename DeserializerVisitor>
38  CommentBlockModel(DeserializerVisitor&& vis, QObject* parent)
39  : IdentifiedObject{vis, parent}
40  {
41  vis.writeTo(*this);
42  }
43 
44  void setDate(const TimeVal& date);
45  const TimeVal& date() const;
46 
47  double heightPercentage() const;
48  void setHeightPercentage(double y);
49 
50  const QString content() const;
51  void setContent(const QString content);
52 
53 public:
54  void dateChanged(const TimeVal& arg_1) W_SIGNAL(dateChanged, arg_1);
55  void heightPercentageChanged(bool arg_1) W_SIGNAL(heightPercentageChanged, arg_1);
56  void contentChanged(QString arg_1) W_SIGNAL(contentChanged, arg_1);
57 
58 private:
59  TimeVal m_date{};
60  double m_yposition{0};
61 
62  QString m_HTMLcontent{
63  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" "
64  "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta "
65  "name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { "
66  "white-space: pre-wrap; }\n</style></head><body style=\" "
67  "font-family:'Ubuntu'; font-size:10pt; font-weight:400; "
68  "font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; "
69  "margin-left:0px; margin-right:0px; -qt-block-indent:0; "
70  "text-indent:0px;\">New Comment</p></body></html>"};
71 };
72 }
73 
74 DEFAULT_MODEL_METADATA(Scenario::CommentBlockModel, "Comment Block")
75 
76 W_REGISTER_ARGTYPE(Scenario::CommentBlockModel)
Definition: VisitorInterface.hpp:53
The IdentifiedObject class.
Definition: IdentifiedObject.hpp:19
Definition: VisitorInterface.hpp:61
Definition: CommentBlockModel.hpp:25
The Selectable class.
Definition: Selectable.hpp:14
The id_base_t class.
Definition: Identifier.hpp:57
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: TimeValue.hpp:21