Mapper  0.9.0
API documentation
Functions
PlatformPrinterProperties Namespace Reference

Provides platform-dependent printer properties handling. More...

Functions

void save (const QPrinter *printer, std::shared_ptr< void > &buffer)
 Saves the printer's platform-dependent properties. More...
 
void restore (QPrinter *printer, const std::shared_ptr< void > &buffer)
 Applies platform-dependent properties to the printer, if possible. More...
 
bool dialogSupported ()
 Returns true iff the platform supports execDialog(). More...
 
int execDialog (QPrinter *printer, std::shared_ptr< void > &buffer, QWidget *parent=nullptr)
 Shows a modal properties dialog for the given printer. More...
 

Detailed Description

Provides platform-dependent printer properties handling.

At moment, a specific implementation exists for Win32, dealing with DEVMODE and DocumentProperties.

Function Documentation

◆ dialogSupported()

bool PlatformPrinterProperties::dialogSupported ( )

Returns true iff the platform supports execDialog().

The default implementation returns false.

◆ execDialog()

int PlatformPrinterProperties::execDialog ( QPrinter printer,
std::shared_ptr< void > &  buffer,
QWidget parent = nullptr 
)

Shows a modal properties dialog for the given printer.

The printer parameter must not be nullptr. The buffer may return data which has to live as long as the printer object.

Returns QDialog::Accepted or QDialog::Rejected, depending on user action.

The default implementation returns QDialog::Rejected.

◆ restore()

void PlatformPrinterProperties::restore ( QPrinter printer,
const std::shared_ptr< void > &  buffer 
)

Applies platform-dependent properties to the printer, if possible.

The default implementation does nothing.

◆ save()

void PlatformPrinterProperties::save ( const QPrinter printer,
std::shared_ptr< void > &  buffer 
)

Saves the printer's platform-dependent properties.

The buffer is reset to point to the saved data.

The default implementation does nothing.