LibrePCB Developers Documentation
boarddesignrulesdialog.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_BOARDDESIGNRULESDIALOG_H
21 #define LIBREPCB_BOARDDESIGNRULESDIALOG_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../boarddesignrules.h"
27 
28 #include <QtCore>
29 #include <QtWidgets>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 
36 namespace Ui {
37 class BoardDesignRulesDialog;
38 }
39 
40 /*******************************************************************************
41  * Class BoardDesignRulesDialog
42  ******************************************************************************/
43 
47 class BoardDesignRulesDialog final : public QDialog {
48  Q_OBJECT
49 
50 public:
51  // Constructors / Destructor
52  BoardDesignRulesDialog() = delete;
53  BoardDesignRulesDialog(const BoardDesignRulesDialog& other) = delete;
55  const LengthUnit& lengthUnit,
56  const QString& settingsPrefix, QWidget* parent = 0);
58 
59  // Getters
60  const BoardDesignRules& getDesignRules() const noexcept {
61  return mDesignRules;
62  }
63 
64  // Operator Overloadings
65  BoardDesignRulesDialog& operator=(const BoardDesignRulesDialog& rhs) = delete;
66 
67 signals:
68 
69  void rulesChanged(const BoardDesignRules& newRules);
70 
71 private slots:
72 
73  void on_buttonBox_clicked(QAbstractButton* button);
74 
75 private:
76  void updateWidgets() noexcept;
77  void applyRules() noexcept;
78 
79  Ui::BoardDesignRulesDialog* mUi;
81 };
82 
83 /*******************************************************************************
84  * End of File
85  ******************************************************************************/
86 
87 } // namespace librepcb
88 
89 #endif // LIBREPCB_BOARDDESIGNRULESDIALOG_H
const BoardDesignRules & getDesignRules() const noexcept
Definition: boarddesignrulesdialog.h:60
Definition: mainwindow.h:10
Definition: airwiresbuilder.cpp:32
Ui::BoardDesignRulesDialog * mUi
Definition: boarddesignrulesdialog.h:79
The BoardDesignRules class.
Definition: boarddesignrules.h:45
The BoardDesignRulesDialog class.
Definition: boarddesignrulesdialog.h:47
BoardDesignRules mDesignRules
Definition: boarddesignrulesdialog.h:80
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:62