LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
alignmentselector.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_ALIGNMENTSELECTOR_H
21 #define LIBREPCB_ALIGNMENTSELECTOR_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../alignment.h"
27 
28 #include <QtCore>
29 #include <QtWidgets>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 
36 namespace Ui {
37 class AlignmentSelector;
38 }
39 
40 /*******************************************************************************
41  * Class AlignmentSelector
42  ******************************************************************************/
43 
50 class AlignmentSelector final : public QWidget {
51  Q_OBJECT
52 
53 public:
54  // Constructors / Destructor
55  explicit AlignmentSelector(QWidget* parent = nullptr) noexcept;
56  AlignmentSelector(const AlignmentSelector& other) = delete;
57  ~AlignmentSelector() noexcept;
58 
59  // General Methods
60  Alignment getAlignment() const noexcept;
61  void setAlignment(const Alignment& align) noexcept;
62 
63  // Operator Overloadings
64  AlignmentSelector& operator=(const AlignmentSelector& rhs) = delete;
65 
66 private: // Data
67  QScopedPointer<Ui::AlignmentSelector> mUi;
68  QMap<QRadioButton*, Alignment> mLookupTable;
69 };
70 
71 /*******************************************************************************
72  * End of File
73  ******************************************************************************/
74 
75 } // namespace librepcb
76 
77 #endif // LIBREPCB_ALIGNMENTSELECTOR_H
void setAlignment(const Alignment &align) noexcept
Definition: alignmentselector.cpp:69
QScopedPointer< Ui::AlignmentSelector > mUi
Definition: alignmentselector.h:67
The Alignment class.
Definition: alignment.h:193
AlignmentSelector(QWidget *parent=nullptr) noexcept
Definition: alignmentselector.cpp:39
The AlignmentSelector class.
Definition: alignmentselector.h:50
~AlignmentSelector() noexcept
Definition: alignmentselector.cpp:54
AlignmentSelector & operator=(const AlignmentSelector &rhs)=delete
QMap< QRadioButton *, Alignment > mLookupTable
Definition: alignmentselector.h:68
Alignment getAlignment() const noexcept
Definition: alignmentselector.cpp:61