LibrePCB Developers Documentation
graphicsoutputjobwidget.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_GRAPHICSOUTPUTJOBWIDGET_H
21#define LIBREPCB_EDITOR_GRAPHICSOUTPUTJOBWIDGET_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27#include <optional/tl/optional.hpp>
28
29#include <QtCore>
30#include <QtWidgets>
31
32#include <functional>
33#include <memory>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39
40class GraphicsExport;
41class GraphicsOutputJob;
42class LengthUnit;
43class OutputJobRunner;
44class Project;
45
46namespace editor {
47
48namespace Ui {
49class GraphicsOutputJobWidget;
50}
51
52/*******************************************************************************
53 * Class GraphicsOutputJobWidget
54 ******************************************************************************/
55
59class GraphicsOutputJobWidget final : public QWidget {
60 Q_OBJECT
61
62public:
63 // Constructors / Destructor
66 explicit GraphicsOutputJobWidget(Project& project,
67 std::shared_ptr<GraphicsOutputJob> job,
68 const LengthUnit& lengthUnit,
69 const QString& settingsPrefix,
70 QWidget* parent = nullptr) noexcept;
71 ~GraphicsOutputJobWidget() noexcept;
72
73 // Operator Overloads
75 delete;
76
77private: // Methods
78 void addClicked() noexcept;
79 void copyClicked() noexcept;
80 void removeClicked() noexcept;
81 void currentContentChanged(int index) noexcept;
82 void updateContentList() noexcept;
83 void layerListItemDoubleClicked(QListWidgetItem* item) noexcept;
84 void modify(std::function<void(GraphicsOutputJob::Content&)> fun) noexcept;
85 void updatePreview() noexcept;
86
87private: // Data
89 std::shared_ptr<GraphicsOutputJob> mJob;
92 QList<tl::optional<QPageSize>> mPageSizes;
94 QScopedPointer<Ui::GraphicsOutputJobWidget> mUi;
95};
96
97/*******************************************************************************
98 * End of File
99 ******************************************************************************/
100
101} // namespace editor
102} // namespace librepcb
103
104#endif
Asynchronously exports graphics to a QPainter.
Definition: graphicsexport.h:90
PDF/Image output job.
Definition: graphicsoutputjob.h:50
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The OutputJobRunner class.
Definition: outputjobrunner.h:63
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
The GraphicsOutputJobWidget class.
Definition: graphicsoutputjobwidget.h:59
void removeClicked() noexcept
Definition: graphicsoutputjobwidget.cpp:385
void copyClicked() noexcept
Definition: graphicsoutputjobwidget.cpp:373
QScopedPointer< Ui::GraphicsOutputJobWidget > mUi
Definition: graphicsoutputjobwidget.h:94
QScopedPointer< GraphicsExport > mPreviewGraphicsExport
Definition: graphicsoutputjobwidget.h:91
void addClicked() noexcept
Definition: graphicsoutputjobwidget.cpp:337
void updatePreview() noexcept
Definition: graphicsoutputjobwidget.cpp:528
std::shared_ptr< GraphicsOutputJob > mJob
Definition: graphicsoutputjobwidget.h:89
QList< tl::optional< QPageSize > > mPageSizes
Definition: graphicsoutputjobwidget.h:92
void currentContentChanged(int index) noexcept
Definition: graphicsoutputjobwidget.cpp:397
void layerListItemDoubleClicked(QListWidgetItem *item) noexcept
Definition: graphicsoutputjobwidget.cpp:502
bool mDisableModification
Definition: graphicsoutputjobwidget.h:93
void updateContentList() noexcept
Definition: graphicsoutputjobwidget.cpp:488
Project & mProject
Definition: graphicsoutputjobwidget.h:88
GraphicsOutputJobWidget(const GraphicsOutputJobWidget &other)=delete
QScopedPointer< OutputJobRunner > mPreviewRunner
Definition: graphicsoutputjobwidget.h:90
void modify(std::function< void(GraphicsOutputJob::Content &)> fun) noexcept
Definition: graphicsoutputjobwidget.cpp:513
Definition: occmodel.cpp:77
Definition: uuid.h:183