20 #ifndef LIBREPCB_CORE_GRAPHICSEXPORT_H 21 #define LIBREPCB_CORE_GRAPHICSEXPORT_H 26 #include "../fileio/filepath.h" 27 #include "../types/length.h" 30 #include <optional/tl/optional.hpp> 34 #include <QtPrintSupport> 76 virtual void paint(QPainter& painter,
95 typedef std::pair<std::shared_ptr<GraphicsPagePainter>,
96 std::shared_ptr<GraphicsExportSettings>>
117 void setDocumentName(const QString& name) noexcept { mDocumentName = name; }
127 void startPreview(
const Pages& pages) noexcept;
144 void startExport(
const Pages& pages,
const FilePath& filePath) noexcept;
154 void startPrint(
const Pages& pages,
const QString& printerName,
155 QPrinter::DuplexMode duplex,
int copies) noexcept;
162 Result waitForFinished() noexcept;
167 void cancel() noexcept;
179 static QStringList getSupportedExtensions() noexcept;
186 static QStringList getSupportedImageExtensions() noexcept;
189 void previewReady(
int index,
const QSize& pageSize,
const QRectF margins,
190 std::shared_ptr<QPicture> picture);
192 void progress(
int percent,
int completed,
int total);
194 void failed(
const QString& error);
195 void imageCopiedToClipboard(
const QImage& image, QClipboard::Mode mode);
209 static QTransform getSourceTransformation(
213 static QPageLayout::Orientation getOrientation(
const QSizeF& size) noexcept;
bool preview
Definition: graphicsexport.h:199
std::pair< std::shared_ptr< GraphicsPagePainter >, std::shared_ptr< GraphicsExportSettings > > Page
Definition: graphicsexport.h:97
Asynchronously exports graphics to a QPainter.
Definition: graphicsexport.h:90
Definition: occmodel.cpp:77
QList< Page > Pages
Definition: graphicsexport.h:98
Definition: graphicsexport.h:198
QString mCreator
Definition: graphicsexport.h:216
QString printerName
Definition: graphicsexport.h:202
Pages pages
Definition: graphicsexport.h:200
QFuture< Result > mFuture
Definition: graphicsexport.h:218
Settings for librepcb::GraphicsExport.
Definition: graphicsexportsettings.h:51
QVector< FilePath > writtenFiles
Definition: graphicsexport.h:101
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
int copies
Definition: graphicsexport.h:204
virtual void paint(QPainter &painter, const GraphicsExportSettings &settings) const noexcept=0
Draw page content on a QPainter.
bool mAbort
Definition: graphicsexport.h:219
FilePath filePath
Definition: graphicsexport.h:201
QString errorMsg
Definition: graphicsexport.h:102
QString mDocumentName
Definition: graphicsexport.h:217
QPrinter::DuplexMode duplex
Definition: graphicsexport.h:203
Definition: graphicsexport.h:100
Base class for printing a page for librepcb::GraphicsExport.
Definition: graphicsexport.h:57