JX Application Framework
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
JPagePrinter Class Referenceabstract

#include <JPagePrinter.h>

Inheritance diagram for JPagePrinter:
[legend]

Public Types

enum  ImageOrientation {
  kPortrait = 0 ,
  kLandscape
}
 
- Public Types inherited from JPainter
enum struct  HAlign {
  kLeft ,
  kCenter ,
  kRight
}
 
enum struct  VAlign {
  kTop ,
  kCenter ,
  kBottom
}
 

Public Member Functions

 JPagePrinter (JFontManager *fontManager, const JRect &defaultClipRect)
 
 ~JPagePrinter () override
 
virtual bool WillPrintBlackWhite () const =0
 
ImageOrientation GetOrientation () const
 
void SetOrientation (const ImageOrientation orient)
 
JIndex GetPageIndex () const
 
JCoordinate GetPageWidth () const
 
JCoordinate GetPageHeight () const
 
JRect GetPageRect () const
 
void SetPageSize (const JCoordinate w, const JCoordinate h)
 
void GetPageInfo (JIndex *pageIndex, JCoordinate *w, JCoordinate *h) const
 
virtual bool OpenDocument ()=0
 
virtual bool NewPage ()=0
 
virtual void CloseDocument ()=0
 
virtual void CancelDocument ()=0
 
void LockHeader (const JCoordinate headerHeight)
 
void LockFooter (const JCoordinate footerHeight)
 
- Public Member Functions inherited from JPainter
 JPainter (JFontManager *fontManager, const JRect &defaultClipRect)
 
virtual ~JPainter ()
 
JFontManagerGetFontManager () const
 
virtual void Reset ()
 
void Reset (const JRect &defClipRect)
 
virtual void ResetAllButClipping ()
 
const JRectGetClipRect () const
 
virtual JRect SetClipRect (const JRect &r)
 
void ResetClipRect ()
 
const JRectGetDefaultClipRect () const
 
void SetDefaultClipRect (const JRect &r)
 
const JPointGetOrigin () const
 
void SetOrigin (const JCoordinate x, const JCoordinate y)
 
void SetOrigin (const JPoint &pt)
 
void ShiftOrigin (const JCoordinate dx, const JCoordinate dy)
 
void ShiftOrigin (const JPoint &delta)
 
const JPointGetPenLocation () const
 
void SetPenLocation (const JCoordinate x, const JCoordinate y)
 
void SetPenLocation (const JPoint &pt)
 
void ShiftPenLocation (const JCoordinate dx, const JCoordinate dy)
 
void ShiftPenLocation (const JPoint &delta)
 
JColorID GetPenColor () const
 
void SetPenColor (const JColorID color)
 
JSize GetLineWidth () const
 
void SetLineWidth (const JSize width)
 
bool LinesAreDashed () const
 
void DrawDashedLines (const bool on)
 
bool GetDashList (const JArray< JSize > **dashList, JSize *dashOffset) const
 
virtual void SetDashList (const JArray< JSize > &dashList, const JSize dashOffset=0)
 
bool IsFilling () const
 
void SetFilling (const bool on)
 
const JFontGetFont () const
 
void SetFontName (const JString &name)
 
void SetFontSize (const JSize size)
 
void SetFontStyle (const JFontStyle &style)
 
void SetFont (const JFont &f)
 
JSize GetLineHeight (JCoordinate *ascent, JCoordinate *descent) const
 
JSize GetLineHeight () const
 
JSize GetStringWidth (const JString &str) const
 
void String (const JCoordinate left, const JCoordinate top, const JString &str, const JCoordinate width=0, const HAlign hAlign=HAlign::kLeft, const JCoordinate height=0, const VAlign vAlign=VAlign::kTop)
 
void String (const JPoint &topLeft, const JString &str, const JCoordinate width=0, const HAlign hAlign=HAlign::kLeft, const JCoordinate height=0, const VAlign vAlign=VAlign::kTop)
 
void String (const JRect &rect, const JString &str, const HAlign hAlign=HAlign::kLeft, const VAlign vAlign=VAlign::kTop)
 
virtual void String (const JFloat angle, const JCoordinate left, const JCoordinate top, const JString &str, const JCoordinate width=0, const HAlign hAlign=HAlign::kLeft, const JCoordinate height=0, const VAlign vAlign=VAlign::kTop)=0
 
void String (const JFloat angle, const JPoint &topLeft, const JString &str, const JCoordinate width=0, const HAlign hAlign=HAlign::kLeft, const JCoordinate height=0, const VAlign vAlign=VAlign::kTop)
 
void String (const JFloat angle, const JRect &rect, const JString &str, const HAlign hAlign=HAlign::kLeft, const VAlign vAlign=VAlign::kTop)
 
virtual void StringNoSubstitutions (const JCoordinate left, const JCoordinate top, const JString &str)=0
 
virtual void Point (const JCoordinate x, const JCoordinate y)=0
 
void Point (const JPoint &pt)
 
virtual void Line (const JCoordinate x1, const JCoordinate y1, const JCoordinate x2, const JCoordinate y2)=0
 
void Line (const JPoint &pt1, const JPoint &pt2)
 
void LineTo (const JCoordinate x, const JCoordinate y)
 
void LineTo (const JPoint &pt)
 
void DeltaLine (const JCoordinate dx, const JCoordinate dy)
 
void DeltaLine (const JPoint &delta)
 
virtual void Rect (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h)=0
 
void Rect (const JPoint &upperLeft, const JCoordinate w, const JCoordinate h)
 
void Rect (const JRect &bounds)
 
void RectInside (const JRect &bounds)
 
virtual void Ellipse (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h)=0
 
void Ellipse (const JPoint &upperLeft, const JCoordinate w, const JCoordinate h)
 
void Ellipse (const JRect &bounds)
 
virtual void Arc (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h, const JFloat startAngle, const JFloat deltaAngle)=0
 
void Arc (const JPoint &upperLeft, const JCoordinate w, const JCoordinate h, const JFloat startAngle, const JFloat deltaAngle)
 
void Arc (const JRect &bounds, const JFloat startAngle, const JFloat deltaAngle)
 
virtual void Polygon (const JCoordinate left, const JCoordinate top, const JPolygon &poly)=0
 
void Polygon (const JPoint &upperLeft, const JPolygon &poly)
 
void Polygon (const JPolygon &poly)
 
void Image (const JImage &image, const JRect &srcRect, const JCoordinate left, const JCoordinate top)
 
void Image (const JImage &image, const JRect &srcRect, const JPoint &topLeft)
 
virtual void Image (const JImage &image, const JRect &srcRect, const JRect &destRect)=0
 
- Public Member Functions inherited from JPrinter
 JPrinter ()
 
 ~JPrinter () override
 
- Public Member Functions inherited from JBroadcaster
 JBroadcaster ()
 
virtual ~JBroadcaster ()
 
JBroadcasteroperator= (const JBroadcaster &source)
 
bool HasSenders () const
 
JSize GetSenderCount () const
 
bool HasRecipients () const
 
JSize GetRecipientCount () const
 
virtual JString ToString () const
 
template<class T >
void ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f)
 

Protected Member Functions

void SetPageIndex (const JIndex pageIndex)
 
virtual void ImageOrientationChanged (const ImageOrientation orient)
 
- Protected Member Functions inherited from JPainter
JSize AlignString (JCoordinate *left, JCoordinate *top, const JString &str, const JCoordinate width, const HAlign hAlign, const JCoordinate height, const VAlign vAlign) const
 
- Protected Member Functions inherited from JBroadcaster
 JBroadcaster (const JBroadcaster &source)
 
void ListenTo (const JBroadcaster *sender)
 
void StopListening (const JBroadcaster *sender)
 
void ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember)
 
void StopListening (const JBroadcaster *sender, const std::type_info &messageType)
 
template<class T >
void Send (JBroadcaster *recipient, const T &message)
 
template<class T >
void Broadcast (const T &message)
 
virtual void Receive (JBroadcaster *sender, const Message &message)
 
void SendWithFeedback (JBroadcaster *recipient, Message *message)
 
void BroadcastWithFeedback (Message *message)
 
virtual void ReceiveWithFeedback (JBroadcaster *sender, Message *message)
 
virtual void ReceiveGoingAway (JBroadcaster *sender)
 

Detailed Description

Interface for the JPagePrinter class

This class abstracts the functions required to draw to a printer.
Derived classes must implement Page Setup and Print Setup dialogs and
the following routines:

    WillPrintBlackWhite
        Returns true if the output will be black&white.

    OpenDocument
        Prepare to print.  (Page Setup and Print Setup dialogs should
        already have been successfully completed.)  Return false
        if an error occurs.

    NewPage
        Open a new page.  Return false if printing was cancelled.

    CloseDocument
        Send the result to the printer.

    CancelDocument
        Abort the process.  Subsequent calls to NewPage should return false.

Member Enumeration Documentation

◆ ImageOrientation

Enumerator
kPortrait 
kLandscape 

Constructor & Destructor Documentation

◆ JPagePrinter()

JPagePrinter::JPagePrinter ( JFontManager fontManager,
const JRect defaultClipRect 
)

◆ ~JPagePrinter()

JPagePrinter::~JPagePrinter ( )
override

Member Function Documentation

◆ CancelDocument()

virtual void JPagePrinter::CancelDocument ( )
pure virtual

Implemented in JPSPrinter.

◆ CloseDocument()

virtual void JPagePrinter::CloseDocument ( )
pure virtual

Implemented in JPSPrinter, and JXPSPrinter.

◆ GetOrientation()

JPagePrinter::ImageOrientation JPagePrinter::GetOrientation ( ) const
inline

◆ GetPageHeight()

JCoordinate JPagePrinter::GetPageHeight ( ) const
inline

◆ GetPageIndex()

JIndex JPagePrinter::GetPageIndex ( ) const
inline

◆ GetPageInfo()

void JPagePrinter::GetPageInfo ( JIndex pageIndex,
JCoordinate w,
JCoordinate h 
) const
inline

◆ GetPageRect()

JRect JPagePrinter::GetPageRect ( ) const
inline

◆ GetPageWidth()

JCoordinate JPagePrinter::GetPageWidth ( ) const
inline

◆ ImageOrientationChanged()

void JPagePrinter::ImageOrientationChanged ( const ImageOrientation  orient)
protectedvirtual

The default is to do nothing.

Reimplemented in JPSPrinter.

◆ LockFooter()

void JPagePrinter::LockFooter ( const JCoordinate  footerHeight)

Lock off the bottom of the page so no more drawing can be done there. This is done by adjusting the clipping. The page rect is adjusted to reflect the change.

◆ LockHeader()

void JPagePrinter::LockHeader ( const JCoordinate  headerHeight)

Lock off the top of the page so no more drawing can be done there. This is done by adjusting the clipping. The page rect is adjusted to reflect the change.

◆ NewPage()

virtual bool JPagePrinter::NewPage ( )
pure virtual

Implemented in JPSPrinter.

◆ OpenDocument()

virtual bool JPagePrinter::OpenDocument ( )
pure virtual

Implemented in JPSPrinter, and JXPSPrinter.

◆ SetOrientation()

void JPagePrinter::SetOrientation ( const ImageOrientation  orient)
inline

◆ SetPageIndex()

void JPagePrinter::SetPageIndex ( const JIndex  pageIndex)
inlineprotected

◆ SetPageSize()

void JPagePrinter::SetPageSize ( const JCoordinate  w,
const JCoordinate  h 
)
inline

◆ WillPrintBlackWhite()

virtual bool JPagePrinter::WillPrintBlackWhite ( ) const
pure virtual

Implemented in JPSPrinter.


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