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 
55 template <typename ElementType>
56 class CategoryChooserDialog final : public QDialog {
57 public:
58  // Constructors / Destructor
59  CategoryChooserDialog() = delete;
60  CategoryChooserDialog(const CategoryChooserDialog& other) = delete;
62  QWidget* parent = 0) noexcept;
63  ~CategoryChooserDialog() noexcept;
64 
65  // Getters
66  tl::optional<Uuid> getSelectedCategoryUuid() const noexcept;
67 
68  // Operator Overloadings
70 
71 private: // Data
72  QScopedPointer<Ui::CategoryChooserDialog> mUi;
73  QScopedPointer<workspace::CategoryTreeModel<ElementType>> mModel;
74 };
75 
80 
81 /*******************************************************************************
82  * End of File
83  ******************************************************************************/
84 
85 } // namespace editor
86 } // namespace library
87 } // namespace librepcb
88 
89 #endif // LIBREPCB_LIBRARY_EDITOR_CATEGORYCHOOSERDIALOG_H
CategoryChooserDialog< library::ComponentCategory > ComponentCategoryChooserDialog
Definition: categorychooserdialog.h:77
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
Definition: workspace.h:62
tl::optional< Uuid > getSelectedCategoryUuid() const noexcept
Definition: categorychooserdialog.cpp:68
The CategoryChooserDialog class.
Definition: categorychooserdialog.h:56
QScopedPointer< Ui::CategoryChooserDialog > mUi
Definition: categorychooserdialog.h:72
QScopedPointer< workspace::CategoryTreeModel< ElementType > > mModel
Definition: categorychooserdialog.h:73
~CategoryChooserDialog() noexcept
Definition: categorychooserdialog.cpp:60
CategoryChooserDialog & operator=(const CategoryChooserDialog &rhs)=delete
CategoryChooserDialog< library::PackageCategory > PackageCategoryChooserDialog
Definition: categorychooserdialog.h:79