UNIVERS
15.3
UNIVERS base processing software API
|
#include <zqdlg_print.hpp>
Public Types | |
enum | ImageFormat { CGM = 0, PNG, JPEG, PostScript } |
Public Member Functions | |
ZqDlgPrint (QWidget *parent, QzqArea *area, ZqbPlaceholder *pPlace, ZqbNatGroup *pNatX, ZqbNatGroup *pNatY) | |
virtual | ~ZqDlgPrint () |
int | showSettings (float &width, float &height, float margins[4], int &resolution, int &pageSize) |
int | showFileSelection (std::string &filepath) |
int | drawToFile (ImageFormat eImgFmt, const std::string filepath, int resolution, float width, float height, float margins[4], int pageSize) |
Static Public Member Functions | |
static void | doIt (QMainWindow *parent, QzqArea *area, ZqbPlaceholder *pPlace, ZqbNatGroup *pNatX, ZqbNatGroup *pNatY, const char *szDefaultFilename=NULL, const char *szDefaultDirectory=NULL) |
Protected Attributes | |
PrOptions * | m_pDlgPrOpt |
QWidget * | m_qParent |
Dialog window for print parameter setting. One scaleable rectangle area is supported. Several image file formats are allowed including raster and vector ones.
List of allowed file formats.
ZqDlgPrint::ZqDlgPrint | ( | QWidget * | parent, |
QzqArea * | area, | ||
ZqbPlaceholder * | pPlace, | ||
ZqbNatGroup * | pNatX, | ||
ZqbNatGroup * | pNatY | ||
) |
Prepare printing of given area to print and specify placeholder and natural coordinates of the main object, which should be properly scaled.
|
virtual |
Destroy the object.
|
static |
Standard way to cause printing in applications.
int ZqDlgPrint::drawToFile | ( | ImageFormat | eImgFmt, |
const std::string | filepath, | ||
int | resolution, | ||
float | width, | ||
float | height, | ||
float | margins[4], | ||
int | pageSize | ||
) |
Redraw the whole area scaled to given size (in mm) to output image file of given format with given name. Resolution in dpi is provided. If the resolution is 0 then default resolution for selected image format is used instead. Returns 0 in case of success and error code otherwise. -1 means 'unsupported format'.
int ZqDlgPrint::showFileSelection | ( | std::string & | filepath | ) |
Show file selection dialog in modal mode. Return name of the user selected file.
int ZqDlgPrint::showSettings | ( | float & | width, |
float & | height, | ||
float | margins[4], | ||
int & | resolution, | ||
int & | pageSize | ||
) |
Show print options dialog in modal mode. Return size of the resulting area according to user choice and margins to add (left, right, top, bottom). Resolution is returned too (dpi), 0 means default one. All sizes are in mm. Page size as an index in pStdPages global variable is returned too.
|
protected |
Prepared print settings dialog.
|
protected |
Parent widget.