HAL
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
44
class
CommentItem
:
public
QFrame
45
{
46
Q_OBJECT
47
Q_PROPERTY
(
QString
modifyCommentIconPath
READ
modifyCommentIconPath
WRITE
setModifyCommentIconPath
)
48
Q_PROPERTY
(
QString
modifyCommentIconStyle
READ
modifyCommentIconStyle
WRITE
setModifyCommentIconStyle
)
49
Q_PROPERTY
(
QString
deleteCommentIconPath
READ
deleteCommentIconPath
WRITE
setDeleteCommentIconPath
)
50
Q_PROPERTY
(
QString
deleteCommentIconStyle
READ
deleteCommentIconStyle
WRITE
setDeleteCommentIconStyle
)
51
public
:
52
CommentItem
(
QWidget
*
parent
=
nullptr
);
53
CommentItem
(
CommentEntry
* entry,
QWidget
*
parent
=
nullptr
);
54
~CommentItem
();
55
56
void
setComment
(
CommentEntry
* entry);
57
void
updateCurrentEntry
();
58
bool
search
(
const
QString
&
string
,
SearchOptions
searchOpts);
59
60
CommentEntry
*
getEntry
();
61
62
// properties
63
QString
modifyCommentIconPath
(){
return
mModifyCommentIconPath;}
64
void
setModifyCommentIconPath
(
const
QString
&
str
){mModifyCommentIconPath =
str
;}
65
QString
modifyCommentIconStyle
(){
return
mModifyCommentIconStyle;}
66
void
setModifyCommentIconStyle
(
const
QString
&
str
){mModifyCommentIconStyle =
str
;}
67
68
QString
deleteCommentIconPath
(){
return
mDeleteCommentIconPath;}
69
void
setDeleteCommentIconPath
(
const
QString
&
str
){mDeleteCommentIconPath =
str
;}
70
QString
deleteCommentIconStyle
(){
return
mDeleteCommentIconStyle;}
71
void
setDeleteCommentIconStyle
(
const
QString
&
str
){mDeleteCommentIconStyle =
str
;}
72
73
Q_SIGNALS
:
74
75
//perhaps the CommentEntry for which a delete is requested?
76
//Getter for CommentEntry needed
77
void
delete_requested
(
CommentItem
* item);
78
79
private
:
80
QVBoxLayout
* mLayout;
81
CommentEntry
* mEntry;
82
83
QString
mModifyCommentIconPath;
84
QString
mModifyCommentIconStyle;
85
QString
mDeleteCommentIconPath;
86
QString
mDeleteCommentIconStyle;
87
88
// header part (perhaps no toolbar but a layout with toolbuttons instead of actions?)
89
QToolBar
* mTopToolbar;
90
SearchableLabel
* mHeader;
91
QLabel
* mCreationDate;
92
QAction
* mModifyAction;
93
QAction
* mDeleteAction;
94
95
// header part v2
96
QWidget
* mTopWidget;
97
QHBoxLayout
* mTopLayout;
98
QToolButton
* mModifyButton;
99
QToolButton
* mDeleteButton;
100
101
QTextEdit
* mTextEdit;
102
103
void
init();
104
105
void
handleDeleteButtonTriggered();
106
void
handleModifyButtonTriggered();
107
};
108
}
hal::CommentEntry
The CommentEntry class encapsulated information related to a comment.
Definition:
comment_entry.h:43
hal::CommentItem
Definition:
comment_item.h:45
hal::CommentItem::deleteCommentIconStyle
QString deleteCommentIconStyle()
Definition:
comment_item.h:70
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:112
hal::CommentItem::setDeleteCommentIconPath
void setDeleteCommentIconPath(const QString &str)
Definition:
comment_item.h:69
hal::CommentItem::deleteCommentIconPath
QString deleteCommentIconPath()
Definition:
comment_item.h:68
hal::CommentItem::modifyCommentIconStyle
QString modifyCommentIconStyle()
Definition:
comment_item.h:65
hal::CommentItem::modifyCommentIconPath
QString modifyCommentIconPath()
Definition:
comment_item.h:63
hal::CommentItem::modifyCommentIconPath
QString modifyCommentIconPath
Definition:
comment_item.h:47
hal::CommentItem::deleteCommentIconPath
QString deleteCommentIconPath
Definition:
comment_item.h:49
hal::CommentItem::deleteCommentIconStyle
QString deleteCommentIconStyle
Definition:
comment_item.h:50
hal::CommentItem::~CommentItem
~CommentItem()
Definition:
comment_item.cpp:35
hal::CommentItem::setDeleteCommentIconStyle
void setDeleteCommentIconStyle(const QString &str)
Definition:
comment_item.h:71
hal::CommentItem::setModifyCommentIconStyle
void setModifyCommentIconStyle(const QString &str)
Definition:
comment_item.h:66
hal::CommentItem::setModifyCommentIconPath
void setModifyCommentIconPath(const QString &str)
Definition:
comment_item.h:64
hal::CommentItem::modifyCommentIconStyle
QString modifyCommentIconStyle
Definition:
comment_item.h:48
hal::CommentItem::updateCurrentEntry
void updateCurrentEntry()
Definition:
comment_item.cpp:45
hal::SearchOptions
Definition:
searchoptions.h:32
hal::SearchableLabel
Definition:
searchable_label.h:38
control.str
str
Definition:
control.py:14
hal
Definition:
parser_liberty.cpp:10
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 on Fri Feb 14 2025 14:22:41 for HAL by
1.9.1