HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
comment_item.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 <QFrame>
27
#include <QTextEdit>
28
29
#include "
gui/searchbar/searchoptions.h
"
30
31
32
class
QVBoxLayout
;
33
class
QHBoxLayout
;
34
class
QToolBar
;
35
class
QLabel
;
36
class
QAction
;
37
class
QToolButton
;
38
39
namespace
hal
40
{
41
class
CommentEntry;
42
class
SearchableLabel;
43
47
class
CommentItem
:
public
QFrame
48
{
49
Q_OBJECT
50
Q_PROPERTY
(
QString
modifyCommentIconPath
READ
modifyCommentIconPath
WRITE
setModifyCommentIconPath
)
51
Q_PROPERTY
(
QString
modifyCommentIconStyle
READ
modifyCommentIconStyle
WRITE
setModifyCommentIconStyle
)
52
Q_PROPERTY
(
QString
deleteCommentIconPath
READ
deleteCommentIconPath
WRITE
setDeleteCommentIconPath
)
53
Q_PROPERTY
(
QString
deleteCommentIconStyle
READ
deleteCommentIconStyle
WRITE
setDeleteCommentIconStyle
)
54
public
:
55
CommentItem
(
QWidget
*
parent
=
nullptr
);
56
CommentItem
(
CommentEntry
* entry,
QWidget
*
parent
=
nullptr
);
57
~CommentItem
();
58
59
void
setComment
(
CommentEntry
* entry);
60
void
updateCurrentEntry
();
61
bool
search
(
const
QString
&
string
,
SearchOptions
searchOpts);
62
63
CommentEntry
*
getEntry
();
64
65
// properties
66
QString
modifyCommentIconPath
(){
return
mModifyCommentIconPath;}
67
void
setModifyCommentIconPath
(
const
QString
& str){mModifyCommentIconPath = str;}
68
QString
modifyCommentIconStyle
(){
return
mModifyCommentIconStyle;}
69
void
setModifyCommentIconStyle
(
const
QString
& str){mModifyCommentIconStyle = str;}
70
71
QString
deleteCommentIconPath
(){
return
mDeleteCommentIconPath;}
72
void
setDeleteCommentIconPath
(
const
QString
& str){mDeleteCommentIconPath = str;}
73
QString
deleteCommentIconStyle
(){
return
mDeleteCommentIconStyle;}
74
void
setDeleteCommentIconStyle
(
const
QString
& str){mDeleteCommentIconStyle = str;}
75
76
Q_SIGNALS
:
77
78
//perhaps the CommentEntry for which a delete is requested?
79
//Getter for CommentEntry needed
80
void
delete_requested
(
CommentItem
* item);
81
82
private
:
83
QVBoxLayout
* mLayout;
84
CommentEntry
* mEntry;
85
86
QString
mModifyCommentIconPath;
87
QString
mModifyCommentIconStyle;
88
QString
mDeleteCommentIconPath;
89
QString
mDeleteCommentIconStyle;
90
91
// header part (perhaps no toolbar but a layout with toolbuttons instead of actions?)
92
QToolBar
* mTopToolbar;
93
SearchableLabel
* mHeader;
94
QLabel
* mCreationDate;
95
QAction
* mModifyAction;
96
QAction
* mDeleteAction;
97
98
// header part v2
99
QWidget
* mTopWidget;
100
QHBoxLayout
* mTopLayout;
101
QToolButton
* mModifyButton;
102
QToolButton
* mDeleteButton;
103
104
QTextEdit
* mTextEdit;
105
106
void
init();
107
108
void
handleDeleteButtonTriggered();
109
void
handleModifyButtonTriggered();
110
};
111
}
hal::CommentEntry
The CommentEntry class encapsulated information related to a comment.
Definition:
comment_entry.h:43
hal::CommentItem
Definition:
comment_item.h:48
hal::CommentItem::deleteCommentIconStyle
QString deleteCommentIconStyle()
Definition:
comment_item.h:73
hal::CommentItem::setComment
void setComment(CommentEntry *entry)
Definition:
comment_item.cpp:39
hal::CommentItem::delete_requested
void delete_requested(CommentItem *item)
hal::CommentItem::search
bool search(const QString &string, SearchOptions searchOpts)
Definition:
comment_item.cpp:54
hal::CommentItem::CommentItem
CommentItem(QWidget *parent=nullptr)
Definition:
comment_item.cpp:23
hal::CommentItem::getEntry
CommentEntry * getEntry()
Definition:
comment_item.cpp:121
hal::CommentItem::setDeleteCommentIconPath
void setDeleteCommentIconPath(const QString &str)
Definition:
comment_item.h:72
hal::CommentItem::deleteCommentIconPath
QString deleteCommentIconPath()
Definition:
comment_item.h:71
hal::CommentItem::modifyCommentIconStyle
QString modifyCommentIconStyle()
Definition:
comment_item.h:68
hal::CommentItem::modifyCommentIconPath
QString modifyCommentIconPath()
Definition:
comment_item.h:66
hal::CommentItem::~CommentItem
~CommentItem()
Definition:
comment_item.cpp:35
hal::CommentItem::setDeleteCommentIconStyle
void setDeleteCommentIconStyle(const QString &str)
Definition:
comment_item.h:74
hal::CommentItem::setModifyCommentIconStyle
void setModifyCommentIconStyle(const QString &str)
Definition:
comment_item.h:69
hal::CommentItem::setModifyCommentIconPath
void setModifyCommentIconPath(const QString &str)
Definition:
comment_item.h:67
hal::CommentItem::updateCurrentEntry
void updateCurrentEntry()
Definition:
comment_item.cpp:45
hal::SearchOptions
Definition:
searchoptions.h:35
hal::SearchableLabel
Definition:
searchable_label.h:41
hal
Definition:
defines.h:45
QAction
QFrame
QHBoxLayout
QLabel
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::Q_PROPERTY
Q_PROPERTY(...)
QObject::Q_SIGNALS
Q_SIGNALSQ_SIGNALS
QObject::parent
QObject * parent() const const
QString
QTextEdit
QToolBar
QToolButton
QVBoxLayout
QWidget
searchoptions.h
plugins
gui
include
gui
comment_system
widgets
comment_item.h
Generated by
1.9.1