20#ifndef LIBREPCB_CORE_GRAPHICSEXPORT_H
21#define LIBREPCB_CORE_GRAPHICSEXPORT_H
26#include "../fileio/filepath.h"
27#include "../types/length.h"
32#include <QtPrintSupport>
75 virtual void paint(QPainter& painter,
94 typedef std::pair<std::shared_ptr<GraphicsPagePainter>,
95 std::shared_ptr<GraphicsExportSettings>>
154 QPrinter::DuplexMode duplex,
int copies)
noexcept;
188 void previewReady(
int index, const QSize& pageSize, const QRectF margins,
189 std::shared_ptr<QPicture> picture);
191 void progress(
int percent,
int completed,
int total);
212 static QPageLayout::Orientation
getOrientation(
const QSizeF& size)
noexcept;
This class represents absolute, well-formatted paths to files or directories.
Definition filepath.h:127
Asynchronously exports graphics to a QPainter.
Definition graphicsexport.h:89
static QStringList getSupportedImageExtensions() noexcept
Get all supported image file extensions for startExport()
Definition graphicsexport.cpp:116
void startExport(const Pages &pages, const FilePath &filePath) noexcept
Start exporting to a file or clipboard asynchronously.
Definition graphicsexport.cpp:78
void cancel() noexcept
Cancel the current job.
Definition graphicsexport.cpp:102
static QTransform getSourceTransformation(const GraphicsExportSettings &settings) noexcept
Definition graphicsexport.cpp:423
void startPrint(const Pages &pages, const QString &printerName, QPrinter::DuplexMode duplex, int copies) noexcept
Start printing to a printer asynchronously.
Definition graphicsexport.cpp:87
bool mAbort
Definition graphicsexport.h:218
Result waitForFinished() noexcept
Wait (block) until the preview/export/print is finished.
Definition graphicsexport.cpp:97
void progress(int percent, int completed, int total)
std::pair< std::shared_ptr< GraphicsPagePainter >, std::shared_ptr< GraphicsExportSettings > > Page
Definition graphicsexport.h:96
static QRectF calcSourceRect(const GraphicsPagePainter &page, const GraphicsExportSettings &settings) noexcept
Definition graphicsexport.cpp:438
static QStringList getSupportedExtensions() noexcept
Get all supported file extensions for startExport()
Definition graphicsexport.cpp:112
void setDocumentName(const QString &name) noexcept
Set the document name used for printing, PDF and SVG export.
Definition graphicsexport.h:116
static QPageLayout::Orientation getOrientation(const QSizeF &size) noexcept
Definition graphicsexport.cpp:449
QString mCreator
Definition graphicsexport.h:215
void savingFile(const librepcb::FilePath &filePath)
QFuture< Result > mFuture
Definition graphicsexport.h:217
void previewReady(int index, const QSize &pageSize, const QRectF margins, std::shared_ptr< QPicture > picture)
void startPreview(const Pages &pages) noexcept
Start creating previews asynchronously.
Definition graphicsexport.cpp:70
Result run(RunArgs args) noexcept
Definition graphicsexport.cpp:128
QString mDocumentName
Definition graphicsexport.h:216
void imageCopiedToClipboard(const QImage &image, QClipboard::Mode mode)
QList< Page > Pages
Definition graphicsexport.h:97
void failed(const QString &error)
Settings for librepcb::GraphicsExport.
Definition graphicsexportsettings.h:51
Base class for printing a page for librepcb::GraphicsExport.
Definition graphicsexport.h:56
virtual void paint(QPainter &painter, const GraphicsExportSettings &settings) const noexcept=0
Draw page content on a QPainter.
Definition occmodel.cpp:76
Definition graphicsexport.h:99
QVector< FilePath > writtenFiles
Definition graphicsexport.h:100
QString errorMsg
Definition graphicsexport.h:101
Definition graphicsexport.h:197
Pages pages
Definition graphicsexport.h:199
bool preview
Definition graphicsexport.h:198
QString printerName
Definition graphicsexport.h:201
FilePath filePath
Definition graphicsexport.h:200
int copies
Definition graphicsexport.h:203
QPrinter::DuplexMode duplex
Definition graphicsexport.h:202