LibrePCB Developers Documentation
componentcategory.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_COMPONENTCATEGORY_H
21 #define LIBREPCB_CORE_COMPONENTCATEGORY_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "librarycategory.h"
27 
28 #include <QtCore>
29 
30 #include <memory>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 /*******************************************************************************
38  * Class ComponentCategory
39  ******************************************************************************/
40 
44 class ComponentCategory final : public LibraryCategory {
45  Q_OBJECT
46 
47 public:
48  // Constructors / Destructor
49  ComponentCategory() = delete;
50  ComponentCategory(const ComponentCategory& other) = delete;
51  ComponentCategory(const Uuid& uuid, const Version& version,
52  const QString& author, const ElementName& name_en_US,
53  const QString& description_en_US,
54  const QString& keywords_en_US);
55  ~ComponentCategory() noexcept;
56 
57  // Operator Overloadings
58  ComponentCategory& operator=(const ComponentCategory& rhs) = delete;
59 
60  // Static Methods
61  static std::unique_ptr<ComponentCategory> open(
62  std::unique_ptr<TransactionalDirectory> directory);
63  static QString getShortElementName() noexcept {
64  return QStringLiteral("cmpcat");
65  }
66  static QString getLongElementName() noexcept {
67  return QStringLiteral("component_category");
68  }
69 
70 private: // Methods
71  ComponentCategory(std::unique_ptr<TransactionalDirectory> directory,
72  const SExpression& root);
73 };
74 
75 /*******************************************************************************
76  * End of File
77  ******************************************************************************/
78 
79 } // namespace librepcb
80 
81 #endif
The Version class represents a version number in the format "1.42.7".
Definition: version.h:58
The LibraryCategory class extends the LibraryBaseElement class with some attributes and methods which...
Definition: librarycategory.h:43
static QString getShortElementName() noexcept
Definition: componentcategory.h:63
Definition: airwiresbuilder.cpp:34
~ComponentCategory() noexcept
Definition: componentcategory.cpp:53
static QString getLongElementName() noexcept
Definition: componentcategory.h:66
ComponentCategory & operator=(const ComponentCategory &rhs)=delete
The ComponentCategory class.
Definition: componentcategory.h:44
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:56
The SExpression class.
Definition: sexpression.h:67
static std::unique_ptr< ComponentCategory > open(std::unique_ptr< TransactionalDirectory > directory)
Definition: componentcategory.cpp:60
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:93