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  ******************************************************************************/
36 namespace librepcb {
37 
38 class Project;
39 class Workspace;
40 
41 namespace editor {
42 
43 class NewProjectWizardPage_EagleImport;
44 class NewProjectWizardPage_Initialization;
45 class NewProjectWizardPage_Metadata;
46 
47 namespace Ui {
48 class NewProjectWizard;
49 }
50 
51 /*******************************************************************************
52  * Class NewProjectWizard
53  ******************************************************************************/
54 
58 class NewProjectWizard final : public QWizard {
59  Q_OBJECT
60 
61 public:
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 
81 private: // 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
Definition: occmodel.cpp:77
NewProjectWizardPage_Metadata * mPageMetadata
Definition: newprojectwizard.h:86
NewProjectWizardPage_EagleImport * mPageEagleImport
Definition: newprojectwizard.h:85
The NewProjectWizardPage_EagleImport class.
Definition: newprojectwizardpage_eagleimport.h:57
Mode
Definition: newprojectwizard.h:63
QScopedPointer< Ui::NewProjectWizard > mUi
Definition: newprojectwizard.h:84
The NewProjectWizard class.
Definition: newprojectwizard.h:58
The NewProjectWizardPage_Initialization class.
Definition: newprojectwizardpage_initialization.h:46
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
const Workspace & mWorkspace
Definition: newprojectwizard.h:82
The NewProjectWizardPage_Metadata class.
Definition: newprojectwizardpage_metadata.h:51
NewProjectWizardPage_Initialization * mPageInitialization
Definition: newprojectwizard.h:87
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
Definition: workspace.h:54
const Mode mMode
Definition: newprojectwizard.h:83