LibrePCB Developers Documentation
newprojectwizard.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_NEWPROJECTWIZARD_H
21#define LIBREPCB_EDITOR_NEWPROJECTWIZARD_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31#include <memory>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class Project;
39class Workspace;
40
41namespace editor {
42
43class NewProjectWizardPage_EagleImport;
44class NewProjectWizardPage_Initialization;
45class NewProjectWizardPage_Metadata;
46
47namespace Ui {
48class NewProjectWizard;
49}
50
51/*******************************************************************************
52 * Class NewProjectWizard
53 ******************************************************************************/
54
58class NewProjectWizard final : public QWizard {
59 Q_OBJECT
60
61public:
62 // Types
63 enum class Mode { NewProject, EagleImport };
64
65 // Constructors / Destructor
66 NewProjectWizard() = delete;
67 NewProjectWizard(const NewProjectWizard& other) = delete;
68 explicit NewProjectWizard(const Workspace& ws, Mode mode,
69 QWidget* parent = nullptr) noexcept;
70 ~NewProjectWizard() noexcept;
71
72 // Setters
73 void setLocationOverride(const FilePath& dir) noexcept;
74
75 // General Methods
76 std::unique_ptr<Project> createProject() const;
77
78 // Operator Overloadings
79 NewProjectWizard& operator=(const NewProjectWizard& rhs) = delete;
80
81private: // Data
83 const Mode mMode;
84 QScopedPointer<Ui::NewProjectWizard> mUi;
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 Project class represents a whole (opened) project with all its content.
Definition: project.h:71
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The NewProjectWizard class.
Definition: newprojectwizard.h:58
NewProjectWizardPage_EagleImport * mPageEagleImport
Definition: newprojectwizard.h:85
Mode
Definition: newprojectwizard.h:63
NewProjectWizard(const NewProjectWizard &other)=delete
void setLocationOverride(const FilePath &dir) noexcept
Definition: newprojectwizard.cpp:99
NewProjectWizardPage_Initialization * mPageInitialization
Definition: newprojectwizard.h:87
const Workspace & mWorkspace
Definition: newprojectwizard.h:82
QScopedPointer< Ui::NewProjectWizard > mUi
Definition: newprojectwizard.h:84
std::unique_ptr< Project > createProject() const
Definition: newprojectwizard.cpp:107
NewProjectWizardPage_Metadata * mPageMetadata
Definition: newprojectwizard.h:86
const Mode mMode
Definition: newprojectwizard.h:83
The NewProjectWizardPage_EagleImport class.
Definition: newprojectwizardpage_eagleimport.h:57
The NewProjectWizardPage_Initialization class.
Definition: newprojectwizardpage_initialization.h:46
The NewProjectWizardPage_Metadata class.
Definition: newprojectwizardpage_metadata.h:51
Definition: occmodel.cpp:77