LibrePCB Developers Documentation
newelementwizard.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_NEWELEMENTWIZARD_H
21#define LIBREPCB_EDITOR_NEWELEMENTWIZARD_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Library;
37class Workspace;
38
39namespace editor {
40
41class IF_GraphicsLayerProvider;
42class NewElementWizardContext;
43
44namespace Ui {
45class NewElementWizard;
46}
47
48/*******************************************************************************
49 * Class NewElementWizard
50 ******************************************************************************/
51
55class NewElementWizard final : public QWizard {
56 Q_OBJECT
57
58public:
59 // Constructors / Destructor
60 NewElementWizard() = delete;
61 NewElementWizard(const NewElementWizard& other) = delete;
62 NewElementWizard(const Workspace& ws, Library& lib,
64 QWidget* parent = 0) noexcept;
65 ~NewElementWizard() noexcept;
66
67 // Getters
68 const NewElementWizardContext& getContext() const noexcept {
69 return *mContext;
70 }
71
72 // General Methods
75 const FilePath& fp) noexcept;
76 bool validateCurrentPage() noexcept override;
77
78 // Operator Overloadings
79 NewElementWizard& operator=(const NewElementWizard& rhs) = delete;
80
81private: // Methods
82 void insertPage(int index, QWizardPage* page) noexcept;
83
84private: // Data
85 QScopedPointer<Ui::NewElementWizard> mUi;
87 QList<QWizardPage*> mPages;
88};
89
90/*******************************************************************************
91 * End of File
92 ******************************************************************************/
93
94} // namespace editor
95} // namespace librepcb
96
97#endif
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
The Library class represents a library directory.
Definition: library.h:46
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers.
Definition: graphicslayer.h:111
The NewElementWizardContext class.
Definition: newelementwizardcontext.h:58
ElementType
Definition: newelementwizardcontext.h:77
The NewElementWizard class.
Definition: newelementwizard.h:55
void setNewElementType(NewElementWizardContext::ElementType type) noexcept
Definition: newelementwizard.cpp:87
NewElementWizard(const NewElementWizard &other)=delete
QScopedPointer< Ui::NewElementWizard > mUi
Definition: newelementwizard.h:85
QList< QWizardPage * > mPages
Definition: newelementwizard.h:87
void setElementToCopy(NewElementWizardContext::ElementType type, const FilePath &fp) noexcept
Definition: newelementwizard.cpp:93
QScopedPointer< NewElementWizardContext > mContext
Definition: newelementwizard.h:86
bool validateCurrentPage() noexcept override
Definition: newelementwizard.cpp:105
const NewElementWizardContext & getContext() const noexcept
Definition: newelementwizard.h:68
void insertPage(int index, QWizardPage *page) noexcept
Definition: newelementwizard.cpp:125
Definition: occmodel.cpp:77