HAL
comment_entry.h
Go to the documentation of this file.
1 // MIT License
2 //
3 // Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved.
4 // Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved.
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in all
14 // copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 // SOFTWARE.
23 
24 #pragma once
25 
26 #include "gui/gui_def.h"
27 #include <QString>
28 #include <QDateTime>
29 #include <QJsonObject>
30 
31 namespace hal
32 {
43  {
44  public:
45  CommentEntry(Node n, QString text = QString(), QString header = QString());
46  CommentEntry(const QJsonObject& jsonObj);
48 
49  void setHeader(QString newHeader);
50  void setText(QString newText);
51  void setDirty(bool dirty);
52 
53  QString getHeader() const;
54  QString getText() const;
55  Node getNode() const;
56  QDateTime getCreationTime() const;
58  QJsonObject toJson() const;
59  bool isInvalid() const;
60  void dump() const;
61 
63 
64  //create all setter/getter for datetimes for serialization/deserialization in case
65  //the content manager parses file? Or omit them and create parse/write json methods
66  //compareable to user actions, then there would be no need to set datetimes from outside.
67 
68  private:
69  Node mNode;
70  QString mHeader;
71  QDateTime mCreated;
72  QDateTime mLastModified;
73  QString mText;
74  bool mDirty;
75  };
76 }
The CommentEntry class encapsulated information related to a comment.
Definition: comment_entry.h:43
bool isInvalid() const
QDateTime getCreationTime() const
QDateTime getLastModifiedTime() const
QString getHeader() const
QJsonObject toJson() const
CommentEntry(Node n, QString text=QString(), QString header=QString())
void setDirty(bool dirty)
Node getNode() const
~CommentEntry()
Definition: comment_entry.h:47
QString getText() const
void setText(QString newText)
QString getDateFormatString() const
void setHeader(QString newHeader)
void dump() const
The Node class object represents a module or a gate.
Definition: gui_def.h:61
n
Definition: test.py:6