HAL
pin_item.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 #include "hal_core/defines.h"
33 
34 #include <QColor>
35 #include <QList>
36 #include <QString>
37 #include <QVariant>
38 
39 namespace hal
40 {
47  class PinItem : public BaseTreeItem
48  {
49  public:
51 
52  void setData(QList<QVariant> data) override;
53  void setDataAtIndex(int index, QVariant& data) override;
54  void appendData(QVariant data) override;
55  int getColumnCount() const override;
56 
62 
63  QVariant getData(int column) const override;
64 
65  int row() const;
66 
67  u32 getId() const;
68  QString getName() const;
69  PinType getPinType() const;
70  PinDirection getDirection() const;
71  QString getPinTypeAsText() const;
73 
74  TreeItemType getItemType() const;
75 
81  void setName(const QString& name);
82  void setDirection(const QString& direction);
83  void setId(u32 newId);
84  void setType(const QString& type);
85 
87  void setType(PinType type);
88 
89  void setFields(GatePin* pin);
92 
93 
94  private:
95  TreeItemType mItemType;
96  u32 mId;
97  QString mName;
98  PinDirection mDirection;
99  PinType mType;
100 
101  };
102 }
(Future) Base class for all tree models related to the details widget.
An item in the PinModel.
Definition: pin_item.h:48
QString getPinTypeAsText() const
Definition: pin_item.cpp:91
QString getName() const
Definition: pin_item.cpp:81
void setDataAtIndex(int index, QVariant &data) override
Definition: pin_item.cpp:76
void setId(u32 newId)
Definition: pin_item.cpp:72
int row() const
Definition: pin_item.cpp:17
int getColumnCount() const override
Definition: pin_item.cpp:125
PinDirection getDirection() const
Definition: pin_item.cpp:96
u32 getId() const
Definition: pin_item.cpp:106
PinItem(TreeItemType type)
Definition: pin_item.cpp:10
TreeItemType getItemType() const
Definition: pin_item.cpp:132
PinType getPinType() const
Definition: pin_item.cpp:86
void setName(const QString &name)
Definition: pin_item.cpp:111
void setType(const QString &type)
Definition: pin_item.cpp:121
void setFields(GatePin *pin)
Definition: pin_item.cpp:148
void setData(QList< QVariant > data) override
Definition: pin_item.cpp:48
void setItemType(TreeItemType type)
Definition: pin_item.cpp:160
QString getDirectionAsText() const
Definition: pin_item.cpp:101
void appendData(QVariant data) override
Definition: pin_item.cpp:130
void setDirection(const QString &direction)
Definition: pin_item.cpp:116
QVariant getData(int column) const override
Definition: pin_item.cpp:24
PinDirection
Definition: pin_direction.h:36
PinType
Definition: pin_type.h:36
quint32 u32
PinType type
PinDirection direction
std::string name