HAL
gate_info_table.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 
29 
30 namespace hal
31 {
32  class Gate;
33  class Module;
34 
36  {
37  Q_OBJECT
38 
39  public:
40 
46  GateInfoTable(QWidget* parent = nullptr);
47 
53  void setGate(Gate* gate);
54 
55  private:
56 
62  QString name() const;
63 
69  QString id() const;
70 
76  QString type() const;
77 
83  QString properties() const;
84 
90  QString location() const;
91 
97  QString parentModule() const;
98 
102  void changeName();
103 
107  void copyName() const;
108 
112  void pyCopyName() const;
113 
117  void copyId() const;
118 
122  void pyCopyId() const;
123 
127  void copyType() const;
128 
132  void pyCopyType() const;
133 
137  void copyproperties() const;
138 
142  void pyCopyproperties() const;
143 
147  void copyLocation() const;
148 
152  void pyCopyLocation() const;
153 
157  void copyModuleName() const;
158 
162  void pyCopyModule() const;
163 
167  void copyModuleID() const;
168 
172  void addModuleToSelection();
173 
177  void setModuleAsSelection();
178 
182  void moveToModuleAction();
183 
189  void handleGateRemoved(Gate* gate);
190 
196  void handleGateNameChanged(Gate* gate);
197 
203  void handleGateLocationChanged(Gate* gate);
204 
210  void handleModuleNameChanged(Module* module);
211 
218  void handleModuleGateAssigned(Module* module, const u32 gateId);
219 
223  void refresh();
224 
225  Gate* mGate;
226 
227  QMenu* mNameEntryContextMenu;
228  QMenu* mIdEntryContextMenu;
229  QMenu* mTypeEntryContextMenu;
230  QMenu* mPropertiesEntryContextMenu;
231  QMenu* mLocationEntryContextMenu;
232  QMenu* mModuleEntryContextMenu;
233 
234  std::function<void()> mModuleDoubleClickedAction;
235 
236  static const QString nameRowKey;
237  static const QString idRowKey;
238  static const QString typeRowKey;
239  static const QString gateTypePropertiesRowKey;
240  static const QString locationRowKey;
241  static const QString moduleRowKey;
242  };
243 }
Definition: gate.h:58
void setGate(Gate *gate)
GateInfoTable(QWidget *parent=nullptr)
const Module * module(const Gate *g, const NodeBoxes &boxes)
quint32 u32
Q_OBJECTQ_OBJECT
QObject * parent() const const