HAL  v4.5.0-133-g64838ea8d
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
selection_details_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 
31 #include <QShortcut>
32 
33 class QTableWidget;
34 class QStackedWidget;
35 class QSplitter;
36 class QListWidget;
37 class QLabel;
38 
39 namespace hal
40 {
41  class Grouping;
42  class Searchbar;
43  class SelectionTreeView;
44  class UserAction;
45  class UserActionObject;
46  class SettingsItemCheckbox;
47  class GateDetailsTabWidget;
48  class NetDetailsTabWidget;
49  class ModuleDetailsTabWidget;
50 
61  {
62  Q_OBJECT
71 
72  public:
73 
81 
88  virtual void setupToolbar(Toolbar* toolbar) override;
89 
90  // =====================================================================
91  // Q_PROPERTY functions
92  // =====================================================================
93 
97 
103  QString disabledIconStyle() const;
104 
110  QString searchIconPath() const;
111 
117  QString searchIconStyle() const;
118 
125 
131  QString toGroupingIconPath() const;
132 
139 
145  QString toModuleIconPath() const;
146 
152  QString toModuleIconStyle() const;
153 
159  void setDisabledIconStyle(const QString &style);
160 
166  void setSearchIconPath(const QString &path);
167 
173  void setSearchIconStyle(const QString &style);
174 
181 
187  void setToGroupingIconPath(const QString &path);
188 
194  void setToGroupingIconStyle(const QString &style);
195 
201  void setToModuleIconPath(const QString &path);
202 
208  void setToModuleIconStyle(const QString &style);
210 
215  void selectionToGroupingAction(const QString& existingGrpName = QString());
216 
224 
231 
232  Q_SIGNALS:
233 
240 
241  public Q_SLOTS:
242 
249  void handleSelectionUpdate(void* sender);
250 
257  void handleTreeSelection(const ModuleItem* sti);
258 
265 
266 
267  private Q_SLOTS:
268 
272  void updateSearchIcon();
273 
278  void selectionToGrouping();
279 
283  void toggleSearchbar();
284 
285  private:
286 
293  void singleSelectionInternal(const ModuleItem* sti);
294 
295  void showNoSelection();
296 
297  QSplitter* mSplitter;
298  SelectionTreeView* mSelectionTreeView;
299  unsigned int mNumberSelectedItems;
300 
301  QStackedWidget* mStackedWidget;
302 
303  QLabel* mItemDeletedLabel;
304  QLabel* mNoSelectionLabel;
305 
306  Searchbar* mSearchbar;
307 
308  QAction* mSelectionToGrouping;
309  QAction* mSelectionToModule;
310 
311  QString mDisabledIconStyle;
312 
313  QString mSearchIconPath;
314  QString mSearchIconStyle;
315  QString mSearchActiveIconStyle;
316 
317  QString mToGroupingIconPath;
318  QString mToGroupingIconStyle;
319 
320  QString mToModuleIconPath;
321  QString mToModuleIconStyle;
322 
323  void canMoveToModule(int nodes);
324  void enableSearchbar(bool enable);
325 
326  static const QString sAddToGrouping;
327 
328  static SettingsItemCheckbox* sSettingHideEmpty;
329 
330  GateDetailsTabWidget* mGateDetailsTabs;
331  NetDetailsTabWidget* mNetDetailsTabs;
332  ModuleDetailsTabWidget* mModuleDetailsTabs;
333  SelectionTreeProxyModel* mSelectionTreeProxyModel;
334  ModuleModel* mModuleModel;
335  };
336 }
Abstract class for Widgets within HAL's ContentArea.
The DetailsTabWidget that is responsible for showing Gate details.
The DetailsTabWidget that is responsible for showing Module details.
An item in the ModuleModel.
Definition: module_item.h:48
A model for displaying multiple netlist elements.
Definition: module_model.h:54
The DetailsTabWidget that is responsible for showing Module details.
A QFrame with a QLineEdit that can be used to input a substring to search for.
Definition: searchbar.h:48
Container for all specific details widgets.
SelectionDetailsWidget(QWidget *parent=nullptr)
void setSearchIconPath(const QString &path)
void setToModuleIconPath(const QString &path)
void setSearchIconStyle(const QString &style)
QList< QShortcut * > createShortcuts() override
void handleTreeSelection(const ModuleItem *sti)
void setToGroupingIconStyle(const QString &style)
void setToGroupingIconPath(const QString &path)
void setToModuleIconStyle(const QString &style)
void selectionToGroupingAction(const QString &existingGrpName=QString())
void setDisabledIconStyle(const QString &style)
UserAction * groupingUnassignActionFactory(const UserActionObject &obj) const
virtual void setupToolbar(Toolbar *toolbar) override
void setSearchActiveIconStyle(const QString &style)
void triggerHighlight(QVector< const ModuleItem * > highlight)
Enables filtering of the SelectionTreeModel.
Displays the current selection.
A SettingsItem representing a Checkbox.
Toolbar for all ContentFrames and ContentWidgets.
Definition: toolbar.h:39
The UserAction class is the abstract base class for user interactions.
Definition: user_action.h:57
The UserActionObject class represents a single object used in UserAction.
Definition: defines.h:45
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
QObject * sender() const const
QStyle * style() const const