HAL
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 "hal_core/defines.h"
32 
33 
34 class QTableWidget;
35 class QStackedWidget;
36 class QSplitter;
37 class QListWidget;
38 class QLabel;
39 
40 namespace hal
41 {
42  class Grouping;
43  class Searchbar;
44  class SelectionTreeView;
45  class UserAction;
46  class UserActionObject;
49  class NetDetailsTabWidget;
51 
62  {
63  Q_OBJECT
72 
73  public:
74 
82 
89  virtual void setupToolbar(Toolbar* toolbar) override;
90 
91  // =====================================================================
92  // Q_PROPERTY functions
93  // =====================================================================
94 
98 
104  QString disabledIconStyle() const;
105 
111  QString searchIconPath() const;
112 
118  QString searchIconStyle() const;
119 
126 
132  QString toGroupingIconPath() const;
133 
140 
146  QString toModuleIconPath() const;
147 
153  QString toModuleIconStyle() const;
154 
160  void setDisabledIconStyle(const QString &style);
161 
167  void setSearchIconPath(const QString &path);
168 
174  void setSearchIconStyle(const QString &style);
175 
182 
188  void setToGroupingIconPath(const QString &path);
189 
195  void setToGroupingIconStyle(const QString &style);
196 
202  void setToModuleIconPath(const QString &path);
203 
209  void setToModuleIconStyle(const QString &style);
211 
216  void selectionToGroupingAction(const QString& existingGrpName = QString());
217 
225 
232 
233  Q_SIGNALS:
234 
241 
242  public Q_SLOTS:
243 
250  void handleSelectionUpdate(void* sender);
251 
258  void handleTreeSelection(const ModuleItem* sti);
259 
266 
267 
268  private Q_SLOTS:
269 
273  void updateSearchIcon();
274 
279  void selectionToGrouping();
280 
284  void toggleSearchbar();
285 
286  private:
287 
294  void singleSelectionInternal(const ModuleItem* sti);
295 
296  void showNoSelection();
297 
298  QSplitter* mSplitter;
299  SelectionTreeView* mSelectionTreeView;
300  unsigned int mNumberSelectedItems;
301 
302  QStackedWidget* mStackedWidget;
303 
304  QLabel* mItemDeletedLabel;
305  QLabel* mNoSelectionLabel;
306 
307  Searchbar* mSearchbar;
308 
309  QAction* mSelectionToGrouping;
310  QAction* mSelectionToModule;
311 
312  QString mDisabledIconStyle;
313 
314  QString mSearchIconPath;
315  QString mSearchIconStyle;
316  QString mSearchActiveIconStyle;
317 
318  QString mToGroupingIconPath;
319  QString mToGroupingIconStyle;
320 
321  QString mToModuleIconPath;
322  QString mToModuleIconStyle;
323 
324  void canMoveToModule(int nodes);
325  void enableSearchbar(bool enable);
326 
327  static const QString sAddToGrouping;
328 
329  static SettingsItemCheckbox* sSettingHideEmpty;
330 
331  GateDetailsTabWidget* mGateDetailsTabs;
332  NetDetailsTabWidget* mNetDetailsTabs;
333  ModuleDetailsTabWidget* mModuleDetailsTabs;
334  SelectionTreeProxyModel* mSelectionTreeProxyModel;
335  ModuleModel* mModuleModel;
336  };
337 }
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.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
QObject * sender() const const
QStyle * style() const const