HAL
content_widget.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) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved.
5
// Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved.
6
// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved.
7
//
8
// Permission is hereby granted, free of charge, to any person obtaining a copy
9
// of this software and associated documentation files (the "Software"), to deal
10
// in the Software without restriction, including without limitation the rights
11
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
// copies of the Software, and to permit persons to whom the Software is
13
// furnished to do so, subject to the following conditions:
14
//
15
// The above copyright notice and this permission notice shall be included in all
16
// copies or substantial portions of the Software.
17
//
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
// SOFTWARE.
25
26
#pragma once
27
28
#include "
gui/widget/widget.h
"
29
30
#include <QIcon>
31
#include <QList>
32
33
class
QShortcut
;
34
class
QVBoxLayout
;
35
36
namespace
hal
37
{
38
class
ContentAnchor
;
39
class
ContentFrame
;
40
class
Toolbar
;
41
50
class
ContentWidget
:
public
Widget
51
{
52
Q_OBJECT
53
Q_PROPERTY
(
QString
iconStyle
READ
iconStyle
WRITE
setIconStyle
)
54
Q_PROPERTY
(
QString
iconPath
READ
iconPath
WRITE
setIconPath
)
55
56
public
:
63
explicit
ContentWidget
(
QString
name
,
QWidget
*
parent
=
nullptr
);
64
71
virtual
void
setupToolbar
(
Toolbar
*
Toolbar
);
72
79
virtual
QList<QShortcut*>
createShortcuts
();
80
86
void
repolish
();
87
93
QString
name
()
const
;
94
100
QIcon
icon
()
const
;
101
107
void
setAnchor
(
ContentAnchor
* anchor);
108
114
void
setIcon
(
QIcon
icon
);
115
122
void
set_name
(
const
QString
&
name
);
123
127
133
QString
iconStyle
();
134
140
QString
iconPath
();
142
146
152
void
setIconStyle
(
const
QString
&
style
);
153
159
void
setIconPath
(
const
QString
& path);
161
162
Q_SIGNALS
:
163
167
void
removed
();
168
172
void
detached
();
173
177
void
reattached
();
178
182
void
opened
();
183
187
void
closed
();
188
194
void
name_changed
(
const
QString
&
name
);
195
196
public
Q_SLOTS
:
197
201
void
remove
();
202
206
void
detach
();
207
211
void
reattach
();
212
216
void
open
();
217
221
void
close
();
222
229
void
handleSearchKeysequenceChanged
(
QKeySequence
seq);
230
234
virtual
void
restoreFromProject
() {;}
235
239
ContentFrame
*
detachedFrame
()
const
;
240
245
void
setDetachedFrame
(
ContentFrame
* df);
246
247
private
:
248
void
closeEvent(
QCloseEvent
*
event
);
249
250
QString
mName;
251
QIcon
mIcon;
252
ContentAnchor
* mAnchor =
nullptr
;
253
254
QString
mIconStyle;
255
QString
mIconPath;
256
257
protected
:
258
QVBoxLayout
*
mContentLayout
;
259
QAction
*
mSearchAction
;
260
QShortcut
*
mSearchShortcut
;
261
QKeySequence
mSearchKeysequence
;
262
ContentFrame
*
mDetachedFrame
;
263
};
264
}
hal::ContentAnchor
An abstract class that provides the interface for specific anchors (see SplitterAnchor or TabWidget )...
Definition:
content_anchor.h:54
hal::ContentFrame
Wraps the ContentWidget class.
Definition:
content_frame.h:45
hal::ContentWidget
Abstract class for Widgets within HAL's ContentArea.
Definition:
content_widget.h:51
hal::ContentWidget::setupToolbar
virtual void setupToolbar(Toolbar *Toolbar)
Definition:
content_widget.cpp:116
hal::ContentWidget::iconPath
QString iconPath
Definition:
content_widget.h:54
hal::ContentWidget::mSearchKeysequence
QKeySequence mSearchKeysequence
Definition:
content_widget.h:261
hal::ContentWidget::name
QString name() const
Definition:
content_widget.cpp:80
hal::ContentWidget::restoreFromProject
virtual void restoreFromProject()
Definition:
content_widget.h:234
hal::ContentWidget::detached
void detached()
hal::ContentWidget::set_name
void set_name(const QString &name)
Definition:
content_widget.cpp:110
hal::ContentWidget::iconStyle
QString iconStyle()
hal::ContentWidget::mSearchAction
QAction * mSearchAction
Definition:
content_widget.h:259
hal::ContentWidget::detach
void detach()
Definition:
content_widget.cpp:39
hal::ContentWidget::setIconPath
void setIconPath(const QString &path)
Definition:
content_widget.cpp:153
hal::ContentWidget::remove
void remove()
Definition:
content_widget.cpp:30
hal::ContentWidget::opened
void opened()
hal::ContentWidget::mDetachedFrame
ContentFrame * mDetachedFrame
Definition:
content_widget.h:262
hal::ContentWidget::removed
void removed()
hal::ContentWidget::setAnchor
void setAnchor(ContentAnchor *anchor)
Definition:
content_widget.cpp:100
hal::ContentWidget::icon
QIcon icon() const
Definition:
content_widget.cpp:85
hal::ContentWidget::mSearchShortcut
QShortcut * mSearchShortcut
Definition:
content_widget.h:260
hal::ContentWidget::iconPath
QString iconPath()
hal::ContentWidget::open
void open()
Definition:
content_widget.cpp:59
hal::ContentWidget::name_changed
void name_changed(const QString &name)
hal::ContentWidget::setIconStyle
void setIconStyle(const QString &style)
Definition:
content_widget.cpp:144
hal::ContentWidget::handleSearchKeysequenceChanged
void handleSearchKeysequenceChanged(QKeySequence seq)
Definition:
content_widget.cpp:162
hal::ContentWidget::reattach
void reattach()
Definition:
content_widget.cpp:49
hal::ContentWidget::repolish
void repolish()
Definition:
content_widget.cpp:123
hal::ContentWidget::closed
void closed()
hal::ContentWidget::iconStyle
QString iconStyle
Definition:
content_widget.h:53
hal::ContentWidget::close
void close()
Definition:
content_widget.cpp:68
hal::ContentWidget::setDetachedFrame
void setDetachedFrame(ContentFrame *df)
Definition:
content_widget.cpp:95
hal::ContentWidget::ContentWidget
ContentWidget(QString name, QWidget *parent=nullptr)
Definition:
content_widget.cpp:13
hal::ContentWidget::detachedFrame
ContentFrame * detachedFrame() const
Definition:
content_widget.cpp:90
hal::ContentWidget::setIcon
void setIcon(QIcon icon)
Definition:
content_widget.cpp:105
hal::ContentWidget::createShortcuts
virtual QList< QShortcut * > createShortcuts()
Definition:
content_widget.cpp:118
hal::ContentWidget::mContentLayout
QVBoxLayout * mContentLayout
Definition:
content_widget.h:258
hal::ContentWidget::reattached
void reattached()
hal::Toolbar
Toolbar for all ContentFrames and ContentWidgets.
Definition:
toolbar.h:39
hal::Widget
A QWidget customized for hal.
Definition:
widget.h:41
hal
Definition:
parser_liberty.cpp:10
QAction
QCloseEvent
QIcon
QKeySequence
QList< QShortcut * >
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::Q_PROPERTY
Q_PROPERTY(...)
QObject::Q_SIGNALS
Q_SIGNALSQ_SIGNALS
QObject::Q_SLOTS
Q_SLOTSQ_SLOTS
QObject::parent
QObject * parent() const const
QShortcut
QString
QVBoxLayout
QWidget
QWidget::event
virtual bool event(QEvent *event) override
QWidget::style
QStyle * style() const const
widget.h
plugins
gui
include
gui
content_widget
content_widget.h
Generated on Thu Jan 22 2026 00:12:19 for HAL by
1.9.1