LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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 ******************************************************************************/
35namespace librepcb {
36
37/*******************************************************************************
38 * Class ComponentCategory
39 ******************************************************************************/
40
44class ComponentCategory final : public LibraryCategory {
45 Q_OBJECT
46
47public:
48 // Constructors / Destructor
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 bool abortBeforeMigration = false);
64 static QString getShortElementName() noexcept {
65 return QStringLiteral("cmpcat");
66 }
67 static QString getLongElementName() noexcept {
68 return QStringLiteral("component_category");
69 }
70
71private: // Methods
72 ComponentCategory(std::unique_ptr<TransactionalDirectory> directory,
73 const SExpression& root);
74};
75
76/*******************************************************************************
77 * End of File
78 ******************************************************************************/
79
80} // namespace librepcb
81
82#endif
The ComponentCategory class.
Definition componentcategory.h:44
ComponentCategory(const ComponentCategory &other)=delete
static QString getLongElementName() noexcept
Definition componentcategory.h:67
~ComponentCategory() noexcept
Definition componentcategory.cpp:53
static std::unique_ptr< ComponentCategory > open(std::unique_ptr< TransactionalDirectory > directory, bool abortBeforeMigration=false)
Definition componentcategory.cpp:60
static QString getShortElementName() noexcept
Definition componentcategory.h:64
The LibraryCategory class extends the LibraryBaseElement class with some attributes and methods which...
Definition librarycategory.h:43
The SExpression class.
Definition sexpression.h:69
Helper class to access a subdirectory of TransactionalFileSystem.
Definition transactionaldirectory.h:51
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The Version class represents a version number in the format "1.42.7".
Definition version.h:58
Definition occmodel.cpp:76
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84
Definition uuid.h:186