LibrePCB Developers Documentation
cmdaddcomponenttocircuit.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_CMDADDCOMPONENTTOCIRCUIT_H
21#define LIBREPCB_EDITOR_CMDADDCOMPONENTTOCIRCUIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommandgroup.h"
27
30
31#include <QtCore>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class Component;
39class ComponentInstance;
40class Project;
41class Workspace;
42
43namespace editor {
44
45class CmdComponentInstanceAdd;
46
47/*******************************************************************************
48 * Class CmdAddComponentToCircuit
49 ******************************************************************************/
50
55public:
56 // Constructors / Destructor
58 Workspace& workspace, Project& project, const Uuid& component,
59 const Uuid& symbolVariant,
60 const tl::optional<ComponentAssemblyOptionList>& options) noexcept;
62
63 // Getters
65
66private:
67 // Private Methods
68
70 bool performExecute() override;
71
72 // Private Member Variables
73
74 // Attributes from the constructor
79 tl::optional<ComponentAssemblyOptionList> mAssemblyOptions;
80
81 // child commands
83};
84
85/*******************************************************************************
86 * End of File
87 ******************************************************************************/
88
89} // namespace editor
90} // namespace librepcb
91
92#endif
The ComponentInstance class.
Definition: componentinstance.h:54
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The CmdAddComponentToCircuit class.
Definition: cmdaddcomponenttocircuit.h:54
~CmdAddComponentToCircuit() noexcept
Definition: cmdaddcomponenttocircuit.cpp:61
tl::optional< ComponentAssemblyOptionList > mAssemblyOptions
Definition: cmdaddcomponenttocircuit.h:79
CmdAddComponentToCircuit(Workspace &workspace, Project &project, const Uuid &component, const Uuid &symbolVariant, const tl::optional< ComponentAssemblyOptionList > &options) noexcept
Definition: cmdaddcomponenttocircuit.cpp:48
Uuid mComponentUuid
Definition: cmdaddcomponenttocircuit.h:77
Uuid mSymbVarUuid
Definition: cmdaddcomponenttocircuit.h:78
CmdComponentInstanceAdd * mCmdAddToCircuit
Definition: cmdaddcomponenttocircuit.h:82
ComponentInstance * getComponentInstance() const noexcept
Definition: cmdaddcomponenttocircuit.cpp:68
Project & mProject
Definition: cmdaddcomponenttocircuit.h:76
Workspace & mWorkspace
Definition: cmdaddcomponenttocircuit.h:75
bool performExecute() override
Execute the command the first time.
Definition: cmdaddcomponenttocircuit.cpp:78
The CmdComponentInstanceAdd class.
Definition: cmdcomponentinstanceadd.h:51
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition: undocommandgroup.h:44
Definition: occmodel.cpp:77