LibrePCB Developers Documentation
Loading...
Searching...
No Matches
newelementwizardcontext.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_EDITOR_NEWELEMENTWIZARDCONTEXT_H
21#define LIBREPCB_EDITOR_NEWELEMENTWIZARDCONTEXT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
35
36#include <QtCore>
37#include <QtWidgets>
38
39/*******************************************************************************
40 * Namespace / Forward Declarations
41 ******************************************************************************/
42namespace librepcb {
43
44class Library;
45class Workspace;
46
47namespace editor {
48
49class GraphicsLayerList;
50
51/*******************************************************************************
52 * Class NewElementWizardContext
53 ******************************************************************************/
54
58class NewElementWizardContext final : public QObject {
59 Q_OBJECT
60
61public:
62 // Types
63
76
77 enum class ElementType {
78 None,
81 Symbol,
82 Package,
84 Device,
85 };
86
87 // Constructors / Destructor
91 const GraphicsLayerList& layers,
92 QObject* parent = nullptr) noexcept;
93 ~NewElementWizardContext() noexcept;
94
95 // Getters
96 const FilePath& getOutputDirectory() const noexcept {
97 return mOutputDirectory;
98 }
99 const Workspace& getWorkspace() const noexcept { return mWorkspace; }
100 const GraphicsLayerList& getLayers() const noexcept { return mLayers; }
101 const QStringList& getLibLocaleOrder() const noexcept;
102
103 // General Methods
104 void reset(ElementType newType = ElementType::None) noexcept;
105 void copyElement(ElementType type, const FilePath& fp);
107
108 // Operator Overloadings
110 delete;
111
112private: // Data
117
118public: // Data
119 // common
120 QHash<QString, QByteArray> mFiles;
128
129 // symbol
134
135 // package
140
141 // component
148
149 // device
155};
156
157/*******************************************************************************
158 * End of File
159 ******************************************************************************/
160
161} // namespace editor
162} // namespace librepcb
163
164#endif
This class represents absolute, well-formatted paths to files or directories.
Definition filepath.h:127
The Library class represents a library directory.
Definition library.h:46
The Package class represents a package of a component (including footprint and 3D model)
Definition package.h:59
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
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition workspace.h:54
The GraphicsLayerList class.
Definition graphicslayerlist.h:48
The NewElementWizardContext class.
Definition newelementwizardcontext.h:58
PackagePadList mPackagePads
Definition newelementwizardcontext.h:137
std::optional< Uuid > mDeviceComponentUuid
Definition newelementwizardcontext.h:150
ElementType
Definition newelementwizardcontext.h:77
ComponentSymbolVariantList mComponentSymbolVariants
Definition newelementwizardcontext.h:147
Library & mLibrary
Definition newelementwizardcontext.h:114
bool mComponentSchematicOnly
Definition newelementwizardcontext.h:142
FilePath mOutputDirectory
Definition newelementwizardcontext.h:116
void reset(ElementType newType=ElementType::None) noexcept
Definition newelementwizardcontext.cpp:75
const QStringList & getLibLocaleOrder() const noexcept
Definition newelementwizardcontext.cpp:67
QSet< Uuid > mElementCategoryUuids
Definition newelementwizardcontext.h:127
PageId
Definition newelementwizardcontext.h:64
@ ID_ComponentPinSignalMap
Definition newelementwizardcontext.h:73
@ ID_None
last page
Definition newelementwizardcontext.h:65
@ ID_ChooseType
Definition newelementwizardcontext.h:66
@ ID_DeviceProperties
Definition newelementwizardcontext.h:74
@ ID_ComponentSignals
Definition newelementwizardcontext.h:72
@ ID_ComponentSymbols
Definition newelementwizardcontext.h:71
@ ID_EnterMetadata
Definition newelementwizardcontext.h:68
@ ID_PackagePads
Definition newelementwizardcontext.h:69
@ ID_CopyFrom
Definition newelementwizardcontext.h:67
@ ID_ComponentProperties
Definition newelementwizardcontext.h:70
std::optional< Uuid > mDevicePackageUuid
Definition newelementwizardcontext.h:151
QHash< QString, QByteArray > mFiles
Definition newelementwizardcontext.h:120
QString mElementKeywords
Definition newelementwizardcontext.h:124
QString mElementAuthor
Definition newelementwizardcontext.h:125
std::optional< Version > mElementVersion
Definition newelementwizardcontext.h:126
const GraphicsLayerList & mLayers
Definition newelementwizardcontext.h:115
PackageModelList mPackageModels
Definition newelementwizardcontext.h:138
std::optional< ElementName > mElementName
Definition newelementwizardcontext.h:122
FootprintList mPackageFootprints
Definition newelementwizardcontext.h:139
AttributeList mComponentAttributes
Definition newelementwizardcontext.h:143
DevicePadSignalMap mDevicePadSignalMap
Definition newelementwizardcontext.h:152
void createLibraryElement()
Definition newelementwizardcontext.cpp:372
const GraphicsLayerList & getLayers() const noexcept
Definition newelementwizardcontext.h:100
TextList mSymbolTexts
Definition newelementwizardcontext.h:133
const Workspace & mWorkspace
Definition newelementwizardcontext.h:113
Package::AssemblyType mPackageAssemblyType
Definition newelementwizardcontext.h:136
CircleList mSymbolCircles
Definition newelementwizardcontext.h:132
QString mComponentDefaultValue
Definition newelementwizardcontext.h:144
const FilePath & getOutputDirectory() const noexcept
Definition newelementwizardcontext.h:96
void copyElement(ElementType type, const FilePath &fp)
Definition newelementwizardcontext.cpp:114
ComponentSignalList mComponentSignals
Definition newelementwizardcontext.h:146
NewElementWizardContext(const NewElementWizardContext &other)=delete
const Workspace & getWorkspace() const noexcept
Definition newelementwizardcontext.h:99
SymbolPinList mSymbolPins
Definition newelementwizardcontext.h:130
ElementType mElementType
Definition newelementwizardcontext.h:121
QString mElementDescription
Definition newelementwizardcontext.h:123
PartList mDeviceParts
Definition newelementwizardcontext.h:154
PolygonList mSymbolPolygons
Definition newelementwizardcontext.h:131
AttributeList mDeviceAttributes
Definition newelementwizardcontext.h:153
NormDependentPrefixMap mComponentPrefixes
Definition newelementwizardcontext.h:145
Definition occmodel.cpp:77
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84
Definition uuid.h:186