Model Railroad System 2.2.2
Public Types | Public Member Functions | Protected Attributes | List of all members
FCFSupport::PrinterDevice Class Reference

Base class for printer devices (hard copy output). More...

#include <Printer.h>

Inheritance diagram for FCFSupport::PrinterDevice:
FCFSupport::LQ24PrinterDevice FCFSupport::PDFPrinterDevice FCFSupport::PostScriptPrinterDevice FCFSupport::TextPrinterDevice

Public Types

enum  PageSize { Letter , A4 }
 Page size selection, for those printers that support different page sizes. More...
 
enum  TypeSpacing { One , Half , Double }
 Horizontal type spacing. More...
 
enum  TypeWeight { Normal , Bold }
 Type weight. More...
 
enum  TypeSlant { Roman , Italic }
 Type slant. More...
 

Public Member Functions

 PrinterDevice (const string filename="", const string title="", PageSize pageSize_=Letter, char **outmessage=NULL)
 Constructor. More...
 
virtual bool OpenPrinter (const string filename, PageSize pageSize_=Letter, char **outmessage=NULL)
 Member function to open the printer. More...
 
virtual bool ClosePrinter (char **outmessage)
 Close the printer. More...
 
bool IsOpenP () const
 Is the printer open? More...
 
PageSize PrinterPageSize () const
 Return the page size. More...
 
virtual bool SetTypeSpacing (TypeSpacing spacing)
 Set the the spacing. More...
 
virtual bool SetTypeWeight (TypeWeight weight)
 Set the type weight. More...
 
virtual bool SetTypeSlant (TypeSlant slant)
 Set the type slant. More...
 
virtual bool NewPage (const string heading="")
 Perform a page feed and print a heading. More...
 
virtual bool PutLine (const string line="")
 Print out a string and follow it with a new line sequence. More...
 
virtual bool Put (const string text)
 Print a string of text. More...
 
virtual bool Put (int number)
 Print an integer. More...
 
virtual bool Put (double number)
 Print a double. More...
 
virtual bool Tab (int column)
 Tab over to the specified column. More...
 
virtual ~PrinterDevice ()
 Destructor. More...
 

Protected Attributes

bool isOpenP
 Is open flag. More...
 
PageSize pageSize
 Document page size. More...
 

Detailed Description

Base class for printer devices (hard copy output).

Defines a very basic set of printing operations, including printing strings, numbers, lines, form feeds, tabbing, and changing the spacing, weight, and slant of the type used.

Author
Robert Heller <heller@deepsoft.com>

Member Enumeration Documentation

◆ PageSize

Page size selection, for those printers that support different page sizes.

Enumerator
Letter 

US Letter page size.

A4 

European A4 page size.

◆ TypeSlant

Type slant.

Enumerator
Roman 

Upright.

Italic 

Italic.

◆ TypeSpacing

Horizontal type spacing.

This is the character width.

Enumerator
One 

Single wide characters.

Normal width charactes.

Half 

Half (actually 60%) wide characters.

Condensed printing.

Double 

Double wide characters.

◆ TypeWeight

Type weight.

Enumerator
Normal 

Normal weight.

Bold 

Heavy (bold) weight.

Constructor & Destructor Documentation

◆ PrinterDevice()

FCFSupport::PrinterDevice::PrinterDevice ( const string  filename = "",
const string  title = "",
PageSize  pageSize_ = Letter,
char **  outmessage = NULL 
)
inline

Constructor.

Create a new printer device instance from a set of parameters, all of which have default values, so this also doubles as the default base constructor.

Parameters
filenameOutput filename.
titleAn internal document title string.
pageSize_The page size to use.
outmessagePointer to a pointer to receive any error messages for any errors that might occur. This parameter is hidden from the Tcl interface.

References isOpenP, and pageSize.

◆ ~PrinterDevice()

virtual FCFSupport::PrinterDevice::~PrinterDevice ( )
inlinevirtual

Destructor.


Close the printer.

References ClosePrinter().

Member Function Documentation

◆ ClosePrinter()

virtual bool FCFSupport::PrinterDevice::ClosePrinter ( char **  outmessage)
inlinevirtual

Close the printer.

Parameters
outmessagePointer to a pointer to receive any error messages for any errors that might occur. This parameter is hidden from the Tcl interface.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::PostScriptPrinterDevice, FCFSupport::TextPrinterDevice, and FCFSupport::PDFPrinterDevice.

References isOpenP.

Referenced by ~PrinterDevice().

◆ IsOpenP()

bool FCFSupport::PrinterDevice::IsOpenP ( ) const
inline

Is the printer open?

References isOpenP.

◆ NewPage()

virtual bool FCFSupport::PrinterDevice::NewPage ( const string  heading = "")
inlinevirtual

Perform a page feed and print a heading.

Parameters
headingThe heading string.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::PDFPrinterDevice, FCFSupport::PostScriptPrinterDevice, and FCFSupport::TextPrinterDevice.

◆ OpenPrinter()

virtual bool FCFSupport::PrinterDevice::OpenPrinter ( const string  filename,
PageSize  pageSize_ = Letter,
char **  outmessage = NULL 
)
inlinevirtual

Member function to open the printer.

Parameters
filenameOutput filename.
pageSizeThe page size to use.
outmessagePointer to a pointer to receive any error messages for any errors that might occur. This parameter is hidden from the Tcl interface.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::PDFPrinterDevice, FCFSupport::PostScriptPrinterDevice, and FCFSupport::TextPrinterDevice.

References isOpenP, and pageSize.

◆ PrinterPageSize()

PageSize FCFSupport::PrinterDevice::PrinterPageSize ( ) const
inline

Return the page size.

References pageSize.

◆ Put() [1/3]

virtual bool FCFSupport::PrinterDevice::Put ( const string  text)
inlinevirtual

Print a string of text.

Don't include a newline.

Parameters
textThe string to print.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::PDFPrinterDevice, FCFSupport::PostScriptPrinterDevice, and FCFSupport::TextPrinterDevice.

Referenced by Put().

◆ Put() [2/3]

virtual bool FCFSupport::PrinterDevice::Put ( double  number)
inlinevirtual

Print a double.

Don't include a newline.

Parameters
numberThe string to print.

References Put().

◆ Put() [3/3]

virtual bool FCFSupport::PrinterDevice::Put ( int  number)
inlinevirtual

Print an integer.

Don't include a newline.

Parameters
numberThe string to print.

References Put().

◆ PutLine()

virtual bool FCFSupport::PrinterDevice::PutLine ( const string  line = "")
inlinevirtual

Print out a string and follow it with a new line sequence.

Parameters
lineThe line to print.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::TextPrinterDevice, FCFSupport::PDFPrinterDevice, and FCFSupport::PostScriptPrinterDevice.

◆ SetTypeSlant()

virtual bool FCFSupport::PrinterDevice::SetTypeSlant ( TypeSlant  slant)
inlinevirtual

Set the type slant.

Parameters
slantThe new type slant.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::PDFPrinterDevice, and FCFSupport::PostScriptPrinterDevice.

◆ SetTypeSpacing()

virtual bool FCFSupport::PrinterDevice::SetTypeSpacing ( TypeSpacing  spacing)
inlinevirtual

Set the the spacing.

Parameters
spacingThe new type spacing.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::PDFPrinterDevice, and FCFSupport::PostScriptPrinterDevice.

◆ SetTypeWeight()

virtual bool FCFSupport::PrinterDevice::SetTypeWeight ( TypeWeight  weight)
inlinevirtual

Set the type weight.

Parameters
weightThe new type weight.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::PDFPrinterDevice, and FCFSupport::PostScriptPrinterDevice.

◆ Tab()

virtual bool FCFSupport::PrinterDevice::Tab ( int  column)
inlinevirtual

Tab over to the specified column.

Parameters
columnThe desired tab column.

Reimplemented in FCFSupport::LQ24PrinterDevice, FCFSupport::PDFPrinterDevice, FCFSupport::PostScriptPrinterDevice, and FCFSupport::TextPrinterDevice.

Member Data Documentation

◆ isOpenP

bool FCFSupport::PrinterDevice::isOpenP
protected

Is open flag.

Referenced by ClosePrinter(), IsOpenP(), OpenPrinter(), and PrinterDevice().

◆ pageSize

PageSize FCFSupport::PrinterDevice::pageSize
protected

Document page size.

Referenced by OpenPrinter(), PrinterDevice(), and PrinterPageSize().