MagicSmoke  $VERSION$
MLabelConfig Class Reference

access to the label specific configuration More...

#include <labeldlg.h>

Public Types

enum  LabelType { Invalid =0, Ticket =1, Voucher =2 }
 the type of label whose configuration is being queried More...
 
enum  PageAskMode { PageAskAlways =0, PageAskIfNeeded =1, PageAskNever =2 }
 whether to ask for the page layout when printing labels More...
 
enum  PrintAskMode { PrintAskAlways =0, PrintAskIfUnknown =1, PrintAskNever =2 }
 whether to ask for a printer when printing labels More...
 
enum  PrintMode { PrintDirect =0, PrintPixmap =1 }
 how to send data to the printer More...
 

Public Member Functions

 MLabelConfig ()
 instantiate an empty configuration object More...
 
 MLabelConfig (LabelType lt)
 instantiates a configuration object for the given label type More...
 
 MLabelConfig (const MLabelConfig &lc)
 copies the config object More...
 
bool configurePrinter (QPrinter &) const
 configures the QPrinter object to the printer set for this label type; use selectPrinter if you want to fall back to a selection dialog More...
 
LabelType labelType () const
 returns the type represented by this config object More...
 
MLabelConfigoperator= (const MLabelConfig &lc)
 copies the config object More...
 
PageAskMode pageAskMode () const
 returns the policy for asking for page layout More...
 
PrintAskMode printAskMode () const
 returns the policy for asking for a printer More...
 
QString printerName () const
 returns the configured printer name (even if not available on the local system) More...
 
PrintMode printMode () const
 returns how to send data to the printer More...
 
bool selectPrinter (QPrinter &printer, bool force=false)
 configures the printer for this particular label type; whether the dialog is shown depends on settings and printer availability; if the dialog is shown the function remembers the new printer settings More...
 

Static Public Member Functions

static void configDialog (QWidget *parent=0)
 shows the configuration dialog More...
 

Friends

QDataStream & operator<< (QDataStream &, const MLabelConfig &)
 
QDataStream & operator>> (QDataStream &, MLabelConfig &)
 

Detailed Description

access to the label specific configuration

Member Enumeration Documentation

the type of label whose configuration is being queried

Enumerator
Invalid 

invalid config object

Ticket 

ticket label

Voucher 

voucher label

whether to ask for the page layout when printing labels

Enumerator
PageAskAlways 

always ask

PageAskIfNeeded 

only ask if there are more than 1 labels on the page

PageAskNever 

never ask, just assume the whole page is available

whether to ask for a printer when printing labels

Enumerator
PrintAskAlways 

always ask for a printer

PrintAskIfUnknown 

only ask if the currently set printer is not known/connected

PrintAskNever 

never ask for a printer, just fail if the printer is unavailable

how to send data to the printer

Enumerator
PrintDirect 

print directly through the printer driver

PrintPixmap 

use a buffer pixmap to render fonts/graphics in memory first

Constructor & Destructor Documentation

MLabelConfig::MLabelConfig ( )
inline

instantiate an empty configuration object

MLabelConfig::MLabelConfig ( LabelType  lt)
inline

instantiates a configuration object for the given label type

MLabelConfig::MLabelConfig ( const MLabelConfig lc)
inline

copies the config object

Member Function Documentation

void MLabelConfig::configDialog ( QWidget *  parent = 0)
static
bool MLabelConfig::configurePrinter ( QPrinter &  prn) const

configures the QPrinter object to the printer set for this label type; use selectPrinter if you want to fall back to a selection dialog

Returns
true if the printer was successfully configured

References dumpPrn().

Referenced by configDialog(), and selectPrinter().

LabelType MLabelConfig::labelType ( ) const
inline

returns the type represented by this config object

MLabelConfig& MLabelConfig::operator= ( const MLabelConfig lc)
inline

copies the config object

MLabelConfig::PageAskMode MLabelConfig::pageAskMode ( ) const

returns the policy for asking for page layout

References PageAskIfNeeded.

Referenced by configDialog().

MLabelConfig::PrintAskMode MLabelConfig::printAskMode ( ) const

returns the policy for asking for a printer

References PrintAskIfUnknown.

Referenced by configDialog(), and selectPrinter().

QString MLabelConfig::printerName ( ) const

returns the configured printer name (even if not available on the local system)

References req, and Ticket.

Referenced by configDialog().

MLabelConfig::PrintMode MLabelConfig::printMode ( ) const

returns how to send data to the printer

References PrintDirect.

Referenced by configDialog().

bool MLabelConfig::selectPrinter ( QPrinter &  printer,
bool  force = false 
)

configures the printer for this particular label type; whether the dialog is shown depends on settings and printer availability; if the dialog is shown the function remembers the new printer settings

Parameters
printerpointer to the QPrinter object to be configured
forceif true: force showing the printer dialog
Returns
true if the selection was successful

References configurePrinter(), PrintAskAlways, PrintAskIfUnknown, printAskMode(), and PrintAskNever.

Referenced by MLabelDialog::selectPrinter().

Friends And Related Function Documentation

QDataStream& operator<< ( QDataStream &  ,
const MLabelConfig  
)
friend
QDataStream& operator>> ( QDataStream &  ,
MLabelConfig  
)
friend

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