UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ZqDlgPrint Class Reference

#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
 

Detailed Description

Dialog window for print parameter setting. One scaleable rectangle area is supported. Several image file formats are allowed including raster and vector ones.

Member Enumeration Documentation

List of allowed file formats.

Constructor & Destructor Documentation

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 ZqDlgPrint::~ZqDlgPrint ( )
virtual

Destroy the object.

Member Function Documentation

static void ZqDlgPrint::doIt ( QMainWindow *  parent,
QzqArea area,
ZqbPlaceholder pPlace,
ZqbNatGroup pNatX,
ZqbNatGroup pNatY,
const char *  szDefaultFilename = NULL,
const char *  szDefaultDirectory = NULL 
)
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.

Member Data Documentation

PrOptions* ZqDlgPrint::m_pDlgPrOpt
protected

Prepared print settings dialog.

QWidget* ZqDlgPrint::m_qParent
protected

Parent widget.


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