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_EDITOR_BOARDLAYERSDOCK_H
21#define LIBREPCB_EDITOR_BOARDLAYERSDOCK_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../graphics/graphicslayer.h"
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35namespace editor {
36
37namespace Ui {
38class BoardLayersDock;
39}
40
41/*******************************************************************************
42 * Class BoardLayersDock
43 ******************************************************************************/
44
48class BoardLayersDock final : public QDockWidget {
49 Q_OBJECT
50
51public:
52 // Constructors / Destructor
53 BoardLayersDock() = delete;
54 BoardLayersDock(const BoardLayersDock& other) = delete;
55 explicit BoardLayersDock(const IF_GraphicsLayerProvider& lp) noexcept;
56 ~BoardLayersDock() noexcept;
57
58 // Operator Overloadings
59 BoardLayersDock& operator=(const BoardLayersDock& rhs) = delete;
60
61signals:
63
64private slots:
65 void on_listWidget_itemChanged(QListWidgetItem* item);
66 void on_btnTop_clicked();
69 void on_btnAll_clicked();
70 void on_btnNone_clicked();
71
72private:
73 // Private Methods
74 void layerEdited(const GraphicsLayer& layer,
75 GraphicsLayer::Event event) noexcept;
76 void updateListWidget() noexcept;
77 void setVisibleLayers(const QList<QString>& layers) noexcept;
78 QList<QString> getCommonLayers() const noexcept;
79 QList<QString> getTopLayers() const noexcept;
80 QList<QString> getBottomLayers() const noexcept;
81 QList<QString> getAllLayers() const noexcept;
82
83 // General
85 QScopedPointer<Ui::BoardLayersDock> mUi;
87
88 // Slots
90};
91
92/*******************************************************************************
93 * End of File
94 ******************************************************************************/
95
96} // namespace editor
97} // namespace librepcb
98
99#endif
The BoardLayersDock class.
Definition: boardlayersdock.h:48
void on_btnNone_clicked()
Definition: boardlayersdock.cpp:96
QList< QString > getBottomLayers() const noexcept
Definition: boardlayersdock.cpp:199
void on_btnTop_clicked()
Definition: boardlayersdock.cpp:72
~BoardLayersDock() noexcept
Definition: boardlayersdock.cpp:58
void on_btnTopBottom_clicked()
Definition: boardlayersdock.cpp:84
void setVisibleLayers(const QList< QString > &layers) noexcept
Definition: boardlayersdock.cpp:166
void on_btnBottom_clicked()
Definition: boardlayersdock.cpp:78
void on_listWidget_itemChanged(QListWidgetItem *item)
Definition: boardlayersdock.cpp:65
QScopedPointer< Ui::BoardLayersDock > mUi
Definition: boardlayersdock.h:85
BoardLayersDock(const BoardLayersDock &other)=delete
GraphicsLayer::OnEditedSlot mOnLayerEditedSlot
Definition: boardlayersdock.h:89
bool mUpdateScheduled
Definition: boardlayersdock.h:86
const IF_GraphicsLayerProvider & mLayerProvider
Definition: boardlayersdock.h:84
QList< QString > getCommonLayers() const noexcept
Definition: boardlayersdock.cpp:172
void on_btnAll_clicked()
Definition: boardlayersdock.cpp:91
void layerEdited(const GraphicsLayer &layer, GraphicsLayer::Event event) noexcept
Definition: boardlayersdock.cpp:105
QList< QString > getTopLayers() const noexcept
Definition: boardlayersdock.cpp:185
void updateListWidget() noexcept
Definition: boardlayersdock.cpp:125
QList< QString > getAllLayers() const noexcept
Definition: boardlayersdock.cpp:213
The GraphicsLayer class represents a graphical layer used in schematics and boards.
Definition: graphicslayer.h:53
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers.
Definition: graphicslayer.h:111
Definition: occmodel.cpp:77