LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_LIBRARY_LIBRARYCATEGORY_H
21 #define LIBREPCB_LIBRARY_LIBRARYCATEGORY_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../librarybaseelement.h"
27 
28 #include <QtCore>
29 
30 /*******************************************************************************
31  * Namespace / Forward Declarations
32  ******************************************************************************/
33 namespace librepcb {
34 namespace library {
35 
36 /*******************************************************************************
37  * Class LibraryCategory
38  ******************************************************************************/
39 
45  Q_OBJECT
46 
47 public:
48  // Constructors / Destructor
49  LibraryCategory() = delete;
50  LibraryCategory(const LibraryCategory& other) = delete;
51  LibraryCategory(const QString& shortElementName,
52  const QString& longElementName, const Uuid& uuid,
53  const Version& version, const QString& author,
54  const ElementName& name_en_US,
55  const QString& description_en_US,
56  const QString& keywords_en_US);
57  LibraryCategory(std::unique_ptr<TransactionalDirectory> directory,
58  const QString& shortElementName,
59  const QString& longElementName);
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
73  LibraryCategory& operator=(const LibraryCategory& rhs) = delete;
74 
75 protected:
76  // Protected Methods
77 
79  virtual void serialize(SExpression& root) const override;
80 
81  // General Library Category Attributes
82  tl::optional<Uuid> mParentUuid;
83 };
84 
85 /*******************************************************************************
86  * End of File
87  ******************************************************************************/
88 
89 } // namespace library
90 } // namespace librepcb
91 
92 #endif // LIBREPCB_LIBRARY_LIBRARYCATEGORY_H
The Version class represents a version number in the format "1.42.7".
Definition: version.h:60
virtual void serialize(SExpression &root) const override
Serialize the object into an existing S-Expression node.
Definition: librarycategory.cpp:66
The LibraryBaseElement class.
Definition: librarybaseelement.h:52
virtual ~LibraryCategory() noexcept
Definition: librarycategory.cpp:59
The LibraryCategory class extends the LibraryBaseElement class with some attributes and methods which...
Definition: librarycategory.h:44
LibraryCategory & operator=(const LibraryCategory &rhs)=delete
tl::optional< Uuid > mParentUuid
Definition: librarycategory.h:82
void setParentUuid(const tl::optional< Uuid > &parentUuid) noexcept
Definition: librarycategory.h:68
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
const tl::optional< Uuid > & getParentUuid() const noexcept
Definition: librarycategory.h:63
The SExpression class.
Definition: sexpression.h:60
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:92