Version: 3.0.3

#include <wx/cmndata.h>

+ Inheritance diagram for wxPrintData:

Detailed Description

This class holds a variety of information related to printers and printer device contexts.

This class is used to create a wxPrinterDC and a wxPostScriptDC. It is also used as a data member of wxPrintDialogData and wxPageSetupDialogData, as part of the mechanism for transferring data between the print dialogs and the application.

Library:  wxCore
Category:  Printing Framework, Data Structures
See also
Printing Framework Overview, wxPrintDialog, wxPageSetupDialog, wxPrintDialogData, wxPageSetupDialogData, wxPrintDialog Overview, wxPrinterDC, wxPostScriptDC

Public Member Functions

 wxPrintData ()
 Default constructor. More...
 
 wxPrintData (const wxPrintData &data)
 Copy constructor. More...
 
virtual ~wxPrintData ()
 Destructor. More...
 
wxPrintBin GetBin () const
 Returns the current bin (papersource). More...
 
bool GetCollate () const
 Returns true if collation is on. More...
 
bool GetColour () const
 Returns true if colour printing is on. More...
 
wxDuplexMode GetDuplex () const
 Returns the duplex mode. More...
 
int GetNoCopies () const
 Returns the number of copies requested by the user. More...
 
wxPrintOrientation GetOrientation () const
 Gets the orientation. More...
 
wxPaperSize GetPaperId () const
 Returns the paper size id. More...
 
const wxStringGetPrinterName () const
 Returns the printer name. More...
 
wxPrintQuality GetQuality () const
 Returns the current print quality. More...
 
bool IsOk () const
 Returns true if the print data is valid for using in print dialogs. More...
 
void SetBin (wxPrintBin flag)
 Sets the current bin. More...
 
void SetCollate (bool flag)
 Sets collation to on or off. More...
 
void SetColour (bool flag)
 Sets colour printing on or off. More...
 
void SetDuplex (wxDuplexMode mode)
 Returns the duplex mode. More...
 
void SetNoCopies (int n)
 Sets the default number of copies to be printed out. More...
 
void SetOrientation (wxPrintOrientation orientation)
 Sets the orientation. More...
 
void SetPaperId (wxPaperSize paperId)
 Sets the paper id. More...
 
void SetPrinterName (const wxString &printerName)
 Sets the printer name. More...
 
void SetQuality (wxPrintQuality quality)
 Sets the desired print quality. More...
 
wxPrintDataoperator= (const wxPrintData &data)
 Assigns print data to this object. More...
 
wxString GetFilename () const
 
void SetFilename (const wxString &filename)
 
wxPrintMode GetPrintMode () const
 
void SetPrintMode (wxPrintMode printMode)
 
- Public Member Functions inherited from wxObject
 wxObject ()
 Default ctor; initializes to NULL the internal reference data. More...
 
 wxObject (const wxObject &other)
 Copy ctor. More...
 
virtual ~wxObject ()
 Destructor. More...
 
virtual wxClassInfoGetClassInfo () const
 This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
 
wxObjectRefDataGetRefData () const
 Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
 
bool IsKindOf (const wxClassInfo *info) const
 Determines whether this class is a subclass of (or the same class as) the given class. More...
 
bool IsSameAs (const wxObject &obj) const
 Returns true if this object has the same data pointer as obj. More...
 
void Ref (const wxObject &clone)
 Makes this object refer to the data in clone. More...
 
void SetRefData (wxObjectRefData *data)
 Sets the wxObject::m_refData pointer. More...
 
void UnRef ()
 Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
 
void UnShare ()
 This is the same of AllocExclusive() but this method is public. More...
 
void operator delete (void *buf)
 The delete operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined. More...
 
void * operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
 The new operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined. More...
 

Additional Inherited Members

- Protected Member Functions inherited from wxObject
void AllocExclusive ()
 Ensure that this object's data is not shared with any other object. More...
 
virtual wxObjectRefDataCreateRefData () const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
 
virtual wxObjectRefDataCloneRefData (const wxObjectRefData *data) const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...
 
- Protected Attributes inherited from wxObject
wxObjectRefDatam_refData
 Pointer to an object which is the object's reference-counted data. More...
 

Constructor & Destructor Documentation

wxPrintData::wxPrintData ( )

Default constructor.

wxPrintData::wxPrintData ( const wxPrintData data)

Copy constructor.

virtual wxPrintData::~wxPrintData ( )
virtual

Destructor.

Member Function Documentation

wxPrintBin wxPrintData::GetBin ( ) const

Returns the current bin (papersource).

By default, the system is left to select the bin (wxPRINTBIN_DEFAULT is returned).

See SetBin() for the full list of bin values.

bool wxPrintData::GetCollate ( ) const

Returns true if collation is on.

bool wxPrintData::GetColour ( ) const

Returns true if colour printing is on.

wxDuplexMode wxPrintData::GetDuplex ( ) const

Returns the duplex mode.

One of wxDUPLEX_SIMPLEX, wxDUPLEX_HORIZONTAL, wxDUPLEX_VERTICAL.

wxString wxPrintData::GetFilename ( ) const
int wxPrintData::GetNoCopies ( ) const

Returns the number of copies requested by the user.

wxPrintOrientation wxPrintData::GetOrientation ( ) const

Gets the orientation.

This can be wxLANDSCAPE or wxPORTRAIT.

wxPaperSize wxPrintData::GetPaperId ( ) const

Returns the paper size id.

See also
SetPaperId()
const wxString& wxPrintData::GetPrinterName ( ) const

Returns the printer name.

If the printer name is the empty string, it indicates that the default printer should be used.

wxPrintMode wxPrintData::GetPrintMode ( ) const
wxPrintQuality wxPrintData::GetQuality ( ) const

Returns the current print quality.

This can be a positive integer, denoting the number of dots per inch, or one of the following identifiers:

  • wxPRINT_QUALITY_HIGH
  • wxPRINT_QUALITY_MEDIUM
  • wxPRINT_QUALITY_LOW
  • wxPRINT_QUALITY_DRAFT

On input you should pass one of these identifiers, but on return you may get back a positive integer indicating the current resolution setting.

bool wxPrintData::IsOk ( ) const

Returns true if the print data is valid for using in print dialogs.

This can return false on Windows if the current printer is not set, for example. On all other platforms, it returns true.

wxPrintData& wxPrintData::operator= ( const wxPrintData data)

Assigns print data to this object.

void wxPrintData::SetBin ( wxPrintBin  flag)

Sets the current bin.

void wxPrintData::SetCollate ( bool  flag)

Sets collation to on or off.

void wxPrintData::SetColour ( bool  flag)

Sets colour printing on or off.

void wxPrintData::SetDuplex ( wxDuplexMode  mode)

Returns the duplex mode.

One of wxDUPLEX_SIMPLEX, wxDUPLEX_HORIZONTAL, wxDUPLEX_VERTICAL.

void wxPrintData::SetFilename ( const wxString filename)
void wxPrintData::SetNoCopies ( int  n)

Sets the default number of copies to be printed out.

void wxPrintData::SetOrientation ( wxPrintOrientation  orientation)

Sets the orientation.

This can be wxLANDSCAPE or wxPORTRAIT.

void wxPrintData::SetPaperId ( wxPaperSize  paperId)

Sets the paper id.

This indicates the type of paper to be used. For a mapping between paper id, paper size and string name, see wxPrintPaperDatabase in "paper.h" (not yet documented).

void wxPrintData::SetPrinterName ( const wxString printerName)

Sets the printer name.

This can be the empty string to indicate that the default printer should be used.

void wxPrintData::SetPrintMode ( wxPrintMode  printMode)
void wxPrintData::SetQuality ( wxPrintQuality  quality)

Sets the desired print quality.

This can be a positive integer, denoting the number of dots per inch, or one of the following identifiers:

  • wxPRINT_QUALITY_HIGH
  • wxPRINT_QUALITY_MEDIUM
  • wxPRINT_QUALITY_LOW
  • wxPRINT_QUALITY_DRAFT

On input you should pass one of these identifiers, but on return you may get back a positive integer indicating the current resolution setting.