Public Member Functions | Protected Member Functions | Private Attributes | Friends

s_RTF_ListenerWriteDoc Class Reference

#include <ie_exp_RTF_listenerWriteDoc.h>

Inheritance diagram for s_RTF_ListenerWriteDoc:

List of all members.

Public Member Functions

 s_RTF_ListenerWriteDoc (PD_Document *pDocument, IE_Exp_RTF *pie, bool bToClipboard, bool bHasMultiBlock)
virtual ~s_RTF_ListenerWriteDoc ()
virtual bool populate (fl_ContainerLayout *sfh, const PX_ChangeRecord *pcr)
virtual bool populateStrux (pf_Frag_Strux *sdh, const PX_ChangeRecord *pcr, fl_ContainerLayout **psfh)
virtual bool change (fl_ContainerLayout *sfh, const PX_ChangeRecord *pcr)
virtual bool insertStrux (fl_ContainerLayout *sfh, const PX_ChangeRecord *pcr, pf_Frag_Strux *sdh, PL_ListenerId lid, void(*pfnBindHandles)(pf_Frag_Strux *sdhNew, PL_ListenerId lid, fl_ContainerLayout *sfhNew))
virtual bool signal (UT_uint32 iSignal)

Protected Member Functions

UT_sint32 getRightOfCell (UT_sint32 row, UT_sint32 col)
void _closeSection (void)
void _closeBlock (PT_AttrPropIndex nextApi=0)
void _closeSpan ()
void _openFrame (PT_AttrPropIndex api)
void _closeFrame (void)
void _writeSPNumProp (const char *prop, UT_sint32 val)
void _openSpan (PT_AttrPropIndex apiSpan, const PP_AttrProp *pSpanAP=NULL)
void _openTag (const char *szPrefix, const char *szSuffix, bool bNewLineAfter, PT_AttrPropIndex api)
void _outputData (const UT_UCSChar *p, UT_uint32 length, PT_DocPosition pos, bool bIgnorePos)
void _writeTOC (PT_AttrPropIndex api)
bool _isListBlock (void) const
bool _isTabEaten (void) const
void _setListBlock (bool bListBlock)
void _setTabEaten (bool bTabEaten)
void _rtf_info (void)
void _rtf_docfmt (void)
void _rtf_open_section (PT_AttrPropIndex api)
void _rtf_open_block (PT_AttrPropIndex api)
void _writeImageInRTF (const PX_ChangeRecord_Object *pcro)
void _writeBookmark (const PX_ChangeRecord_Object *pcro)
void _writeRDFAnchor (const PX_ChangeRecord_Object *pcro)
void _writeHyperlink (const PX_ChangeRecord_Object *pcro)
void _writeAnnotation (const PX_ChangeRecord_Object *pcro)
void _writeFieldPreamble (const PP_AttrProp *pSpanAP)
void _writeEmbedData (const std::string &Name, const UT_ConstByteBufPtr &pbb, const std::string &mime_type)
const UT_UCSChar_getFieldValue (void)
void _writeFieldTrailer (void)
void _close_cell (void)
void _close_table (void)
void _open_cell (PT_AttrPropIndex api)
void _open_table (PT_AttrPropIndex api, bool bIsCell=false)
void _export_AbiWord_Table_props (PT_AttrPropIndex api)
void _fillTableProps (PT_AttrPropIndex api, std::string &sTableProps)
void _export_AbiWord_Cell_props (PT_AttrPropIndex api, bool bFill)
void _fillCellProps (PT_AttrPropIndex api, std::string &sCellProps)
void _exportCellProps (PT_AttrPropIndex api, std::string &sTableProps)
void _exportTableProps (PT_AttrPropIndex api)
void _getPropString (const std::string &sPropString, const char *szProp, std::string &sVal)
void _newRow (void)
void _outputTableBorders (UT_sint32 iThick)
void _outputCellBorders (UT_sint32 iThick)
double _getColumnWidthInches (void)

Private Attributes

bool m_bInSpan
bool m_bInBlock
bool m_bJustStartingDoc
bool m_bJustStartingSection
bool m_bToClipboard
PT_AttrPropIndex m_apiLastSpan
bool m_bIsListBlock
bool m_bIsTabEaten
PT_AttrPropIndex m_apiThisSection
PT_AttrPropIndex m_apiThisBlock
PT_AttrPropIndex m_apiThisFrame
bool m_bInFrame
bool m_bJustOpennedFrame
UT_Wctomb m_wctomb
UT_uint32 m_currID
PT_DocPosition m_posDoc
bool m_bBlankLine
bool m_bStartedList
ie_Table m_Table
bool m_bNewTable
UT_sint32 m_iCurRow
UT_sint32 m_iLeft
UT_sint32 m_iRight
UT_sint32 m_iTop
UT_sint32 m_iBot
PT_AttrPropIndex m_apiSavedBlock
bool m_bOpennedFootnote
PP_PropertyMap::TypeLineStyle m_LastLinestyle
UT_String m_sLastColor
UT_sint32 m_iFirstTop
bool m_bHyperLinkOpen
bool m_bRDFAnchorOpen
bool m_bOpenBlockForSpan
bool m_bTextBox
bool m_bAnnotationOpen
UT_uint32 m_iAnnotationNumber
UT_UTF8String m_sAnnTitle
UT_UTF8String m_sAnnAuthor
UT_UTF8String m_sAnnDate
std::list< std::string > m_rdfAnchorStack


class IE_Exp_RTF

Constructor & Destructor Documentation

s_RTF_ListenerWriteDoc::~s_RTF_ListenerWriteDoc (  )  [virtual]

Member Function Documentation

void s_RTF_ListenerWriteDoc::_close_cell ( void   )  [protected]
void s_RTF_ListenerWriteDoc::_closeFrame ( void   )  [protected]
void s_RTF_ListenerWriteDoc::_closeSection ( void   )  [protected]
void s_RTF_ListenerWriteDoc::_closeSpan ( void   )  [protected]
void s_RTF_ListenerWriteDoc::_export_AbiWord_Cell_props ( PT_AttrPropIndex  api,
bool  bFill 
) [protected]

This exports all the properties in a cell strux by extending rtf with a \* keyword. Code mostly copied for fl_TableLayout::_lookupProperties. This code should should be updated when new properties are defined.

References _fillCellProps(), IE_Exp_RTF::_rtf_close_brace(), IE_Exp_RTF::_rtf_keyword(), IE_Exp_RTF::_rtf_open_brace(), m_iFirstTop, m_pie, UT_std_string_getPropVal(), UT_std_string_setProperty(), UT_std_string_sprintf(), and xxx_UT_DEBUGMSG.

Referenced by _open_cell().

void s_RTF_ListenerWriteDoc::_export_AbiWord_Table_props ( PT_AttrPropIndex  api  )  [protected]

This exports all the properties in atable strux by extend rtf with a \* keyword. Code mostly copied for fl_TableLayout::_lookupProperties. This code should should be updated when new properties are defined.

References _fillTableProps(), IE_Exp_RTF::_rtf_close_brace(), IE_Exp_RTF::_rtf_keyword(), IE_Exp_RTF::_rtf_open_brace(), m_pie, and xxx_UT_DEBUGMSG.

Referenced by _open_table().

void s_RTF_ListenerWriteDoc::_exportCellProps ( PT_AttrPropIndex  api,
std::string &  sTableProps 
) [protected]
void s_RTF_ListenerWriteDoc::_exportTableProps ( PT_AttrPropIndex  api  )  [protected]
void s_RTF_ListenerWriteDoc::_fillCellProps ( PT_AttrPropIndex  api,
std::string &  sCellProps 
) [protected]

Fill the supplied UT_String with all the properties defined for a cell

References gchar, PD_Document::getAttrProp(), PP_AttrProp::getProperty(), m_pDocument, UT_std_string_setProperty(), and xxx_UT_DEBUGMSG.

Referenced by _export_AbiWord_Cell_props(), and _exportCellProps().

void s_RTF_ListenerWriteDoc::_fillTableProps ( PT_AttrPropIndex  api,
std::string &  sTableProps 
) [protected]

This method fills the suppiled string with all the properties of the table given by api

References gchar, PD_Document::getAttrProp(), PP_AttrProp::getProperty(), ie_Table::getTableSDH(), m_pDocument, m_Table, UT_std_string_setProperty(), and UT_std_string_sprintf().

Referenced by _export_AbiWord_Table_props(), and _newRow().

double s_RTF_ListenerWriteDoc::_getColumnWidthInches ( void   )  [protected]
const UT_UCSChar * s_RTF_ListenerWriteDoc::_getFieldValue ( void   )  [protected]

This method returns the field value at the current document location. If there is not a field at the current document location return NULL.

References fl_BlockLayout::findPointCoords(), fp_Run::getNextRun(), PD_Document::getNthFmtHandle(), PD_Document::getStruxOfTypeFromPosition(), fp_Run::getType(), fl_Layout::getType(), m_pDocument, m_posDoc, m_sdh, PTX_Block, and UT_return_val_if_fail.

Referenced by _writeFieldTrailer().

void s_RTF_ListenerWriteDoc::_getPropString ( const std::string &  sPropString,
const char *  szProp,
std::string &  sVal 
) [protected]

Convience function to lookup a property via const char * string. If the property is not present sVal is returned with zero size.

References UT_std_string_getPropVal().

Referenced by _exportCellProps().

bool s_RTF_ListenerWriteDoc::_isListBlock ( void   )  const [inline, protected]

Referenced by populate().

bool s_RTF_ListenerWriteDoc::_isTabEaten ( void   )  const [inline, protected]

Referenced by populate().

void s_RTF_ListenerWriteDoc::_outputCellBorders ( UT_sint32  iThick  )  [protected]
void s_RTF_ListenerWriteDoc::_outputTableBorders ( UT_sint32  iThick  )  [protected]

References IE_Exp_RTF::_rtf_keyword(), m_pie, and IE_Exp::write().

Referenced by _newRow().

void s_RTF_ListenerWriteDoc::_setListBlock ( bool  bListBlock  )  [inline, protected]
void s_RTF_ListenerWriteDoc::_setTabEaten ( bool  bTabEaten  )  [inline, protected]
void s_RTF_ListenerWriteDoc::_writeEmbedData ( const std::string &  Name,
const UT_ConstByteBufPtr pbb,
const std::string &  mime_type 
) [protected]
void s_RTF_ListenerWriteDoc::_writeFieldPreamble ( const PP_AttrProp pSpanAP  )  [protected]

This method writes out the all the boiler plate needed before every field definition.

References IE_Exp_RTF::_rtf_keyword(), IE_Exp_RTF::_rtf_open_brace(), IE_Exp_RTF::_write_charfmt(), PD_Document::getAttrProp(), m_apiThisBlock, m_apiThisSection, m_pDocument, m_pie, and IE_Exp::write().

Referenced by _openTag(), and _writeHyperlink().

void s_RTF_ListenerWriteDoc::_writeFieldTrailer ( void   )  [protected]

This method writes out the current field value and closes all the braces.

References _getFieldValue(), _outputData(), IE_Exp_RTF::_rtf_close_brace(), IE_Exp_RTF::_rtf_keyword(), IE_Exp_RTF::_rtf_open_brace(), m_pie, UT_UCS4_strlen(), and IE_Exp::write().

Referenced by _openTag().

void s_RTF_ListenerWriteDoc::_writeSPNumProp ( const char *  prop,
UT_sint32  val 
) [protected]
void s_RTF_ListenerWriteDoc::_writeTOC ( PT_AttrPropIndex  apiTOC  )  [protected]
bool s_RTF_ListenerWriteDoc::change ( fl_ContainerLayout sfh,
const PX_ChangeRecord pcr 
) [virtual]

Implements PL_Listener.


UT_sint32 s_RTF_ListenerWriteDoc::getRightOfCell ( UT_sint32  row,
UT_sint32  col 
) [protected]

This returns the right-attach of the cell to the right of the cell at (row, col)

References PD_Document::getCellSDHFromRowCol(), PD_Document::getPropertyFromSDH(), ie_Table::getTableSDH(), m_pDocument, m_Table, and PD_MAX_REVISION.

Referenced by _open_cell().

virtual bool s_RTF_ListenerWriteDoc::insertStrux ( fl_ContainerLayout sfh,
const PX_ChangeRecord pcr,
pf_Frag_Strux sdh,
PL_ListenerId  lid,
void(*)(pf_Frag_Strux *sdhNew, PL_ListenerId lid, fl_ContainerLayout *sfhNew)  pfnBindHandles 
) [virtual]

Implements PL_Listener.

bool s_RTF_ListenerWriteDoc::signal ( UT_uint32  iSignal  )  [virtual]

Implements PL_Listener.


Friends And Related Function Documentation

friend class IE_Exp_RTF [friend]

Member Data Documentation

std::list< std::string > s_RTF_ListenerWriteDoc::m_rdfAnchorStack [private]

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