LibrePCB Developers Documentation
GraphicsExportDialog Class Referencefinal

This class provides a Dialog (GUI) to choose DXF import settings. More...

#include <graphicsexportdialog.h>

Inherits QDialog.

+ Collaboration diagram for GraphicsExportDialog:

Classes

struct  ContentItem
 

Public Types

enum  Mode
 
enum  Output
 
typedef std::function< QString(QWidget *, const QString &, const QString &, const QString &, QString *, QFileDialog::Options)> SaveAsCallback
 
typedef std::pair< std::shared_ptr< GraphicsPagePainter >, std::shared_ptr< GraphicsExportSettings > > Page
 

Signals

void requestOpenFile (const librepcb::FilePath &filePath)
 

Public Member Functions

 GraphicsExportDialog ()=delete
 
 GraphicsExportDialog (const GraphicsExportDialog &other)=delete
 
 GraphicsExportDialog (Mode mode, Output output, const QList< std::shared_ptr< GraphicsPagePainter >> &pages, int currentPage, const QString &documentName, int innerLayerCount, const FilePath &defaultFilePath, const LengthUnit &lengthUnit, const Theme &theme, const QString &settingsPrefix, QWidget *parent=nullptr) noexcept
 
 ~GraphicsExportDialog () noexcept
 
void setSaveAsCallback (SaveAsCallback callback) noexcept
 
const QList< Page > & getPages () const noexcept
 
GraphicsExportDialogoperator= (const GraphicsExportDialog &rhs)=delete
 

Private Types

enum  ClientSettingsAction
 

Private Member Functions

void loadDefaultSettings () noexcept
 
void syncClientSettings (ClientSettingsAction action) noexcept
 
void buttonBoxClicked (QDialogButtonBox::StandardButton btn) noexcept
 
void printersAvailable () noexcept
 
void printerChanged (int index) noexcept
 
void setAvailablePageSizes (QList< tl::optional< QPageSize >> sizes) noexcept
 
void layerListItemDoubleClicked (QListWidgetItem *item) noexcept
 
void applySettings () noexcept
 
void startExport (bool toClipboard) noexcept
 
void openProgressDialog () noexcept
 
bool eventFilter (QObject *object, QEvent *event) noexcept override
 
void setPageSize (const tl::optional< QPageSize::PageSizeId > &size) noexcept
 
tl::optional< QPageSize > getPageSize () const noexcept
 
void setOrientation (GraphicsExportSettings::Orientation orientation) noexcept
 
GraphicsExportSettings::Orientation getOrientation () const noexcept
 
void setMarginLeft (const UnsignedLength &margin) noexcept
 
UnsignedLength getMarginLeft () const noexcept
 
void setMarginTop (const UnsignedLength &margin) noexcept
 
UnsignedLength getMarginTop () const noexcept
 
void setMarginRight (const UnsignedLength &margin) noexcept
 
UnsignedLength getMarginRight () const noexcept
 
void setMarginBottom (const UnsignedLength &margin) noexcept
 
UnsignedLength getMarginBottom () const noexcept
 
void setShowPinNumbers (bool show) noexcept
 
bool getShowPinNumbers () const noexcept
 
void setRotate (bool rotate) noexcept
 
bool getRotate () const noexcept
 
void setMirror (bool mirror) noexcept
 
bool getMirror () const noexcept
 
void setFitToPage (bool fit) noexcept
 
bool getFitToPage () const noexcept
 
void setScaleFactor (const UnsignedRatio &factor) noexcept
 
UnsignedRatio getScaleFactor () const noexcept
 
void setDpi (int dpi) noexcept
 
int getDpi () const noexcept
 
void setBlackWhite (bool blackWhite) noexcept
 
bool getBlackWhite () const noexcept
 
void setBackgroundColor (const QColor &color) noexcept
 
QColor getBackgroundColor () const noexcept
 
void setMinLineWidth (const UnsignedLength &width) noexcept
 
UnsignedLength getMinLineWidth () const noexcept
 
void setPrinterName (const QString &name) noexcept
 
QString getPrinterName () const noexcept
 
void setDuplex (QPrinter::DuplexMode duplex) noexcept
 
QPrinter::DuplexMode getDuplex () const noexcept
 
void setPageContent (const QList< ContentItem > &items) noexcept
 
const QList< ContentItem > & getPageContent () const noexcept
 
void setOpenExportedFiles (bool open) noexcept
 
bool getOpenExportedFiles () const noexcept
 
void updateColorsListWidget () noexcept
 

Private Attributes

const Mode mMode
 
const Output mOutput
 
const QList< std::shared_ptr< GraphicsPagePainter > > mInputPages
 
const int mCurrentPage
 
const FilePath mDefaultFilePath
 
const ThememTheme
 
const QString mSettingsPrefix
 
SaveAsCallback mSaveAsCallback
 
QScopedPointer< GraphicsExportSettingsmDefaultSettings
 
QList< std::pair< QString, QColor > > mColors
 
QString mSettingsPrinterName
 
tl::optional< QPageSize::PageSizeId > mSettingsPageSize
 
QPrinter::DuplexMode mSettingsDuplexMode
 
bool mDisableApplySettings
 
QScopedPointer< Ui::GraphicsExportDialog > mUi
 
QScopedPointer< QProgressDialog > mProgressDialog
 
QScopedPointer< QFutureWatcher< QList< QPrinterInfo > > > mPrinterWatcher
 
QList< QPrinterInfo > mAvailablePrinters
 
QList< tl::optional< QPageSize > > mAvailablePageSizes
 
QList< ContentItemmPageContentItems
 
QList< PagemPages
 
QScopedPointer< GraphicsExportmPreview
 
QScopedPointer< GraphicsExportmExport
 
FilePath mPathToOpenAfterExport
 

Detailed Description

This class provides a Dialog (GUI) to choose DXF import settings.

Member Typedef Documentation

◆ SaveAsCallback

typedef std::function<QString(QWidget*, const QString&, const QString&, const QString&, QString*, QFileDialog::Options)> SaveAsCallback

◆ Page

typedef std::pair<std::shared_ptr<GraphicsPagePainter>, std::shared_ptr<GraphicsExportSettings> > Page

Member Enumeration Documentation

◆ ClientSettingsAction

enum ClientSettingsAction
strongprivate
Enumerator
Load 
Store 

◆ Mode

enum Mode
strong
Enumerator
Schematic 

Initialize settings suitable for symbols/schematics.

Board 

Initialize settings suitable for footprints/boards.

◆ Output

enum Output
strong
Enumerator
Image 
Pdf 
Print 

Constructor & Destructor Documentation

◆ GraphicsExportDialog() [1/3]

◆ GraphicsExportDialog() [2/3]

GraphicsExportDialog ( const GraphicsExportDialog other)
delete

◆ GraphicsExportDialog() [3/3]

GraphicsExportDialog ( Mode  mode,
Output  output,
const QList< std::shared_ptr< GraphicsPagePainter >> &  pages,
int  currentPage,
const QString &  documentName,
int  innerLayerCount,
const FilePath defaultFilePath,
const LengthUnit lengthUnit,
const Theme theme,
const QString &  settingsPrefix,
QWidget *  parent = nullptr 
)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~GraphicsExportDialog()

~GraphicsExportDialog ( )
noexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ setSaveAsCallback()

void setSaveAsCallback ( SaveAsCallback  callback)
noexcept

◆ getPages()

const QList<Page>& getPages ( ) const
inlinenoexcept

◆ operator=()

GraphicsExportDialog& operator= ( const GraphicsExportDialog rhs)
delete

◆ requestOpenFile

void requestOpenFile ( const librepcb::FilePath filePath)
signal
+ Here is the caller graph for this function:

◆ loadDefaultSettings()

void loadDefaultSettings ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ syncClientSettings()

void syncClientSettings ( ClientSettingsAction  action)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buttonBoxClicked()

void buttonBoxClicked ( QDialogButtonBox::StandardButton  btn)
privatenoexcept
+ Here is the call graph for this function:

◆ printersAvailable()

void printersAvailable ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printerChanged()

void printerChanged ( int  index)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAvailablePageSizes()

void setAvailablePageSizes ( QList< tl::optional< QPageSize >>  sizes)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ layerListItemDoubleClicked()

void layerListItemDoubleClicked ( QListWidgetItem *  item)
privatenoexcept
+ Here is the caller graph for this function:

◆ applySettings()

void applySettings ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startExport()

void startExport ( bool  toClipboard)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ openProgressDialog()

void openProgressDialog ( )
privatenoexcept
+ Here is the caller graph for this function:

◆ eventFilter()

bool eventFilter ( QObject *  object,
QEvent *  event 
)
overrideprivatenoexcept
+ Here is the call graph for this function:

◆ setPageSize()

void setPageSize ( const tl::optional< QPageSize::PageSizeId > &  size)
privatenoexcept
+ Here is the caller graph for this function:

◆ getPageSize()

tl::optional< QPageSize > getPageSize ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setOrientation()

void setOrientation ( GraphicsExportSettings::Orientation  orientation)
privatenoexcept
+ Here is the caller graph for this function:

◆ getOrientation()

GraphicsExportSettings::Orientation getOrientation ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setMarginLeft()

void setMarginLeft ( const UnsignedLength margin)
privatenoexcept
+ Here is the caller graph for this function:

◆ getMarginLeft()

UnsignedLength getMarginLeft ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setMarginTop()

void setMarginTop ( const UnsignedLength margin)
privatenoexcept
+ Here is the caller graph for this function:

◆ getMarginTop()

UnsignedLength getMarginTop ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setMarginRight()

void setMarginRight ( const UnsignedLength margin)
privatenoexcept
+ Here is the caller graph for this function:

◆ getMarginRight()

UnsignedLength getMarginRight ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setMarginBottom()

void setMarginBottom ( const UnsignedLength margin)
privatenoexcept
+ Here is the caller graph for this function:

◆ getMarginBottom()

UnsignedLength getMarginBottom ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setShowPinNumbers()

void setShowPinNumbers ( bool  show)
privatenoexcept
+ Here is the caller graph for this function:

◆ getShowPinNumbers()

bool getShowPinNumbers ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setRotate()

void setRotate ( bool  rotate)
privatenoexcept
+ Here is the caller graph for this function:

◆ getRotate()

bool getRotate ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setMirror()

void setMirror ( bool  mirror)
privatenoexcept
+ Here is the caller graph for this function:

◆ getMirror()

bool getMirror ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setFitToPage()

void setFitToPage ( bool  fit)
privatenoexcept
+ Here is the caller graph for this function:

◆ getFitToPage()

bool getFitToPage ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setScaleFactor()

void setScaleFactor ( const UnsignedRatio factor)
privatenoexcept
+ Here is the caller graph for this function:

◆ getScaleFactor()

UnsignedRatio getScaleFactor ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setDpi()

void setDpi ( int  dpi)
privatenoexcept
+ Here is the caller graph for this function:

◆ getDpi()

int getDpi ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setBlackWhite()

void setBlackWhite ( bool  blackWhite)
privatenoexcept
+ Here is the caller graph for this function:

◆ getBlackWhite()

bool getBlackWhite ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setBackgroundColor()

void setBackgroundColor ( const QColor &  color)
privatenoexcept
+ Here is the caller graph for this function:

◆ getBackgroundColor()

QColor getBackgroundColor ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setMinLineWidth()

void setMinLineWidth ( const UnsignedLength width)
privatenoexcept
+ Here is the caller graph for this function:

◆ getMinLineWidth()

UnsignedLength getMinLineWidth ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setPrinterName()

void setPrinterName ( const QString &  name)
privatenoexcept

◆ getPrinterName()

QString getPrinterName ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setDuplex()

void setDuplex ( QPrinter::DuplexMode  duplex)
privatenoexcept
+ Here is the caller graph for this function:

◆ getDuplex()

QPrinter::DuplexMode getDuplex ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setPageContent()

void setPageContent ( const QList< ContentItem > &  items)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageContent()

const QList< GraphicsExportDialog::ContentItem > & getPageContent ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ setOpenExportedFiles()

void setOpenExportedFiles ( bool  open)
privatenoexcept
+ Here is the caller graph for this function:

◆ getOpenExportedFiles()

bool getOpenExportedFiles ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ updateColorsListWidget()

void updateColorsListWidget ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mMode

const Mode mMode
private

◆ mOutput

const Output mOutput
private

◆ mInputPages

const QList<std::shared_ptr<GraphicsPagePainter> > mInputPages
private

◆ mCurrentPage

const int mCurrentPage
private

◆ mDefaultFilePath

const FilePath mDefaultFilePath
private

◆ mTheme

const Theme& mTheme
private

◆ mSettingsPrefix

const QString mSettingsPrefix
private

◆ mSaveAsCallback

SaveAsCallback mSaveAsCallback
private

◆ mDefaultSettings

QScopedPointer<GraphicsExportSettings> mDefaultSettings
private

◆ mColors

QList<std::pair<QString, QColor> > mColors
private

◆ mSettingsPrinterName

QString mSettingsPrinterName
private

◆ mSettingsPageSize

tl::optional<QPageSize::PageSizeId> mSettingsPageSize
private

◆ mSettingsDuplexMode

QPrinter::DuplexMode mSettingsDuplexMode
private

◆ mDisableApplySettings

bool mDisableApplySettings
private

◆ mUi

QScopedPointer<Ui::GraphicsExportDialog> mUi
private

◆ mProgressDialog

QScopedPointer<QProgressDialog> mProgressDialog
private

◆ mPrinterWatcher

QScopedPointer<QFutureWatcher<QList<QPrinterInfo> > > mPrinterWatcher
private

◆ mAvailablePrinters

QList<QPrinterInfo> mAvailablePrinters
private

◆ mAvailablePageSizes

QList<tl::optional<QPageSize> > mAvailablePageSizes
private

◆ mPageContentItems

QList<ContentItem> mPageContentItems
private

◆ mPages

QList<Page> mPages
private

◆ mPreview

QScopedPointer<GraphicsExport> mPreview
private

◆ mExport

QScopedPointer<GraphicsExport> mExport
private

◆ mPathToOpenAfterExport

FilePath mPathToOpenAfterExport
private

The documentation for this class was generated from the following files: