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