OOFILE  1.9
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members

Specify output to MS Word-compatible Rich Text stream. More...

#include <oofrpRTF.h>

Inheritance diagram for oofRepRTFEnv:
Inheritance graph
[legend]
Collaboration diagram for oofRepRTFEnv:
Collaboration graph
[legend]

Public Types

enum  { eRenderType ='RTF ' }
 

Public Member Functions

virtual unsigned long calcPageHeight ()
 
virtual unsigned long calcPageWidth ()
 
virtual bool canDraw ()
 Confirm can draw to stream - only used for GUI to choose destination. More...
 
virtual void changeTextStyle (oofRepTextStyle *)
 
virtual void drawPageBorder (long top, long left, long bottom, long right)
 
virtual void drawPageBreak ()
 
virtual void drawSectionBreak ()
 
virtual void endEnvironment ()
 
virtual unsigned short heightOfTextStyle (oofRepTextStyle *)
 
virtual bool isPrintingEnvironment () const
 
virtual void makeRender ()
 
virtual void makeRenderDispatch (oofRepDrawable *) const
 
virtual void makeRenderDispatch (oofAdorner *) const
 
 oofRepRTFEnv ()
 
 oofRepRTFEnv (std::ostream &)
 
 oofRepRTFEnv (const char *fileName)
 
virtual bool preprocessesPageHeadersAndFooters () const
 
virtual oofRepRenderT renderType () const
 
virtual void resumeBandOverPage ()
 
virtual void splitBandOverPage ()
 
virtual void startEnvironment ()
 Setup the start of document including font, color, stylesheet and page dimensions. More...
 
virtual void startSection ()
 called before each section, regardless of settings unlike drawSectionBreak which may not be called if no page breaks specified More...
 

Static Public Member Functions

static oofString encodeRTFString (const oofString &)
 
static void encodeToRTFStream (std::ostream &, const char *)
 
static void encodeToRTFStream (std::ostream &os, oofPict *, int widthPixels, int heightPixels)
 Write as Mac Pict or Windows Bitmap. More...
 
static bool exportingBitmapsNotMetafiles ()
 
static std::ostream & out ()
 
static void writeWrappedRTFasHexData (std::ostream &os, const char *inBuf, const unsigned int inBufLen)
 Helper function for encodeToRTFStream. More...
 

Static Public Attributes

static bool sExportBitmapsNotMetafiles = true
 Due to major import problems with Metafiles in RTF, have default true on this flag. More...
 
static std::ostream * sOut = 0
 

Protected Attributes

std::ostream * mOut
 
std::ofstream * mOwnedofstream
 
int mSectionNumber
 

Detailed Description

Specify output to MS Word-compatible Rich Text stream.

Provides encoding services for strings and oofPict's.

Definition at line 31 of file oofrpRTF.h.

Constructor & Destructor Documentation

oofRepRTFEnv::oofRepRTFEnv ( )

Definition at line 55 of file oofrpRTF.cpp.

oofRepRTFEnv::oofRepRTFEnv ( std::ostream &  )
oofRepRTFEnv::oofRepRTFEnv ( const char *  fileName)

Definition at line 66 of file oofrpRTF.cpp.

Member Function Documentation

unsigned long oofRepRTFEnv::calcPageHeight ( )
virtual

Implements oofRepEnvironment.

Definition at line 129 of file oofrpRTF.cpp.

unsigned long oofRepRTFEnv::calcPageWidth ( )
virtual

Implements oofRepEnvironment.

Definition at line 137 of file oofrpRTF.cpp.

bool oofRepStreamEnv::canDraw ( )
virtualinherited

Confirm can draw to stream - only used for GUI to choose destination.

Todo:

check why there's only a Mac file dialog here - do we use under Win?

add exception for NavGetDefaultDialogOptions failing.

Reimplemented from oofRepEnvironment.

Definition at line 1323 of file oofrep2.cpp.

References oofDirectory::gotoDirectory(), oofRepStreamEnv::mOut, and oofRepStreamEnv::sOut.

void oofRepRTFEnv::changeTextStyle ( oofRepTextStyle )
virtual

Implements oofRepEnvironment.

Definition at line 116 of file oofrpRTF.cpp.

void oofRepEnvironment::drawPageBorder ( long  top,
long  left,
long  bottom,
long  right 
)
virtualinherited

Reimplemented in oofRepMacEnv, and oofRepWinGUIPreviewMFC.

Definition at line 1266 of file oofrep2.cpp.

Referenced by oofRep::drawFirstPageHeaders(), and oofRep::drawPageHeaders().

void oofRepRTFEnv::drawPageBreak ( )
virtual

Implements oofRepEnvironment.

Definition at line 108 of file oofrpRTF.cpp.

References oofRepStreamEnv::mOut.

void oofRepEnvironment::drawSectionBreak ( )
virtualinherited

Definition at line 1273 of file oofrep2.cpp.

References oofRepEnvironment::drawPageBreak().

Referenced by oofRepSection::drawSection().

oofString oofRepRTFEnv::encodeRTFString ( const oofString srcString)
static
Todo:
combine redundant encoding here and encodeToRTFStream. You can tell this class was written by a junior programmer!

Definition at line 304 of file oofrpRTF.cpp.

References oofString::adopt().

Referenced by oofRepViewBand_RTFRender::draw().

void oofRepRTFEnv::encodeToRTFStream ( std::ostream &  os,
const char *  theText 
)
static
void oofRepRTFEnv::encodeToRTFStream ( std::ostream &  os,
oofPict inPict,
int  inWidthPixels,
int  inHeightPixels 
)
static

Write as Mac Pict or Windows Bitmap.

Warning
old code included that tries to write Metafile but very unreliable.
Todo:
decide if will allow user to specify range of metafile types as well.

Definition at line 420 of file oofrpRTF.cpp.

References oofPict::bufOfJPEG(), oofPict::bytesInJPEG(), oofPict::draw(), oofPict::hasJPEG(), oofRepStreamEnv::out(), twips(), and writeWrappedRTFasHexData().

void oofRepRTFEnv::endEnvironment ( )
virtual

Reimplemented from oofRepEnvironment.

Definition at line 283 of file oofrpRTF.cpp.

References oofRepStreamEnv::mOut, and oofRepStreamEnv::out().

static bool oofRepRTFEnv::exportingBitmapsNotMetafiles ( )
inlinestatic

Definition at line 65 of file oofrpRTF.h.

unsigned short oofRepRTFEnv::heightOfTextStyle ( oofRepTextStyle )
virtual

Implements oofRepEnvironment.

Definition at line 122 of file oofrpRTF.cpp.

bool oofRepEnvironment::isPrintingEnvironment ( ) const
virtualinherited
virtual void oofRepEnvironment::makeRender ( )
inlinevirtualinherited

Definition at line 420 of file oofrep.h.

Referenced by oofRep::draw(), and oofRepMulti::draw().

void oofRepRTFEnv::makeRenderDispatch ( oofRepDrawable drawable) const
virtual

Implements oofRepEnvironment.

Definition at line 73 of file oofrpRTF.cpp.

References oofRepDrawable::makeRender().

void oofRepRTFEnv::makeRenderDispatch ( oofAdorner drawable) const
virtual

Implements oofRepEnvironment.

Definition at line 92 of file oofrpRTF.cpp.

References oofAdorner::makeRender().

std::ostream & oofRepStreamEnv::out ( )
inlinestaticinherited

Definition at line 2727 of file oofrep.h.

References oofRepStreamEnv::sOut.

Referenced by oofRepSpaceBand_XMLRender::describeLayout(), oofRepGraphBand_XMLRender::describeLayout(), oofRepLineBand_XMLRender::describeLayout(), oofRepTextBlock_XMLRender::describeLayout(), oofRepPageNoBlock_XMLRender::describeLayout(), oofRepSpaceBand_HTMLRender::draw(), oofRepGraphBand_CSVRender::draw(), oofRepGraphBand_TSVRender::draw(), oofRepLayoutBand_HTMLRender::draw(), oofRepLayoutBand_CSVRender::draw(), oofRepLayoutBand_TSVRender::draw(), oofRepFreeImageBand_RTFRender::draw(), oofRepLineBand_HTMLRender::draw(), oofRepPictBand_HTMLRender::draw(), oofRepViewBand_HTMLRender::draw(), oofRepViewBand_CSVRender::draw(), oofRepGraphBand_XMLRender::draw(), oofRepViewBand_TSVRender::draw(), oofRepTextBlock_CSVRender::draw(), oofRepTextBlock_TSVRender::draw(), oofRepTextBlock_HTMLRender::draw(), oofRepSpaceBand_RTFRender::draw(), oofRepPictBlock_HTMLRender::draw(), oofRepGraphBand_RTFRender::draw(), oofRepLayoutBand_RTFRender::draw(), oofRepLineBand_RTFRender::draw(), oofRepPictBand_RTFRender::draw(), oofRepViewBand_RTFRender::draw(), oofRepTextBlock_RTFRender::draw(), oofRepPictBlock_RTFRender::draw(), oofRepPageNoBlock_RTFRender::draw(), oofRepViewBand_CSVRender::drawColumnHeaders(), oofRepViewBand_TSVRender::drawColumnHeaders(), oofRepViewBand_RTFRender::drawColumnHeaders(), encodeToRTFStream(), endEnvironment(), oofRepViewBand_HTMLRender::endTableBody(), oofRepViewBand_XMLRender::oofRepViewBand_XMLRender(), startEnvironment(), oofRepXMLEnv::StartReport(), oofRepViewBand_HTMLRender::startTableBody(), OOF_repXMLadornerVisitor::VisitAdorner(), OOF_repXMLlayoutVisitor::VisitBandFooterBreaks(), OOF_repXMLlayoutVisitor::VisitBandFooters(), OOF_repXMLlayoutVisitor::VisitBandHeaderBreaks(), OOF_repXMLlayoutVisitor::VisitBandHeaders(), OOF_repXMLlayoutVisitor::VisitBreakList(), OOF_repXMLschemaVisitor::VisitComplexBand(), OOF_repXMLlayoutVisitor::VisitComplexBand(), OOF_repXMLstyleVisitor::VisitDrawable(), OOF_repXMLlayoutVisitor::VisitFirstPageFooters(), OOF_repXMLlayoutVisitor::VisitFirstPageHeaders(), OOF_repXMLlayoutVisitor::VisitLayoutBand(), OOF_repXMLschemaVisitor::VisitView(), and OOF_repXMLlayoutVisitor::WriteColumns().

bool oofRepRTFEnv::preprocessesPageHeadersAndFooters ( ) const
virtual

Reimplemented from oofRepEnvironment.

Definition at line 293 of file oofrpRTF.cpp.

oofRepRenderT oofRepRTFEnv::renderType ( ) const
virtual

Implements oofRepEnvironment.

Definition at line 101 of file oofrpRTF.cpp.

References eRenderType.

virtual void oofRepEnvironment::resumeBandOverPage ( )
inlinevirtualinherited
virtual void oofRepEnvironment::splitBandOverPage ( )
inlinevirtualinherited
void oofRepRTFEnv::startEnvironment ( )
virtual

Setup the start of document including font, color, stylesheet and page dimensions.

Todo:

write out font table of all fonts used in all report objects.

write out multiple styles for styles used in all report objects.

Reimplemented from oofRepEnvironment.

Definition at line 210 of file oofrpRTF.cpp.

References oofRepSettings::bottomMargin(), oofRep::currentReport(), oofRepBandList::fixedHeight(), oofRepStreamEnv::mOut, mSectionNumber, oofRepStreamEnv::out(), oofRep::pageFooters(), oofRep::pageHeaders(), oofRep::settings(), startSection(), oofRepSettings::topMargin(), and twips().

void oofRepRTFEnv::startSection ( )
virtual

called before each section, regardless of settings unlike drawSectionBreak which may not be called if no page breaks specified

Reimplemented from oofRepEnvironment.

Definition at line 149 of file oofrpRTF.cpp.

References oofRepSettings::bottomMargin(), oofRep::currentReport(), oofRep::drawFirstPageFooters(), oofRep::drawFirstPageHeaders(), oofRep::drawPageFooters(), oofRep::drawPageHeaders(), oofRepStreamEnv::mOut, mSectionNumber, oofRep::settings(), oofRep::startingPageNumber(), oofRepSettings::topMargin(), and twips().

Referenced by startEnvironment().

void oofRepRTFEnv::writeWrappedRTFasHexData ( std::ostream &  os,
const char *  inBuf,
const unsigned int  inBufLen 
)
static

Helper function for encodeToRTFStream.

Definition at line 383 of file oofrpRTF.cpp.

Referenced by oofRepFreeImageBand_RTFRender::draw(), oofRepLineBand_RTFRender::draw(), and encodeToRTFStream().

Member Data Documentation

std::ostream* oofRepStreamEnv::mOut
protectedinherited
std::ofstream* oofRepStreamEnv::mOwnedofstream
protectedinherited
int oofRepRTFEnv::mSectionNumber
protected

Definition at line 61 of file oofrpRTF.h.

Referenced by startEnvironment(), and startSection().

bool oofRepRTFEnv::sExportBitmapsNotMetafiles = true
static

Due to major import problems with Metafiles in RTF, have default true on this flag.

Definition at line 64 of file oofrpRTF.h.

ostream * oofRepStreamEnv::sOut = 0
staticinherited

Definition at line 462 of file oofrep.h.

Referenced by oofRepStreamEnv::canDraw(), and oofRepStreamEnv::out().


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