LibrePCB Developers Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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(
78 const std::optional<RuleCheckMessageList>& messages) noexcept;
79 void setApprovals(const QSet<SExpression>& approvals) noexcept;
80
81 // Operator Overloadings
82 RuleCheckDock& operator=(const RuleCheckDock& rhs) = delete;
83
84signals:
88 void messageApprovalRequested(const RuleCheckMessage& msg, bool approve);
89 void messageSelected(const RuleCheckMessage& msg, bool zoomTo);
90
91private: // Methods
92 void updateTitle(std::optional<int> unapprovedMessages) noexcept;
93 virtual bool ruleCheckFixAvailable(
94 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
95 virtual void ruleCheckFixRequested(
96 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
98 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
99 virtual void ruleCheckApproveRequested(
100 std::shared_ptr<const RuleCheckMessage> msg,
101 bool approve) noexcept override;
102 virtual void ruleCheckMessageSelected(
103 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
105 std::shared_ptr<const RuleCheckMessage> msg) noexcept override;
106
107private:
108 const Mode mMode;
109 QScopedPointer<Ui::RuleCheckDock> mUi;
110};
111
112/*******************************************************************************
113 * End of File
114 ******************************************************************************/
115
116} // namespace editor
117} // namespace librepcb
118
119#endif
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 setApprovals(const QSet< SExpression > &approvals) noexcept
Definition rulecheckdock.cpp:104
Mode
Definition rulecheckdock.h:55
void setMessages(const std::optional< RuleCheckMessageList > &messages) noexcept
Definition rulecheckdock.cpp:92
virtual bool ruleCheckFixAvailable(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition rulecheckdock.cpp:133
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:151
QScopedPointer< Ui::RuleCheckDock > mUi
Definition rulecheckdock.h:109
virtual void ruleCheckDescriptionRequested(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition rulecheckdock.cpp:144
virtual void ruleCheckFixRequested(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition rulecheckdock.cpp:139
void messageApprovalRequested(const RuleCheckMessage &msg, bool approve)
virtual void ruleCheckMessageDoubleClicked(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition rulecheckdock.cpp:165
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:108
void updateTitle(std::optional< int > unapprovedMessages) noexcept
Definition rulecheckdock.cpp:113
void messageSelected(const RuleCheckMessage &msg, bool zoomTo)
virtual void ruleCheckMessageSelected(std::shared_ptr< const RuleCheckMessage > msg) noexcept override
Definition rulecheckdock.cpp:158
Definition occmodel.cpp:77
QVector< std::shared_ptr< const RuleCheckMessage > > RuleCheckMessageList
Definition rulecheckmessage.h:104
Definition uuid.h:186