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

Class for an LQ24 compatible printer. More...

#include <LQ24Printer.h>

Inheritance diagram for FCFSupport::LQ24PrinterDevice:
FCFSupport::PrinterDevice

Public Member Functions

 LQ24PrinterDevice (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...
 
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 Tab (int column)
 Tab over to the specified column. More...
 
virtual ~LQ24PrinterDevice ()
 Destructor. More...
 
- Public Member Functions inherited from FCFSupport::PrinterDevice
 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...
 

Private Types

enum  ChCodes { FF = 12 , SI = 15 , DC2 = 18 , ESC = 27 }
 Special character codes. More...
 

Private Attributes

ofstream printerStream
 Output stream. More...
 
int currentColumn
 Current column. More...
 
double currentColumnFraction
 Current column fraction. More...
 
TypeSpacing currentSpacing
 Current spacing. More...
 
TypeWeight currentWeight
 Current weight. More...
 
TypeSlant currentSlant
 Current slant. More...
 
double oneColumnWidthFraction
 One column's width fraction. More...
 

Additional Inherited Members

- Public Types inherited from FCFSupport::PrinterDevice
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...
 
- Protected Attributes inherited from FCFSupport::PrinterDevice
bool isOpenP
 Is open flag. More...
 
PageSize pageSize
 Document page size. More...
 

Detailed Description

Class for an LQ24 compatible printer.

This is Epson's 24-bit dot matrix printers.

Author
Robert Heller <heller@deepsoft.com>

Member Enumeration Documentation

◆ ChCodes

Special character codes.

These character codes introduce various special printer functions and modes.

Enumerator
FF 

Form feed.

This code causes a page feed.

SI 

Shift In This character starts condensed (half width) spacing.

DC2 

Device control 2.

This character ends condensed (half width) spacing.

ESC 

Escape.

This character is used to introduce a number of escape sequences to perform a number of printer functions and/or set various printing modes.

Constructor & Destructor Documentation

◆ LQ24PrinterDevice()

FCFSupport::LQ24PrinterDevice::LQ24PrinterDevice ( const string  filename = "",
const string  title = "",
PageSize  pageSize = Letter,
char **  outmessage = NULL 
)

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.
pageSizeThe page size to use. This parameter is not used.
outmessagePointer to a pointer to receive any error messages for any errors that might occur. This parameter is hidden from the Tcl interface.

◆ ~LQ24PrinterDevice()

virtual FCFSupport::LQ24PrinterDevice::~LQ24PrinterDevice ( )
virtual

Destructor.


Close the printer.

Member Function Documentation

◆ ClosePrinter()

virtual bool FCFSupport::LQ24PrinterDevice::ClosePrinter ( char **  outmessage)
virtual

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 from FCFSupport::PrinterDevice.

◆ NewPage()

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

Perform a page feed and print a heading.

Parameters
headingThe heading string.

Reimplemented from FCFSupport::PrinterDevice.

◆ OpenPrinter()

virtual bool FCFSupport::LQ24PrinterDevice::OpenPrinter ( const string  filename,
PageSize  pageSize = Letter,
char **  outmessage = NULL 
)
virtual

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 from FCFSupport::PrinterDevice.

◆ Put()

virtual bool FCFSupport::LQ24PrinterDevice::Put ( const string  text)
virtual

Print a string of text.

Don't include a newline.

Parameters
textThe string to print.

Reimplemented from FCFSupport::PrinterDevice.

◆ PutLine()

virtual bool FCFSupport::LQ24PrinterDevice::PutLine ( const string  line)
virtual

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

Parameters
lineThe line to print.

Reimplemented from FCFSupport::PrinterDevice.

◆ SetTypeSlant()

virtual bool FCFSupport::LQ24PrinterDevice::SetTypeSlant ( TypeSlant  slant)
virtual

Set the type slant.

Parameters
slantThe new type slant.

Reimplemented from FCFSupport::PrinterDevice.

◆ SetTypeSpacing()

virtual bool FCFSupport::LQ24PrinterDevice::SetTypeSpacing ( TypeSpacing  spacing)
virtual

Set the the spacing.

Parameters
spacingThe new type spacing.

Reimplemented from FCFSupport::PrinterDevice.

◆ SetTypeWeight()

virtual bool FCFSupport::LQ24PrinterDevice::SetTypeWeight ( TypeWeight  weight)
virtual

Set the type weight.

Parameters
weightThe new type weight.

Reimplemented from FCFSupport::PrinterDevice.

◆ Tab()

virtual bool FCFSupport::LQ24PrinterDevice::Tab ( int  column)
virtual

Tab over to the specified column.

Parameters
columnThe desired tab column.

Reimplemented from FCFSupport::PrinterDevice.

Member Data Documentation

◆ currentColumn

int FCFSupport::LQ24PrinterDevice::currentColumn
private

Current column.

◆ currentColumnFraction

double FCFSupport::LQ24PrinterDevice::currentColumnFraction
private

Current column fraction.

◆ currentSlant

TypeSlant FCFSupport::LQ24PrinterDevice::currentSlant
private

Current slant.

◆ currentSpacing

TypeSpacing FCFSupport::LQ24PrinterDevice::currentSpacing
private

Current spacing.

◆ currentWeight

TypeWeight FCFSupport::LQ24PrinterDevice::currentWeight
private

Current weight.

◆ oneColumnWidthFraction

double FCFSupport::LQ24PrinterDevice::oneColumnWidthFraction
private

One column's width fraction.

◆ printerStream

ofstream FCFSupport::LQ24PrinterDevice::printerStream
private

Output stream.