LibrePCB Developers Documentation
librarycategory.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_CORE_LIBRARYCATEGORY_H
21#define LIBREPCB_CORE_LIBRARYCATEGORY_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../librarybaseelement.h"
27
28#include <QtCore>
29
30/*******************************************************************************
31 * Namespace / Forward Declarations
32 ******************************************************************************/
33namespace librepcb {
34
35/*******************************************************************************
36 * Class LibraryCategory
37 ******************************************************************************/
38
44 Q_OBJECT
45
46public:
47 // Constructors / Destructor
48 LibraryCategory() = delete;
49 LibraryCategory(const LibraryCategory& other) = delete;
50 LibraryCategory(const QString& shortElementName,
51 const QString& longElementName, const Uuid& uuid,
52 const Version& version, const QString& author,
53 const ElementName& name_en_US,
54 const QString& description_en_US,
55 const QString& keywords_en_US);
56 LibraryCategory(const QString& shortElementName,
57 const QString& longElementName,
58 std::unique_ptr<TransactionalDirectory> directory,
59 const SExpression& root);
60 virtual ~LibraryCategory() noexcept;
61
62 // Getters: Attributes
63 const tl::optional<Uuid>& getParentUuid() const noexcept {
64 return mParentUuid;
65 }
66
67 // Setters: Attributes
68 void setParentUuid(const tl::optional<Uuid>& parentUuid) noexcept {
69 mParentUuid = parentUuid;
70 }
71
72 // Operator Overloadings
74
75protected:
76 virtual void serialize(SExpression& root) const override;
77
78 tl::optional<Uuid> mParentUuid;
79};
80
81/*******************************************************************************
82 * End of File
83 ******************************************************************************/
84
85} // namespace librepcb
86
87#endif
The LibraryBaseElement class.
Definition: librarybaseelement.h:48
The LibraryCategory class extends the LibraryBaseElement class with some attributes and methods which...
Definition: librarycategory.h:43
virtual ~LibraryCategory() noexcept
Definition: librarycategory.cpp:55
tl::optional< Uuid > mParentUuid
Definition: librarycategory.h:78
LibraryCategory & operator=(const LibraryCategory &rhs)=delete
void setParentUuid(const tl::optional< Uuid > &parentUuid) noexcept
Definition: librarycategory.h:68
const tl::optional< Uuid > & getParentUuid() const noexcept
Definition: librarycategory.h:63
virtual void serialize(SExpression &root) const override
Serialize into librepcb::SExpression node.
Definition: librarycategory.cpp:62
LibraryCategory(const LibraryCategory &other)=delete
The SExpression class.
Definition: sexpression.h:69
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The Version class represents a version number in the format "1.42.7".
Definition: version.h:58
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84
Definition: uuid.h:183