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 class  Mode
 
enum class  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 class  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 class ClientSettingsAction
strongprivate
Enumerator
Load 
Store 

◆ Mode

enum class Mode
strong
Enumerator
Schematic 

Initialize settings suitable for symbols/schematics.

Board 

Initialize settings suitable for footprints/boards.

◆ Output

enum class 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

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

◆ syncClientSettings()

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

◆ buttonBoxClicked()

void buttonBoxClicked ( QDialogButtonBox::StandardButton  btn)
privatenoexcept

◆ printersAvailable()

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

◆ printerChanged()

void printerChanged ( int  index)
privatenoexcept

◆ setAvailablePageSizes()

void setAvailablePageSizes ( QList< tl::optional< QPageSize > >  sizes)
privatenoexcept

◆ layerListItemDoubleClicked()

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

◆ applySettings()

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

◆ startExport()

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

◆ openProgressDialog()

void openProgressDialog ( )
privatenoexcept

◆ eventFilter()

bool eventFilter ( QObject *  object,
QEvent *  event 
)
overrideprivatenoexcept

◆ setPageSize()

void setPageSize ( const tl::optional< QPageSize::PageSizeId > &  size)
privatenoexcept

◆ getPageSize()

tl::optional< QPageSize > getPageSize ( ) const
privatenoexcept

◆ setOrientation()

void setOrientation ( GraphicsExportSettings::Orientation  orientation)
privatenoexcept

◆ getOrientation()

GraphicsExportSettings::Orientation getOrientation ( ) const
privatenoexcept

◆ setMarginLeft()

void setMarginLeft ( const UnsignedLength margin)
privatenoexcept

◆ getMarginLeft()

UnsignedLength getMarginLeft ( ) const
privatenoexcept

◆ setMarginTop()

void setMarginTop ( const UnsignedLength margin)
privatenoexcept

◆ getMarginTop()

UnsignedLength getMarginTop ( ) const
privatenoexcept

◆ setMarginRight()

void setMarginRight ( const UnsignedLength margin)
privatenoexcept

◆ getMarginRight()

UnsignedLength getMarginRight ( ) const
privatenoexcept

◆ setMarginBottom()

void setMarginBottom ( const UnsignedLength margin)
privatenoexcept

◆ getMarginBottom()

UnsignedLength getMarginBottom ( ) const
privatenoexcept

◆ setShowPinNumbers()

void setShowPinNumbers ( bool  show)
privatenoexcept

◆ getShowPinNumbers()

bool getShowPinNumbers ( ) const
privatenoexcept

◆ setRotate()

void setRotate ( bool  rotate)
privatenoexcept

◆ getRotate()

bool getRotate ( ) const
privatenoexcept

◆ setMirror()

void setMirror ( bool  mirror)
privatenoexcept

◆ getMirror()

bool getMirror ( ) const
privatenoexcept

◆ setFitToPage()

void setFitToPage ( bool  fit)
privatenoexcept

◆ getFitToPage()

bool getFitToPage ( ) const
privatenoexcept

◆ setScaleFactor()

void setScaleFactor ( const UnsignedRatio factor)
privatenoexcept

◆ getScaleFactor()

UnsignedRatio getScaleFactor ( ) const
privatenoexcept

◆ setDpi()

void setDpi ( int  dpi)
privatenoexcept

◆ getDpi()

int getDpi ( ) const
privatenoexcept

◆ setBlackWhite()

void setBlackWhite ( bool  blackWhite)
privatenoexcept

◆ getBlackWhite()

bool getBlackWhite ( ) const
privatenoexcept

◆ setBackgroundColor()

void setBackgroundColor ( const QColor &  color)
privatenoexcept

◆ getBackgroundColor()

QColor getBackgroundColor ( ) const
privatenoexcept

◆ setMinLineWidth()

void setMinLineWidth ( const UnsignedLength width)
privatenoexcept

◆ getMinLineWidth()

UnsignedLength getMinLineWidth ( ) const
privatenoexcept

◆ setPrinterName()

void setPrinterName ( const QString &  name)
privatenoexcept

◆ getPrinterName()

QString getPrinterName ( ) const
privatenoexcept

◆ setDuplex()

void setDuplex ( QPrinter::DuplexMode  duplex)
privatenoexcept

◆ getDuplex()

QPrinter::DuplexMode getDuplex ( ) const
privatenoexcept

◆ setPageContent()

void setPageContent ( const QList< ContentItem > &  items)
privatenoexcept

◆ getPageContent()

const QList< GraphicsExportDialog::ContentItem > & getPageContent ( ) const
privatenoexcept

◆ setOpenExportedFiles()

void setOpenExportedFiles ( bool  open)
privatenoexcept

◆ getOpenExportedFiles()

bool getOpenExportedFiles ( ) const
privatenoexcept

◆ updateColorsListWidget()

void updateColorsListWidget ( )
privatenoexcept

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: