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
Toolbar
;
40
49
class
ContentWidget
:
public
Widget
50
{
51
Q_OBJECT
52
Q_PROPERTY
(
QString
iconStyle
READ
iconStyle
WRITE
setIconStyle
)
53
Q_PROPERTY
(
QString
iconPath
READ
iconPath
WRITE
setIconPath
)
54
55
public
:
62
explicit
ContentWidget
(
QString
name
,
QWidget
*
parent
=
nullptr
);
63
70
virtual
void
setupToolbar
(
Toolbar
*
Toolbar
);
71
78
virtual
QList<QShortcut*>
createShortcuts
();
79
85
void
repolish
();
86
92
QString
name
();
93
99
QIcon
icon
();
100
106
void
setAnchor
(
ContentAnchor
* anchor);
107
113
void
setIcon
(
QIcon
icon
);
114
121
void
set_name
(
const
QString
&
name
);
122
126
132
QString
iconStyle
();
133
139
QString
iconPath
();
141
145
151
void
setIconStyle
(
const
QString
&
style
);
152
158
void
setIconPath
(
const
QString
& path);
160
161
Q_SIGNALS
:
162
166
void
removed
();
167
171
void
detached
();
172
176
void
reattached
();
177
181
void
opened
();
182
186
void
closed
();
187
193
void
name_changed
(
const
QString
&
name
);
194
195
public
Q_SLOTS
:
196
200
void
remove
();
201
205
void
detach
();
206
210
void
reattach
();
211
215
void
open
();
216
220
void
close
();
221
228
void
handleSearchKeysequenceChanged
(
QKeySequence
seq);
229
233
virtual
void
restoreFromProject
() {;}
234
235
private
:
236
void
closeEvent(
QCloseEvent
*
event
);
237
238
QString
mName;
239
QIcon
mIcon;
240
ContentAnchor
* mAnchor =
nullptr
;
241
int
mIndexPriority = 0;
242
243
QString
mIconStyle;
244
QString
mIconPath;
245
246
protected
:
247
QVBoxLayout
*
mContentLayout
;
248
QAction
*
mSearchAction
;
249
QShortcut
*
mSearchShortcut
;
250
QKeySequence
mSearchKeysequence
;
251
};
252
}
hal::ContentAnchor
An abstract class that provides the interface for specific anchors (see SplitterAnchor or TabWidget )...
Definition:
content_anchor.h:38
hal::ContentWidget
Abstract class for Widgets within HAL's ContentArea.
Definition:
content_widget.h:50
hal::ContentWidget::setupToolbar
virtual void setupToolbar(Toolbar *Toolbar)
Definition:
content_widget.cpp:102
hal::ContentWidget::iconPath
QString iconPath
Definition:
content_widget.h:53
hal::ContentWidget::mSearchKeysequence
QKeySequence mSearchKeysequence
Definition:
content_widget.h:250
hal::ContentWidget::restoreFromProject
virtual void restoreFromProject()
Definition:
content_widget.h:233
hal::ContentWidget::icon
QIcon icon()
Definition:
content_widget.cpp:81
hal::ContentWidget::detached
void detached()
hal::ContentWidget::set_name
void set_name(const QString &name)
Definition:
content_widget.cpp:96
hal::ContentWidget::iconStyle
QString iconStyle()
hal::ContentWidget::mSearchAction
QAction * mSearchAction
Definition:
content_widget.h:248
hal::ContentWidget::detach
void detach()
Definition:
content_widget.cpp:38
hal::ContentWidget::setIconPath
void setIconPath(const QString &path)
Definition:
content_widget.cpp:139
hal::ContentWidget::remove
void remove()
Definition:
content_widget.cpp:29
hal::ContentWidget::opened
void opened()
hal::ContentWidget::removed
void removed()
hal::ContentWidget::setAnchor
void setAnchor(ContentAnchor *anchor)
Definition:
content_widget.cpp:86
hal::ContentWidget::mSearchShortcut
QShortcut * mSearchShortcut
Definition:
content_widget.h:249
hal::ContentWidget::iconPath
QString iconPath()
hal::ContentWidget::open
void open()
Definition:
content_widget.cpp:56
hal::ContentWidget::name_changed
void name_changed(const QString &name)
hal::ContentWidget::setIconStyle
void setIconStyle(const QString &style)
Definition:
content_widget.cpp:130
hal::ContentWidget::handleSearchKeysequenceChanged
void handleSearchKeysequenceChanged(QKeySequence seq)
Definition:
content_widget.cpp:148
hal::ContentWidget::reattach
void reattach()
Definition:
content_widget.cpp:47
hal::ContentWidget::repolish
void repolish()
Definition:
content_widget.cpp:109
hal::ContentWidget::name
QString name()
Definition:
content_widget.cpp:76
hal::ContentWidget::closed
void closed()
hal::ContentWidget::iconStyle
QString iconStyle
Definition:
content_widget.h:52
hal::ContentWidget::close
void close()
Definition:
content_widget.cpp:65
hal::ContentWidget::ContentWidget
ContentWidget(QString name, QWidget *parent=nullptr)
Definition:
content_widget.cpp:13
hal::ContentWidget::setIcon
void setIcon(QIcon icon)
Definition:
content_widget.cpp:91
hal::ContentWidget::createShortcuts
virtual QList< QShortcut * > createShortcuts()
Definition:
content_widget.cpp:104
hal::ContentWidget::mContentLayout
QVBoxLayout * mContentLayout
Definition:
content_widget.h:247
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 Fri Feb 14 2025 14:22:41 for HAL by
1.9.1