LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
packagepad.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_LIBRARY_PACKAGEPAD_H
21 #define LIBREPCB_LIBRARY_PACKAGEPAD_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
31 
32 #include <QtCore>
33 
34 /*******************************************************************************
35  * Namespace / Forward Declarations
36  ******************************************************************************/
37 namespace librepcb {
38 namespace library {
39 
40 /*******************************************************************************
41  * Class PackagePad
42  ******************************************************************************/
43 
51 class PackagePad final : public SerializableObject {
52  Q_DECLARE_TR_FUNCTIONS(PackagePad)
53 
54 public:
55  // Signals
56  enum class Event {
59  };
62 
63  // Constructors / Destructor
64  PackagePad() = delete;
65  PackagePad(const PackagePad& other) noexcept;
66  PackagePad(const Uuid& uuid, const CircuitIdentifier& name) noexcept;
67  explicit PackagePad(const SExpression& node);
68  ~PackagePad() noexcept;
69 
70  // Getters
71  const Uuid& getUuid() const noexcept { return mUuid; }
72  CircuitIdentifier getName() const noexcept { return mName; }
73 
74  // Setters
75  bool setName(const CircuitIdentifier& name) noexcept;
76 
77  // General Methods
78 
80  void serialize(SExpression& root) const override;
81 
82  // Operator Overloadings
83  bool operator==(const PackagePad& rhs) const noexcept;
84  bool operator!=(const PackagePad& rhs) const noexcept {
85  return !(*this == rhs);
86  }
87  PackagePad& operator=(const PackagePad& rhs) noexcept;
88 
89 private: // Data
92 };
93 
94 /*******************************************************************************
95  * Class PackagePadList
96  ******************************************************************************/
97 
99  static constexpr const char* tagname = "pad";
100 };
101 using PackagePadList =
104 using CmdPackagePadInsert =
107 using CmdPackagePadRemove =
110 using CmdPackagePadsSwap =
113 
114 /*******************************************************************************
115  * End of File
116  ******************************************************************************/
117 
118 } // namespace library
119 } // namespace librepcb
120 
121 #endif // LIBREPCB_LIBRARY_PACKAGEPAD_H
Uuid mUuid
Definition: packagepad.h:90
The CmdListElementRemove class.
Definition: cmdlistelementremove.h:44
PackagePad & operator=(const PackagePad &rhs) noexcept
Definition: packagepad.cpp:87
Event
Definition: packagepad.h:56
bool setName(const CircuitIdentifier &name) noexcept
Definition: packagepad.cpp:58
CircuitIdentifier getName() const noexcept
Definition: packagepad.h:72
The SerializableObject class is the base class for all classes which need to be serializable/deserial...
Definition: serializableobject.h:43
The CmdListElementsSwap class.
Definition: cmdlistelementsswap.h:44
Signal< PackagePad, Event > onEdited
Definition: packagepad.h:60
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition: circuitidentifier.h:89
CircuitIdentifier mName
Definition: packagepad.h:91
const Uuid & getUuid() const noexcept
Definition: packagepad.h:71
The Signal class is used to emit signals on non-QObject derived classes.
Definition: signalslot.h:65
void serialize(SExpression &root) const override
Serialize the object into an existing S-Expression node.
Definition: packagepad.cpp:72
~PackagePad() noexcept
Definition: packagepad.cpp:51
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:44
Slot< PackagePad, Event > OnEditedSlot
Definition: packagepad.h:61
bool operator!=(const PackagePad &rhs) const noexcept
Definition: packagepad.h:84
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
bool operator==(const PackagePad &rhs) const noexcept
Definition: packagepad.cpp:81
static constexpr const char * tagname
Definition: packagepad.h:99
The Slot class is used to receive signals from non-QObject derived classes.
Definition: signalslot.h:36
The SExpression class.
Definition: sexpression.h:57
The PackagePad class represents one logical pad of a package.
Definition: packagepad.h:51