LibrePCB Developers Documentation
boardlayersdock.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_PROJECT_BOARDLAYERDOCK_H
21 #define LIBREPCB_PROJECT_BOARDLAYERDOCK_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include <QtCore>
27 #include <QtWidgets>
28 
29 /*******************************************************************************
30  * Namespace / Forward Declarations
31  ******************************************************************************/
32 namespace librepcb {
33 
34 class GraphicsLayer;
35 
36 namespace project {
37 
38 class Project;
39 class Board;
40 class ComponentInstance;
41 
42 namespace editor {
43 
44 class BoardEditor;
45 
46 namespace Ui {
47 class BoardLayersDock;
48 }
49 
50 /*******************************************************************************
51  * Class BoardLayersDock
52  ******************************************************************************/
53 
57 class BoardLayersDock final : public QDockWidget {
58  Q_OBJECT
59 
60 public:
61  // Constructors / Destructor
62  explicit BoardLayersDock(BoardEditor& editor) noexcept;
63  ~BoardLayersDock() noexcept;
64 
65  // Setters
66  void setActiveBoard(Board* board);
67 
68 private slots:
69 
70  void on_listWidget_itemChanged(QListWidgetItem* item);
71  void on_btnTop_clicked();
72  void on_btnBottom_clicked();
73  void on_btnTopBottom_clicked();
74  void on_btnAll_clicked();
75  void on_btnNone_clicked();
76 
77 private:
78  // make some methods inaccessible...
80  BoardLayersDock(const BoardLayersDock& other);
81  BoardLayersDock& operator=(const BoardLayersDock& rhs);
82 
83  // Private Methods
84  void updateListWidget() noexcept;
85  void setVisibleLayers(const QList<QString>& layers) noexcept;
86  QList<QString> getCommonLayers() const noexcept;
87  QList<QString> getTopLayers() const noexcept;
88  QList<QString> getBottomLayers() const noexcept;
89  QList<QString> getAllLayers() const noexcept;
90 
91  // General
92  QScopedPointer<Ui::BoardLayersDock> mUi;
95  QMetaObject::Connection mActiveBoardConnection;
96 };
97 
98 /*******************************************************************************
99  * End of File
100  ******************************************************************************/
101 
102 } // namespace editor
103 } // namespace project
104 } // namespace librepcb
105 
106 #endif // LIBREPCB_PROJECT_BOARDLAYERDOCK_H
QMetaObject::Connection mActiveBoardConnection
Definition: boardlayersdock.h:95
Definition: mainwindow.h:10
The BoardEditor class.
Definition: boardeditor.h:68
Board * mActiveBoard
Definition: boardlayersdock.h:94
Definition: airwiresbuilder.cpp:32
BoardEditor & mBoardEditor
Definition: boardlayersdock.h:93
QScopedPointer< Ui::BoardLayersDock > mUi
Definition: boardlayersdock.h:92
The BoardLayersDock class.
Definition: boardlayersdock.h:57
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:83