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;
71  NewElementWizard(const workspace::Workspace& ws, const Library& lib,
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
82  bool validateCurrentPage() noexcept override;
83 
84  // Operator Overloadings
85  NewElementWizard& operator=(const NewElementWizard& rhs) = delete;
86 
87 private: // Methods
88  void insertPage(int index, QWizardPage* page) noexcept;
89 
90 private: // Data
91  QScopedPointer<Ui::NewElementWizard> mUi;
93  QList<QWizardPage*> mPages;
94 };
95 
96 /*******************************************************************************
97  * End of File
98  ******************************************************************************/
99 
100 } // namespace editor
101 } // namespace library
102 } // namespace librepcb
103 
104 #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:89
The Library class represents a library directory.
Definition: library.h:49
QList< QWizardPage * > mPages
Definition: newelementwizard.h:93
The NewElementWizardContext class.
Definition: newelementwizardcontext.h:63
QScopedPointer< Ui::NewElementWizard > mUi
Definition: newelementwizard.h:91
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers...
Definition: graphicslayer.h:250
~NewElementWizard() noexcept
Definition: newelementwizard.cpp:79
void insertPage(int index, QWizardPage *page) noexcept
Definition: newelementwizard.cpp:109
The NewElementWizard class.
Definition: newelementwizard.h:64
QScopedPointer< NewElementWizardContext > mContext
Definition: newelementwizard.h:92