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>>
155 QPrinter::DuplexMode duplex,
int copies)
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);
213 static QPageLayout::Orientation
getOrientation(
const QSizeF& size)
noexcept;
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
Asynchronously exports graphics to a QPainter.
Definition: graphicsexport.h:90
static QStringList getSupportedImageExtensions() noexcept
Get all supported image file extensions for startExport()
Definition: graphicsexport.cpp:128
void startExport(const Pages &pages, const FilePath &filePath) noexcept
Start exporting to a file or clipboard asynchronously.
Definition: graphicsexport.cpp:82
void cancel() noexcept
Cancel the current job.
Definition: graphicsexport.cpp:114
static QTransform getSourceTransformation(const GraphicsExportSettings &settings) noexcept
Definition: graphicsexport.cpp:435
void startPrint(const Pages &pages, const QString &printerName, QPrinter::DuplexMode duplex, int copies) noexcept
Start printing to a printer asynchronously.
Definition: graphicsexport.cpp:95
bool mAbort
Definition: graphicsexport.h:219
Result waitForFinished() noexcept
Wait (block) until the preview/export/print is finished.
Definition: graphicsexport.cpp:109
void progress(int percent, int completed, int total)
std::pair< std::shared_ptr< GraphicsPagePainter >, std::shared_ptr< GraphicsExportSettings > > Page
Definition: graphicsexport.h:97
static QRectF calcSourceRect(const GraphicsPagePainter &page, const GraphicsExportSettings &settings) noexcept
Definition: graphicsexport.cpp:450
static QStringList getSupportedExtensions() noexcept
Get all supported file extensions for startExport()
Definition: graphicsexport.cpp:124
void setDocumentName(const QString &name) noexcept
Set the document name used for printing, PDF and SVG export.
Definition: graphicsexport.h:117
GraphicsExport(QObject *parent=nullptr) noexcept
Definition: graphicsexport.cpp:52
static QPageLayout::Orientation getOrientation(const QSizeF &size) noexcept
Definition: graphicsexport.cpp:461
QString mCreator
Definition: graphicsexport.h:216
void savingFile(const librepcb::FilePath &filePath)
QFuture< Result > mFuture
Definition: graphicsexport.h:218
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:140
QString mDocumentName
Definition: graphicsexport.h:217
void imageCopiedToClipboard(const QImage &image, QClipboard::Mode mode)
QList< Page > Pages
Definition: graphicsexport.h:98
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:57
virtual void paint(QPainter &painter, const GraphicsExportSettings &settings) const noexcept=0
Draw page content on a QPainter.
Definition: occmodel.cpp:77
Definition: graphicsexport.h:100
QVector< FilePath > writtenFiles
Definition: graphicsexport.h:101
QString errorMsg
Definition: graphicsexport.h:102
Definition: graphicsexport.h:198
Pages pages
Definition: graphicsexport.h:200
bool preview
Definition: graphicsexport.h:199
QString printerName
Definition: graphicsexport.h:202
FilePath filePath
Definition: graphicsexport.h:201
int copies
Definition: graphicsexport.h:204
QPrinter::DuplexMode duplex
Definition: graphicsexport.h:203