LibrePCB Developers Documentation
rulecheckdock.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_RULECHECKDOCK_H
21#define LIBREPCB_EDITOR_RULECHECKDOCK_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "rulechecklistwidget.h"
27
29
30#include <QtCore>
31#include <QtWidgets>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37namespace editor {
38
39namespace Ui {
40class RuleCheckDock;
41}
42
43/*******************************************************************************
44 * Class RuleCheckDock
45 ******************************************************************************/
46
50class RuleCheckDock final : public QDockWidget, private IF_RuleCheckHandler {
51 Q_OBJECT
52
53public:
54 // Types
55 enum class Mode {
58 };
59
60 // Constructors / Destructor
61 explicit RuleCheckDock(Mode mode, QWidget* parent = nullptr) noexcept;
62 RuleCheckDock(const RuleCheckDock& other) = delete;
63 ~RuleCheckDock() noexcept;
64
65 // Setters
74 bool setInteractive(bool interactive) noexcept;
75 void setProgressPercent(int percent) noexcept;
76 void setProgressStatus(const QString& status) noexcept;
77 void setMessages(const tl::optional<RuleCheckMessageList>& messages) noexcept;
78 void setApprovals(const QSet<SExpression>& approvals) noexcept;
79
80 // Operator Overloadings
81 RuleCheckDock& operator=(const RuleCheckDock& rhs) = delete;
82
83signals:
87 void messageApprovalRequested(const RuleCheckMessage& msg, bool approve);
88 void messageSelected(const RuleCheckMessage& msg, bool zoomTo);
89
90private: // Methods
91 void updateTitle(tl::optional<int> unapprovedMessages) noexcept;
92 virtual bool ruleCheckFixAvailable(
93 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
94 virtual void ruleCheckFixRequested(
95 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
97 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
98 virtual void ruleCheckApproveRequested(
99 std::shared_ptr<const RuleCheckMessage> msg,
100 bool approve) noexcept override;
101 virtual void ruleCheckMessageSelected(
102 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
104 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
105
106private:
107 const Mode mMode;
108 QScopedPointer<Ui::RuleCheckDock> mUi;
109};
110
111/*******************************************************************************
112 * End of File
113 ******************************************************************************/
114
115} // namespace editor
116} // namespace librepcb
117
118#endif
The BoardDesignRuleCheck class checks a librepcb::Board for design rule violations.
Definition: boarddesignrulecheck.h:52
The ElectricalRuleCheck class checks a librepcb::Board for design rule violations.
Definition: electricalrulecheck.h:50
The RuleCheckMessage class.
Definition: rulecheckmessage.h:45
The SExpression class.
Definition: sexpression.h:69
Definition: rulechecklistwidget.h:44
The RuleCheckDock class.
Definition: rulecheckdock.h:50
void updateTitle(tl::optional< int > unapprovedMessages) noexcept
Definition: rulecheckdock.cpp:113
RuleCheckDock(Mode mode, QWidget *parent=nullptr) noexcept
Definition: rulecheckdock.cpp:40
void setApprovals(const QSet< SExpression > &approvals) noexcept
Definition: rulecheckdock.cpp:104
Mode
Definition: rulecheckdock.h:55
virtual bool ruleCheckFixAvailable(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition: rulecheckdock.cpp:132
void setProgressPercent(int percent) noexcept
Definition: rulecheckdock.cpp:76
virtual void ruleCheckApproveRequested(std::shared_ptr< const RuleCheckMessage > msg, bool approve) noexcept override
Definition: rulecheckdock.cpp:150
QScopedPointer< Ui::RuleCheckDock > mUi
Definition: rulecheckdock.h:108
virtual void ruleCheckDescriptionRequested(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition: rulecheckdock.cpp:143
void setMessages(const tl::optional< RuleCheckMessageList > &messages) noexcept
Definition: rulecheckdock.cpp:92
virtual void ruleCheckFixRequested(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition: rulecheckdock.cpp:138
void messageApprovalRequested(const RuleCheckMessage &msg, bool approve)
virtual void ruleCheckMessageDoubleClicked(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition: rulecheckdock.cpp:164
bool setInteractive(bool interactive) noexcept
Set whether the dock widget should be interactive or not.
Definition: rulecheckdock.cpp:66
void setProgressStatus(const QString &status) noexcept
Definition: rulecheckdock.cpp:84
const Mode mMode
Definition: rulecheckdock.h:107
void messageSelected(const RuleCheckMessage &msg, bool zoomTo)
virtual void ruleCheckMessageSelected(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition: rulecheckdock.cpp:157
Definition: occmodel.cpp:77
QVector< std::shared_ptr< const RuleCheckMessage > > RuleCheckMessageList
Definition: rulecheckmessage.h:104
Definition: uuid.h:183