LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
categorychooserdialog.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_LIBRARY_EDITOR_CATEGORYCHOOSERDIALOG_H
21 #define LIBREPCB_LIBRARY_EDITOR_CATEGORYCHOOSERDIALOG_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include <librepcb/common/uuid.h>
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 namespace workspace {
38 class Workspace;
39 }
40 
41 namespace library {
42 namespace editor {
43 
44 namespace Ui {
45 class CategoryChooserDialog;
46 }
47 
48 /*******************************************************************************
49  * Class CategoryChooserDialog
50  ******************************************************************************/
51 
58 template <typename ElementType>
59 class CategoryChooserDialog final : public QDialog {
60 public:
61  // Constructors / Destructor
62  CategoryChooserDialog() = delete;
63  CategoryChooserDialog(const CategoryChooserDialog& other) = delete;
65  QWidget* parent = 0) noexcept;
66  ~CategoryChooserDialog() noexcept;
67 
68  // Getters
69  tl::optional<Uuid> getSelectedCategoryUuid() const noexcept;
70 
71  // Operator Overloadings
73 
74 private: // Data
75  QScopedPointer<Ui::CategoryChooserDialog> mUi;
76  QScopedPointer<workspace::CategoryTreeModel<ElementType>> mModel;
77 };
78 
83 
84 /*******************************************************************************
85  * End of File
86  ******************************************************************************/
87 
88 } // namespace editor
89 } // namespace library
90 } // namespace librepcb
91 
92 #endif // LIBREPCB_LIBRARY_EDITOR_CATEGORYCHOOSERDIALOG_H
CategoryChooserDialog< library::ComponentCategory > ComponentCategoryChooserDialog
Definition: categorychooserdialog.h:80
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
Definition: workspace.h:65
tl::optional< Uuid > getSelectedCategoryUuid() const noexcept
Definition: categorychooserdialog.cpp:68
The CategoryChooserDialog class.
Definition: categorychooserdialog.h:59
QScopedPointer< Ui::CategoryChooserDialog > mUi
Definition: categorychooserdialog.h:75
QScopedPointer< workspace::CategoryTreeModel< ElementType > > mModel
Definition: categorychooserdialog.h:76
~CategoryChooserDialog() noexcept
Definition: categorychooserdialog.cpp:60
CategoryChooserDialog & operator=(const CategoryChooserDialog &rhs)=delete
CategoryChooserDialog< library::PackageCategory > PackageCategoryChooserDialog
Definition: categorychooserdialog.h:82