#include <ie_exp_RTF.h>
Public Member Functions | |
IE_Exp_RTF (PD_Document *pDocument) | |
IE_Exp_RTF (PD_Document *pDocument, bool atticFormat) | |
virtual | ~IE_Exp_RTF () |
ie_exp_RTF_MsWord97ListMulti * | getNthMultiLevel (UT_uint32 i) const |
ie_exp_RTF_MsWord97ListSimple * | getNthSimple (UT_uint32 i) const |
ie_exp_RTF_ListOveride * | getNthOveride (UT_uint32 i) const |
UT_uint32 | getMultiLevelCount (void) const |
UT_uint32 | getSimpleListCount (void) const |
UT_uint32 | getOverideCount (void) const |
UT_uint32 | getMatchingOverideNum (UT_uint32 ID) |
void | exportHdrFtr (const char *pszHdrFtr, const char *pszHdrFtrID, const char *pszKeyword) |
UT_BidiCharType | isCharRTL () |
void | setCharRTL (UT_BidiCharType t) |
void | setByteBuf (UT_ByteBuf *pBuf) |
UT_ByteBuf * | getByteBuf (void) |
Protected Member Functions | |
virtual UT_Error | _writeDocument (void) |
UT_Error | _writeDocumentLocal (bool bSkipHeader) |
UT_sint32 | _findColor (const char *szColor) const |
UT_sint32 | _findOrAddColor (const char *szColor) |
void | _addColor (const char *szColor) |
void | _rtf_open_brace (void) |
void | _rtf_close_brace (void) |
bool | _rtf_reopen_brace (void) |
void | _rtf_keyword (const char *szKey) |
void | _rtf_keyword (const char *szKey, UT_sint32 d) |
void | _rtf_keyword_space (const char *szKey, UT_sint32 d) |
void | _rtf_keyword (const char *szKey, const char *szValue) |
void | _rtf_nonascii_hex2 (UT_sint32 d) |
void | _rtf_nonascii_hex2 (UT_sint32 d, UT_String &pStr) |
void | _rtf_keyword_hex2 (const char *szKey, UT_sint32 d) |
void | _rtf_keyword_ifnotdefault (const char *szKey, const char *szValue, UT_sint32 defaultValue) |
void | _rtf_keyword_ifnotdefault_twips (const char *szKey, const char *szValue, UT_sint32 defaultValue) |
void | _rtf_semi (void) |
void | _rtf_fontname (const char *szFontName) |
void | _rtf_chardata (const char *pbuf, UT_uint32 buflen) |
void | _rtf_chardata (const std::string &buf) |
void | _rtf_pcdata (UT_UTF8String &sPCData, bool bSupplyUC=false, UT_uint32 iAltChars=1) |
void | _rtf_pcdata (const std::string &szPCData, bool bSupplyUC=false, UT_uint32 iAltChars=1) |
void | _rtf_pcdata (const char *szPCData, bool bSupplyUC=false, UT_uint32 iAltChars=1) |
void | _rtf_nl (void) |
const gchar * | _getStyleProp (s_RTF_AttrPropAdapter_Style *pADStyle, const s_RTF_AttrPropAdapter *apa, const char *szProp) |
bool | _write_rtf_header (void) |
bool | _write_rtf_trailer (void) |
void | _clearStyles () |
void | _selectStyles () |
UT_uint32 | _getStyleNumber (const PD_Style *pStyle) |
UT_uint32 | _getStyleNumber (const gchar *szStyleName) |
void | _write_prop_ifnotdefault (const PD_Style *pStyle, const gchar *szPropName, const char *szRTFName) |
void | _write_prop_ifyes (const PD_Style *pStyle, const gchar *szPropName, const char *szRTFName) |
void | _write_tabdef (const char *szTabStops) |
void | _write_charfmt (const s_RTF_AttrPropAdapter &) |
void | _write_parafmt (const PP_AttrProp *pSpanAP, const PP_AttrProp *pBlockAP, const PP_AttrProp *pSectionAP, bool &bStartedList, pf_Frag_Strux *sdh, UT_uint32 &iCurrID, bool &bIsListBlock, UT_sint32 iNestLevel) |
void | _write_style_fmt (const PD_Style *) |
void | _write_stylesheets (void) |
void | _write_listtable (void) |
void | _output_MultiLevelRTF (ie_exp_RTF_MsWord97ListMulti *pMulti) |
void | _output_SimpleListRTF (ie_exp_RTF_MsWord97ListSimple *pSimple) |
void | _output_OveridesRTF (ie_exp_RTF_ListOveride *pOver, UT_uint32 i) |
void | _output_ListRTF (const fl_AutoNumConstPtr &pAuto, UT_uint32 iLevel) |
void | _output_LevelText (const fl_AutoNumConstPtr &pAuto, UT_uint32 iLevel, UT_UCSChar bulletsym) |
void | _get_LeftRight_Side (UT_String &LeftSide, UT_String &RightSide) |
void | _generate_level_Text (const fl_AutoNumConstPtr &pAuto, UT_String &LevelText, UT_String &LevelNumbers, UT_uint32 &lenText, UT_uint32 &ifoundLevel) |
void | _output_revision (const s_RTF_AttrPropAdapter &apa, bool bPara, pf_Frag_Strux *sdh, UT_sint32 iNestLevel, bool &bStartedList, bool &bIsListBlock, UT_uint32 &iCurrID) |
UT_sint32 | _findFont (const s_RTF_AttrPropAdapter *apa) const |
UT_sint32 | _findFont (const _rtf_font_info *pfi) const |
void | _addFont (const _rtf_font_info *pfi) |
Static Private Member Functions | |
static bool | s_escapeString (UT_UTF8String &sOutStr, UT_UCS4String &sInStr, UT_uint32 iAltChars) |
static bool | s_escapeString (UT_UTF8String &sOutStr, const char *szInStr, UT_uint32 iSize, UT_uint32 iAltChars) |
static bool | s_escapeString (std::string &outStr, const std::string &inStr, UT_uint32 iAltChars=1) |
static std::string | s_escapeString (const std::string &inStr, UT_uint32 iAltChars=1) |
static std::string | s_escapeXMLString (const std::string &inStr) |
Private Attributes | |
s_RTF_ListenerWriteDoc * | m_pListenerWriteDoc |
UT_Vector | m_vecColors |
UT_Vector | m_vecFonts |
bool | m_bNeedUnicodeText |
UT_sint32 | m_braceLevel |
bool | m_bLastWasKeyword |
bool | m_atticFormat |
UT_GenericStringMap < NumberedStyle * > | m_hashStyles |
UT_Vector | m_vecMultiLevel |
UT_Vector | m_vecSimpleList |
UT_Vector | m_vecOverides |
UT_BidiCharType | m_CharRTL |
UT_iconv_t | m_conv |
Friends | |
class | s_RTF_ListenerWriteDoc |
class | s_RTF_ListenerGetProps |
IE_Exp_RTF::IE_Exp_RTF | ( | PD_Document * | pDocument | ) |
References m_atticFormat, m_bLastWasKeyword, m_bNeedUnicodeText, m_braceLevel, m_CharRTL, m_conv, IE_Exp::m_error, m_pListenerWriteDoc, and UT_iconv_open().
IE_Exp_RTF::IE_Exp_RTF | ( | PD_Document * | pDocument, | |
bool | atticFormat | |||
) |
References m_atticFormat, m_bLastWasKeyword, m_bNeedUnicodeText, m_braceLevel, m_CharRTL, m_conv, IE_Exp::m_error, m_pListenerWriteDoc, and UT_iconv_open().
IE_Exp_RTF::~IE_Exp_RTF | ( | ) | [virtual] |
References _clearStyles(), m_conv, m_vecColors, m_vecFonts, UT_iconv_close(), UT_iconv_isValid(), UT_VECTOR_FREEALL, and UT_VECTOR_PURGEALL.
void IE_Exp_RTF::_addColor | ( | const char * | szColor | ) | [protected] |
References _findColor(), UT_GenericVector< T >::addItem(), m_vecColors, and UT_return_if_fail.
Referenced by s_RTF_ListenerGetProps::_compute_span_properties(), _findOrAddColor(), s_RTF_ListenerGetProps::_searchCellAPI(), s_RTF_ListenerGetProps::_searchTableAPI(), _writeDocumentLocal(), and s_RTF_ListenerGetProps::populateStrux().
void IE_Exp_RTF::_addFont | ( | const _rtf_font_info * | pfi | ) | [protected] |
Add a font to the font table. The font must not be present in the font table at the start of the call.
References _findFont(), UT_GenericVector< T >::addItem(), m_vecFonts, and UT_return_if_fail.
Referenced by s_RTF_ListenerGetProps::_check_revs_for_font(), s_RTF_ListenerGetProps::_compute_span_properties(), and _selectStyles().
void IE_Exp_RTF::_clearStyles | ( | ) | [protected] |
Clear the style hash.
References m_hashStyles, and UT_GenericStringMap< T >::purgeData().
Referenced by _selectStyles(), and ~IE_Exp_RTF().
UT_sint32 IE_Exp_RTF::_findColor | ( | const char * | szColor | ) | const [protected] |
References UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), and m_vecColors.
Referenced by _addColor(), s_RTF_ListenerGetProps::_compute_span_properties(), _findOrAddColor(), s_RTF_ListenerGetProps::_searchCellAPI(), s_RTF_ListenerGetProps::_searchTableAPI(), _write_charfmt(), and s_RTF_ListenerGetProps::populateStrux().
UT_sint32 IE_Exp_RTF::_findFont | ( | const s_RTF_AttrPropAdapter * | apa | ) | const [protected] |
References _rtf_font_info::init().
Referenced by _addFont(), s_RTF_ListenerGetProps::_check_revs_for_font(), s_RTF_ListenerGetProps::_compute_span_properties(), _selectStyles(), and _write_charfmt().
UT_sint32 IE_Exp_RTF::_findFont | ( | const _rtf_font_info * | pfi | ) | const [protected] |
Find a font in the font table. Return the index of the font. If it is not found, return -1.
References _rtf_font_info::_is_same(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), m_vecFonts, and UT_return_val_if_fail.
UT_sint32 IE_Exp_RTF::_findOrAddColor | ( | const char * | szColor | ) | [protected] |
References _addColor(), and _findColor().
Referenced by s_RTF_ListenerGetProps::_check_revs_for_color(), s_RTF_ListenerWriteDoc::_exportCellProps(), and _write_parafmt().
void IE_Exp_RTF::_generate_level_Text | ( | const fl_AutoNumConstPtr & | pAuto, | |
UT_String & | LevelText, | |||
UT_String & | LevelNumbers, | |||
UT_uint32 & | lenText, | |||
UT_uint32 & | ifoundLevel | |||
) | [protected] |
This method generates the leveltext and levelnumber strings.HOWEVER it does not generate the leading text string which is the length of the string. It is the responsibility of the calling routine to this.
References _get_LeftRight_Side(), _rtf_nonascii_hex2(), UT_String::c_str(), UT_String::clear(), UT_String::size(), and xxx_UT_DEBUGMSG.
Referenced by _output_LevelText().
This method splits the abiword List delim string into text to the left and right of the "%L" marker. The input string is in LeftSide.
References UT_String::c_str(), UT_String::clear(), UT_String::substr(), and xxx_UT_DEBUGMSG.
Referenced by _generate_level_Text().
Return the style number that was assigned to the given style. The style must be present in the style hash.
References PD_Style::getName().
Referenced by s_RTF_ListenerWriteDoc::_openSpan(), _write_charfmt(), _write_parafmt(), and _write_stylesheets().
UT_uint32 IE_Exp_RTF::_getStyleNumber | ( | const gchar * | szStyle | ) | [protected] |
Return the style number that was assigned to the named style. The style must be present in the style hash.
References m_hashStyles, NumberedStyle::n, UT_GenericStringMap< T >::pick(), and UT_ASSERT_HARMLESS.
const gchar * IE_Exp_RTF::_getStyleProp | ( | s_RTF_AttrPropAdapter_Style * | pADStyle, | |
const s_RTF_AttrPropAdapter * | apa, | |||
const char * | szProp | |||
) | [protected] |
Get style
References gchar, s_RTF_AttrPropAdapter::getProperty(), and s_RTF_AttrPropAdapter_Style::getProperty().
Referenced by _write_charfmt().
void IE_Exp_RTF::_output_LevelText | ( | const fl_AutoNumConstPtr & | pAuto, | |
UT_uint32 | iLevel, | |||
UT_UCSChar | bulletsym | |||
) | [protected] |
This method outputs the RTF defintion of the list pointed to by pAuto
References _generate_level_Text(), _rtf_close_brace(), _rtf_keyword(), _rtf_nonascii_hex2(), _rtf_open_brace(), UT_String::c_str(), UT_std_string_sprintf(), IE_Exp::write(), and xxx_UT_DEBUGMSG.
Referenced by _output_ListRTF().
void IE_Exp_RTF::_output_ListRTF | ( | const fl_AutoNumConstPtr & | pAuto, | |
UT_uint32 | iLevel | |||
) | [protected] |
This method outputs the RTF defintion of the list pointed to by pAuto
References _output_LevelText(), _rtf_keyword(), _rtf_keyword_ifnotdefault_twips(), ARROWHEAD_LIST, BOX_LIST, BULLETED_LIST, UT_String::c_str(), DASHED_LIST, DIAMOND_LIST, IE_Exp::getDoc(), PD_Document::getPropertyFromSDH(), HAND_LIST, HEART_LIST, HEBREW_LIST, IMPLIES_LIST, LIST_DEFAULT_INDENT_LABEL, LOWERCASE_LIST, LOWERROMAN_LIST, NUMBERED_LIST, PD_MAX_REVISION, SQUARE_LIST, STAR_LIST, TICK_LIST, TRIANGLE_LIST, UPPERCASE_LIST, UPPERROMAN_LIST, and UT_String_sprintf().
Referenced by _output_MultiLevelRTF(), _output_OveridesRTF(), and _output_SimpleListRTF().
void IE_Exp_RTF::_output_MultiLevelRTF | ( | ie_exp_RTF_MsWord97ListMulti * | pMulti | ) | [protected] |
Actually output the RTF from a multi-level list
ie_exp_RTF_MsWord97ListMulti | * pMulti pointer to a multi-level list structure. |
References _output_ListRTF(), _rtf_close_brace(), _rtf_keyword(), _rtf_open_brace(), ie_exp_RTF_MsWord97List::getAuto(), IE_Exp::getDoc(), ie_exp_RTF_MsWord97List::getID(), ie_exp_RTF_MsWord97ListMulti::getListAtLevel(), PD_Document::getUID(), UT_UniqueId::List, UT_ASSERT_NOT_REACHED, and UT_rand().
Referenced by _write_listtable().
void IE_Exp_RTF::_output_OveridesRTF | ( | ie_exp_RTF_ListOveride * | pOver, | |
UT_uint32 | i | |||
) | [protected] |
Actually output the RTF from an Overide
ie_exp_RTF_Overide | * pOver pointer to an Overide definition |
References _output_ListRTF(), _rtf_close_brace(), _rtf_keyword(), _rtf_open_brace(), ie_exp_RTF_ListOveride::getAutoNum(), and ie_exp_RTF_ListOveride::getOverideID().
Referenced by _write_listtable().
void IE_Exp_RTF::_output_revision | ( | const s_RTF_AttrPropAdapter & | apa, | |
bool | bPara, | |||
pf_Frag_Strux * | sdh, | |||
UT_sint32 | iNestLevel, | |||
bool & | bStartedList, | |||
bool & | bIsListBlock, | |||
UT_uint32 & | iCurrID | |||
) | [protected] |
References _rtf_chardata(), _rtf_close_brace(), _rtf_keyword(), _rtf_nonascii_hex2(), _rtf_open_brace(), _write_charfmt(), _write_parafmt(), UT_UTF8String::byteLength(), UT_String::c_str(), gchar, s_RTF_AttrPropAdapter::getAttribute(), IE_Exp::getDoc(), PP_Revision::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), PP_RevisionAttr::getNthRevision(), AD_Document::getRevisionIndxFromId(), AD_Document::getRevisions(), PP_RevisionAttr::getRevisionsCount(), AD_Revision::getStartTime(), PP_Revision::getType(), PP_REVISION_ADDITION, PP_REVISION_ADDITION_AND_FMT, PP_REVISION_DELETION, PP_REVISION_FMT_CHANGE, s, UT_ASSERT_HARMLESS, UT_continue_if_fail, UT_return_if_fail, UT_SHOULD_NOT_HAPPEN, and UT_UTF8String::utf8_str().
Referenced by s_RTF_ListenerWriteDoc::_rtf_open_block(), and _write_charfmt().
void IE_Exp_RTF::_output_SimpleListRTF | ( | ie_exp_RTF_MsWord97ListSimple * | pSimple | ) | [protected] |
Actually output the RTF from a Simple list
ie_exp_RTF_MsWord97ListSimple | * pSimple pointer to a Simple list structure. |
References _output_ListRTF(), _rtf_close_brace(), _rtf_keyword(), _rtf_open_brace(), ie_exp_RTF_MsWord97List::getAuto(), IE_Exp::getDoc(), ie_exp_RTF_MsWord97List::getID(), PD_Document::getUID(), UT_UniqueId::List, and UT_rand().
Referenced by _write_listtable().
void IE_Exp_RTF::_rtf_chardata | ( | const char * | pbuf, | |
UT_uint32 | buflen | |||
) | [protected] |
References _rtf_nonascii_hex2(), m_bLastWasKeyword, m_conv, UT_iconv(), UT_iconv_isValid(), UT_return_if_fail, IE_Exp::write(), and xxx_UT_DEBUGMSG.
Referenced by s_RTF_ListenerWriteDoc::_openFrame(), s_RTF_ListenerWriteDoc::_openSpan(), s_RTF_ListenerWriteDoc::_openTag(), _output_revision(), _rtf_chardata(), _write_parafmt(), _write_rtf_header(), s_RTF_ListenerWriteDoc::_writeBookmark(), s_RTF_ListenerWriteDoc::_writeEmbedData(), s_RTF_ListenerWriteDoc::_writeImageInRTF(), and s_RTF_ListenerWriteDoc::_writeRDFAnchor().
void IE_Exp_RTF::_rtf_chardata | ( | const std::string & | buf | ) | [protected] |
References _rtf_chardata().
void IE_Exp_RTF::_rtf_close_brace | ( | void | ) | [protected] |
References m_bLastWasKeyword, m_braceLevel, UT_return_if_fail, and IE_Exp::write().
Referenced by s_RTF_ListenerWriteDoc::_close_cell(), s_RTF_ListenerWriteDoc::_close_table(), s_RTF_ListenerWriteDoc::_closeFrame(), s_RTF_ListenerWriteDoc::_closeSpan(), s_RTF_ListenerWriteDoc::_export_AbiWord_Cell_props(), s_RTF_ListenerWriteDoc::_export_AbiWord_Table_props(), s_RTF_ListenerWriteDoc::_open_cell(), s_RTF_ListenerWriteDoc::_openFrame(), s_RTF_ListenerWriteDoc::_openSpan(), s_RTF_ListenerWriteDoc::_openTag(), _output_LevelText(), _output_MultiLevelRTF(), _output_OveridesRTF(), _output_revision(), _output_SimpleListRTF(), s_RTF_ListenerWriteDoc::_rtf_info(), s_RTF_ListenerWriteDoc::_rtf_open_block(), s_RTF_ListenerWriteDoc::_rtf_open_section(), _write_charfmt(), _write_listtable(), _write_parafmt(), _write_rtf_header(), _write_rtf_trailer(), _write_stylesheets(), s_RTF_ListenerWriteDoc::_writeBookmark(), s_RTF_ListenerWriteDoc::_writeEmbedData(), s_RTF_ListenerWriteDoc::_writeFieldTrailer(), s_RTF_ListenerWriteDoc::_writeHyperlink(), s_RTF_ListenerWriteDoc::_writeImageInRTF(), s_RTF_ListenerWriteDoc::_writeRDFAnchor(), s_RTF_ListenerWriteDoc::_writeSPNumProp(), s_RTF_ListenerWriteDoc::_writeTOC(), exportHdrFtr(), s_RTF_ListenerWriteDoc::populate(), and s_RTF_ListenerWriteDoc::populateStrux().
void IE_Exp_RTF::_rtf_fontname | ( | const char * | szFontName | ) | [protected] |
References _rtf_pcdata(), _rtf_semi(), and IE_Exp::write().
Referenced by _write_rtf_header().
void IE_Exp_RTF::_rtf_keyword | ( | const char * | szKey | ) | [protected] |
References m_bLastWasKeyword, and IE_Exp::write().
Referenced by s_RTF_ListenerWriteDoc::_close_cell(), s_RTF_ListenerWriteDoc::_close_table(), s_RTF_ListenerWriteDoc::_closeBlock(), s_RTF_ListenerWriteDoc::_export_AbiWord_Cell_props(), s_RTF_ListenerWriteDoc::_export_AbiWord_Table_props(), s_RTF_ListenerWriteDoc::_exportCellProps(), s_RTF_ListenerWriteDoc::_newRow(), s_RTF_ListenerWriteDoc::_open_cell(), s_RTF_ListenerWriteDoc::_open_table(), s_RTF_ListenerWriteDoc::_openFrame(), s_RTF_ListenerWriteDoc::_openSpan(), s_RTF_ListenerWriteDoc::_openTag(), _output_LevelText(), _output_ListRTF(), _output_MultiLevelRTF(), _output_OveridesRTF(), _output_revision(), _output_SimpleListRTF(), s_RTF_ListenerWriteDoc::_outputCellBorders(), s_RTF_ListenerWriteDoc::_outputData(), s_RTF_ListenerWriteDoc::_outputTableBorders(), s_RTF_ListenerWriteDoc::_rtf_docfmt(), s_RTF_ListenerWriteDoc::_rtf_info(), s_RTF_ListenerWriteDoc::_rtf_open_section(), _rtf_pcdata(), _write_charfmt(), _write_listtable(), _write_parafmt(), _write_prop_ifyes(), _write_rtf_header(), _write_style_fmt(), _write_stylesheets(), _write_tabdef(), s_RTF_ListenerWriteDoc::_writeAnnotation(), s_RTF_ListenerWriteDoc::_writeBookmark(), s_RTF_ListenerWriteDoc::_writeEmbedData(), s_RTF_ListenerWriteDoc::_writeFieldPreamble(), s_RTF_ListenerWriteDoc::_writeFieldTrailer(), s_RTF_ListenerWriteDoc::_writeHyperlink(), s_RTF_ListenerWriteDoc::_writeImageInRTF(), s_RTF_ListenerWriteDoc::_writeRDFAnchor(), s_RTF_ListenerWriteDoc::_writeSPNumProp(), s_RTF_ListenerWriteDoc::_writeTOC(), exportHdrFtr(), s_RTF_ListenerWriteDoc::populate(), and s_RTF_ListenerWriteDoc::populateStrux().
void IE_Exp_RTF::_rtf_keyword | ( | const char * | szKey, | |
UT_sint32 | d | |||
) | [protected] |
References m_bLastWasKeyword, UT_String_sprintf(), and IE_Exp::write().
void IE_Exp_RTF::_rtf_keyword | ( | const char * | szKey, | |
const char * | szValue | |||
) | [protected] |
References m_bLastWasKeyword, and IE_Exp::write().
void IE_Exp_RTF::_rtf_keyword_hex2 | ( | const char * | szKey, | |
UT_sint32 | d | |||
) | [protected] |
References m_bLastWasKeyword, UT_String_sprintf(), and IE_Exp::write().
void IE_Exp_RTF::_rtf_keyword_ifnotdefault | ( | const char * | szKey, | |
const char * | szValue, | |||
UT_sint32 | defaultValue | |||
) | [protected] |
References d, m_bLastWasKeyword, UT_String_sprintf(), and IE_Exp::write().
Referenced by s_RTF_ListenerWriteDoc::_rtf_open_section(), and _write_parafmt().
void IE_Exp_RTF::_rtf_keyword_ifnotdefault_twips | ( | const char * | szKey, | |
const char * | szValue, | |||
UT_sint32 | defaultValue | |||
) | [protected] |
References d, m_bLastWasKeyword, UT_convertToPoints(), UT_String_sprintf(), and IE_Exp::write().
Referenced by s_RTF_ListenerWriteDoc::_exportCellProps(), _output_ListRTF(), s_RTF_ListenerWriteDoc::_rtf_docfmt(), s_RTF_ListenerWriteDoc::_rtf_open_section(), _write_parafmt(), _write_prop_ifnotdefault(), and s_RTF_ListenerWriteDoc::_writeImageInRTF().
void IE_Exp_RTF::_rtf_keyword_space | ( | const char * | szKey, | |
UT_sint32 | d | |||
) | [protected] |
References m_bLastWasKeyword, UT_String_sprintf(), and IE_Exp::write().
Referenced by s_RTF_ListenerWriteDoc::_writeAnnotation(), and s_RTF_ListenerWriteDoc::populate().
void IE_Exp_RTF::_rtf_nl | ( | void | ) | [protected] |
References IE_Exp::write().
Referenced by s_RTF_ListenerWriteDoc::_newRow(), s_RTF_ListenerWriteDoc::_openFrame(), s_RTF_ListenerWriteDoc::_openTag(), s_RTF_ListenerWriteDoc::_rtf_open_block(), s_RTF_ListenerWriteDoc::_rtf_open_section(), _write_listtable(), _write_rtf_header(), _write_stylesheets(), s_RTF_ListenerWriteDoc::_writeEmbedData(), s_RTF_ListenerWriteDoc::_writeImageInRTF(), and exportHdrFtr().
void IE_Exp_RTF::_rtf_nonascii_hex2 | ( | UT_sint32 | d | ) | [protected] |
References m_bLastWasKeyword, UT_String_sprintf(), and IE_Exp::write().
Referenced by _generate_level_Text(), _output_LevelText(), _output_revision(), s_RTF_ListenerWriteDoc::_outputData(), and _rtf_chardata().
References UT_String_sprintf().
void IE_Exp_RTF::_rtf_open_brace | ( | void | ) | [protected] |
References m_bLastWasKeyword, m_braceLevel, and IE_Exp::write().
Referenced by s_RTF_ListenerWriteDoc::_close_cell(), s_RTF_ListenerWriteDoc::_close_table(), s_RTF_ListenerWriteDoc::_export_AbiWord_Cell_props(), s_RTF_ListenerWriteDoc::_export_AbiWord_Table_props(), s_RTF_ListenerWriteDoc::_newRow(), s_RTF_ListenerWriteDoc::_open_cell(), s_RTF_ListenerWriteDoc::_open_table(), s_RTF_ListenerWriteDoc::_openFrame(), s_RTF_ListenerWriteDoc::_openSpan(), s_RTF_ListenerWriteDoc::_openTag(), _output_LevelText(), _output_MultiLevelRTF(), _output_OveridesRTF(), _output_revision(), _output_SimpleListRTF(), s_RTF_ListenerWriteDoc::_rtf_info(), _write_charfmt(), _write_listtable(), _write_parafmt(), _write_rtf_header(), _write_stylesheets(), s_RTF_ListenerWriteDoc::_writeAnnotation(), s_RTF_ListenerWriteDoc::_writeBookmark(), s_RTF_ListenerWriteDoc::_writeEmbedData(), s_RTF_ListenerWriteDoc::_writeFieldPreamble(), s_RTF_ListenerWriteDoc::_writeFieldTrailer(), s_RTF_ListenerWriteDoc::_writeHyperlink(), s_RTF_ListenerWriteDoc::_writeImageInRTF(), s_RTF_ListenerWriteDoc::_writeRDFAnchor(), s_RTF_ListenerWriteDoc::_writeSPNumProp(), s_RTF_ListenerWriteDoc::_writeTOC(), exportHdrFtr(), s_RTF_ListenerWriteDoc::populate(), and s_RTF_ListenerWriteDoc::populateStrux().
void IE_Exp_RTF::_rtf_pcdata | ( | UT_UTF8String & | sPCData, | |
bool | bSupplyUC = false , |
|||
UT_uint32 | iAltChars = 1 | |||
) | [protected] |
References _rtf_keyword(), m_bLastWasKeyword, s_escapeString(), UT_UTF8String::ucs4_str(), UT_UTF8String::utf8_str(), and IE_Exp::write().
Referenced by _rtf_fontname(), s_RTF_ListenerWriteDoc::_rtf_info(), _rtf_pcdata(), and _write_stylesheets().
void IE_Exp_RTF::_rtf_pcdata | ( | const std::string & | szPCData, | |
bool | bSupplyUC = false , |
|||
UT_uint32 | iAltChars = 1 | |||
) | [protected] |
References _rtf_pcdata().
void IE_Exp_RTF::_rtf_pcdata | ( | const char * | szPCData, | |
bool | bSupplyUC = false , |
|||
UT_uint32 | iAltChars = 1 | |||
) | [protected] |
References _rtf_pcdata().
bool IE_Exp_RTF::_rtf_reopen_brace | ( | void | ) | [protected] |
void IE_Exp_RTF::_rtf_semi | ( | void | ) | [protected] |
References m_bLastWasKeyword, and IE_Exp::write().
Referenced by _rtf_fontname(), _write_rtf_header(), and _write_stylesheets().
void IE_Exp_RTF::_selectStyles | ( | ) | [protected] |
Select styles for export. This inserts all styles to be exported into the style hash. Also, it makes sure that all fonts used in styles are present in the font table.
References _addFont(), _clearStyles(), _findFont(), PD_Document::enumStyles(), PD_Document::getAllUsedStyles(), IE_Exp::getDoc(), PD_Style::getName(), UT_GenericVector< T >::getNthItem(), PD_Document::getStyleCount(), _rtf_font_info::init(), UT_GenericStringMap< T >::insert(), m_hashStyles, UT_GenericStringMap< T >::pick(), and UT_return_if_fail.
Referenced by _writeDocumentLocal().
void IE_Exp_RTF::_write_charfmt | ( | const s_RTF_AttrPropAdapter & | apa | ) | [protected] |
Write out the <charfmt> paragraph or character formatting. This does not print opening and closing braces.
References _findColor(), _findFont(), _getStyleNumber(), _getStyleProp(), _output_revision(), _rtf_close_brace(), _rtf_keyword(), _rtf_open_brace(), d, DELETEP, gchar, IE_Exp::getDoc(), s_RTF_AttrPropAdapter::getProperty(), s_RTF_AttrPropAdapter_Style::getProperty(), PD_Document::getStyle(), m_CharRTL, UT_ASSERT_HARMLESS, UT_convertToPoints(), UT_return_if_fail, wvLangToLIDConverter(), and xxx_UT_DEBUGMSG.
Referenced by s_RTF_ListenerWriteDoc::_openSpan(), _output_revision(), _write_parafmt(), _write_style_fmt(), and s_RTF_ListenerWriteDoc::_writeFieldPreamble().
void IE_Exp_RTF::_write_listtable | ( | void | ) | [protected] |
Write the listatble group of the RTF header.
References _output_MultiLevelRTF(), _output_OveridesRTF(), _output_SimpleListRTF(), _rtf_close_brace(), _rtf_keyword(), _rtf_nl(), _rtf_open_brace(), UT_GenericVector< T >::addItem(), ie_exp_RTF_MsWord97ListMulti::addLevel(), ie_exp_RTF_MsWord97List::getAuto(), IE_Exp::getDoc(), UT_GenericVector< T >::getItemCount(), ie_exp_RTF_MsWord97ListMulti::getListAtLevel(), PD_Document::getListsCount(), UT_GenericVector< T >::getNthItem(), PD_Document::getNthList(), getNthMultiLevel(), getNthOveride(), getNthSimple(), m_vecMultiLevel, m_vecOverides, m_vecSimpleList, ie_exp_RTF_ListOveride::setOverideID(), and xxx_UT_DEBUGMSG.
Referenced by _write_rtf_header().
void IE_Exp_RTF::_write_parafmt | ( | const PP_AttrProp * | pSpanAP, | |
const PP_AttrProp * | pBlockAP, | |||
const PP_AttrProp * | pSectionAP, | |||
bool & | bStartedList, | |||
pf_Frag_Strux * | sdh, | |||
UT_uint32 & | iCurrID, | |||
bool & | bIsListBlock, | |||
UT_sint32 | iNestLevel | |||
) | [protected] |
Write out paragraphs-specific fmt. This does not print opening and closing braces.
Output fallback numbered/bulleted label for rtf readers that don't know /*/pn
OK we need to output the char props if there is a list here
OK if there is list info in this paragraph we encase it inside the {\*..} extension
field font
list decimal
list delim
list style
Finished!
OK Now output word-95 style lists
extract text before and after numbering symbol
OK Now output word-97 style lists. First detect if we've moved to a new list list structure. We need m_currID to track the previous list we were in.
References _findOrAddColor(), _getStyleNumber(), _rtf_chardata(), _rtf_close_brace(), _rtf_keyword(), _rtf_keyword_ifnotdefault(), _rtf_keyword_ifnotdefault_twips(), _rtf_open_brace(), _write_charfmt(), _write_tabdef(), BULLETED_LIST, UT_UTF8String::byteLength(), UT_String::c_str(), gchar, PP_AttrProp::getAttribute(), PD_Document::getAttrProp(), IE_Exp::getDoc(), PD_Document::getListByID(), getMatchingOverideNum(), PP_AttrProp::getProperty(), LOWERCASE_LIST, LOWERROMAN_LIST, NOT_A_LIST, NUMBERED_LIST, PP_evalProperty(), UPPERCASE_LIST, UPPERROMAN_LIST, UT_ASSERT_HARMLESS, UT_convertDimensionless(), UT_DEBUGMSG, UT_hasDimensionComponent(), UT_return_if_fail, UT_String_sprintf(), UT_UTF8String::utf8_str(), IE_Exp::write(), and xxx_UT_DEBUGMSG.
Referenced by _output_revision(), and s_RTF_ListenerWriteDoc::_rtf_open_block().
void IE_Exp_RTF::_write_prop_ifnotdefault | ( | const PD_Style * | pStyle, | |
const gchar * | szPropName, | |||
const char * | szRTFName | |||
) | [protected] |
Write an rtf keyword if the given property isn't the default value. Use this only with twips-valued properties.
!param pStyle A style. !param szPropName The property to check. !param szRTFName The RTF keyword to use if the property doesn't have the default value.
References _rtf_keyword_ifnotdefault_twips(), gchar, and PD_Style::getProperty().
Referenced by _write_style_fmt().
void IE_Exp_RTF::_write_prop_ifyes | ( | const PD_Style * | pStyle, | |
const gchar * | szPropName, | |||
const char * | szRTFName | |||
) | [protected] |
Write an RTF keyword if the given property is "yes".
References _rtf_keyword(), gchar, and PD_Style::getProperty().
Referenced by _write_style_fmt().
bool IE_Exp_RTF::_write_rtf_header | ( | void | ) | [protected] |
References _rtf_chardata(), _rtf_close_brace(), _rtf_fontname(), _rtf_keyword(), _rtf_nl(), _rtf_open_brace(), _rtf_semi(), _write_listtable(), _write_stylesheets(), UT_UTF8String::byteLength(), XAP_EncodingManager::CodepageFromCharset(), gchar, XAP_EncodingManager::get_instance(), PD_Document::getAPIFromSDH(), PP_AttrProp::getAttribute(), PD_Document::getAttrProp(), AD_Revision::getDescription(), IE_Exp::getDoc(), IE_Exp::getDocRange(), PD_Document::getDocumentRDF(), _rtf_font_info::getFontCharset(), _rtf_font_info::getFontFamily(), _rtf_font_info::getFontName(), _rtf_font_info::getFontPitch(), AD_Revision::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), PP_AttrProp::getProperty(), AD_Document::getRevisions(), PD_Document::getStruxOfTypeFromPosition(), XAP_EncodingManager::getWinCharsetCode(), XAP_EncodingManager::getWinLanguageCode(), _rtf_font_info::isTrueType(), m_atticFormat, UT_RGBColor::m_blu, IE_Exp::m_error, UT_RGBColor::m_grn, UT_RGBColor::m_red, m_vecColors, m_vecFonts, PTX_Section, s, s_escapeXMLString(), toRDFXML(), UT_continue_if_fail, UT_DEBUGMSG, UT_parseColor(), UT_return_val_if_fail, UT_UCS4_isdigit(), UT_UTF8String_sprintf(), UT_UTF8String::utf8_str(), UT_UCS4String::utf8_str(), wvLIDToCodePageConverter(), and xxx_UT_DEBUGMSG.
Referenced by _writeDocumentLocal().
bool IE_Exp_RTF::_write_rtf_trailer | ( | void | ) | [protected] |
References _rtf_close_brace(), m_braceLevel, and IE_Exp::m_error.
Referenced by _writeDocumentLocal().
void IE_Exp_RTF::_write_style_fmt | ( | const PD_Style * | pStyle | ) | [protected] |
Write out the formatting group for one style in the RTF header.
References _rtf_keyword(), _write_charfmt(), _write_prop_ifnotdefault(), _write_prop_ifyes(), _write_tabdef(), gchar, PD_Style::getProperty(), UT_ASSERT_NOT_REACHED, and UT_convertDimensionless().
Referenced by _write_stylesheets().
void IE_Exp_RTF::_write_stylesheets | ( | void | ) | [protected] |
Write the stylesheets group of the RTF header. Only styles that are used by the document are written.
References _getStyleNumber(), _rtf_close_brace(), _rtf_keyword(), _rtf_nl(), _rtf_open_brace(), _rtf_pcdata(), _rtf_semi(), _write_style_fmt(), PD_Style::getBasedOn(), IE_Exp::getDoc(), PD_Style::getFollowedBy(), PD_Style::getName(), PD_Style::isCharStyle(), m_hashStyles, NumberedStyle::n, and NumberedStyle::pStyle.
Referenced by _write_rtf_header().
void IE_Exp_RTF::_write_tabdef | ( | const char * | szTabStops | ) | [protected] |
Write out the <tabdef> paragraph formatting.
References _rtf_keyword(), UT_GenericVector< T >::addItem(), compare_tabs(), d, UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), _t::m_iTabPosition, _t::m_szTabKindKeyword, _t::m_szTabLeaderKeyword, _t::m_szTabTypeKeyword, UT_GenericVector< T >::qsort(), UCS_SPACE, UT_convertToPoints(), and UT_return_if_fail.
Referenced by _write_parafmt(), and _write_style_fmt().
UT_Error IE_Exp_RTF::_writeDocument | ( | void | ) | [protected, virtual] |
Implements IE_Exp.
References _writeDocumentLocal().
UT_Error IE_Exp_RTF::_writeDocumentLocal | ( | bool | bSkipHeader | ) | [protected] |
References _addColor(), _selectStyles(), _write_rtf_header(), _write_rtf_trailer(), DELETEP, IE_Exp::getDoc(), IE_Exp::getDocRange(), s_RTF_ListenerGetProps::hasBlock(), IE_Exp::m_error, m_pListenerWriteDoc, s_RTF_ListenerGetProps, s_RTF_ListenerWriteDoc, PD_Document::tellListener(), PD_Document::tellListenerSubset(), UT_IE_COULDNOTWRITE, and UT_OK.
Referenced by _writeDocument().
void IE_Exp_RTF::exportHdrFtr | ( | const char * | pszHdrFtr, | |
const char * | pszHdrFtrID, | |||
const char * | pszKeyWord | |||
) |
This method search for the requested header/footer section within PD_DOCument and writes into the stream at the current write point.
pszHdrFtr | constchar * string describing the type of header/footer to export. | |
pszHdrFtrID | const char * identification string for the header/footer |
References s_RTF_ListenerWriteDoc::_closeBlock(), s_RTF_ListenerWriteDoc::_closeSection(), s_RTF_ListenerWriteDoc::_closeSpan(), _rtf_close_brace(), _rtf_keyword(), _rtf_nl(), _rtf_open_brace(), s_RTF_ListenerWriteDoc::_setTabEaten(), PD_Document::findHdrFtrStrux(), gchar, PD_Document::getBounds(), IE_Exp::getDoc(), PD_Document::getNextStruxOfType(), PD_Document::getStruxPosition(), s_RTF_ListenerWriteDoc::m_bBlankLine, s_RTF_ListenerWriteDoc::m_bStartedList, m_pListenerWriteDoc, PTX_SectionHdrFtr, PD_Document::tellListenerSubset(), UT_ASSERT_NOT_REACHED, and UT_DEBUGMSG.
Referenced by s_RTF_ListenerWriteDoc::populateStrux().
UT_ByteBuf* IE_Exp_RTF::getByteBuf | ( | void | ) | [inline] |
References IE_Exp::_getByteBuf().
Referenced by s_RTF_ListenerWriteDoc::populateStrux().
Return the the number of the overide that matches the given ID. Returns 0 on failure to find a matching ID.
References ie_exp_RTF_ListOveride::doesOverideMatch(), getNthOveride(), getOverideCount(), and ie_exp_RTF_ListOveride::getOverideID().
Referenced by _write_parafmt().
UT_uint32 IE_Exp_RTF::getMultiLevelCount | ( | void | ) | const |
Get Number of multilevel lists in the document
References UT_GenericVector< T >::getItemCount(), and m_vecMultiLevel.
ie_exp_RTF_MsWord97ListMulti * IE_Exp_RTF::getNthMultiLevel | ( | UT_uint32 | i | ) | const |
Get ith Multilevel list
References UT_GenericVector< T >::getNthItem(), and m_vecMultiLevel.
Referenced by _write_listtable().
ie_exp_RTF_ListOveride * IE_Exp_RTF::getNthOveride | ( | UT_uint32 | i | ) | const |
Get ith Overide
References UT_GenericVector< T >::getNthItem(), and m_vecOverides.
Referenced by _write_listtable(), and getMatchingOverideNum().
ie_exp_RTF_MsWord97ListSimple * IE_Exp_RTF::getNthSimple | ( | UT_uint32 | i | ) | const |
Get ith Simple list
References UT_GenericVector< T >::getNthItem(), and m_vecSimpleList.
Referenced by _write_listtable().
UT_uint32 IE_Exp_RTF::getOverideCount | ( | void | ) | const |
Get Number of overides in the document
References UT_GenericVector< T >::getItemCount(), and m_vecOverides.
Referenced by getMatchingOverideNum().
UT_uint32 IE_Exp_RTF::getSimpleListCount | ( | void | ) | const |
Get Number of simple lists in the document
References UT_GenericVector< T >::getItemCount(), and m_vecSimpleList.
UT_BidiCharType IE_Exp_RTF::isCharRTL | ( | ) | [inline] |
Referenced by s_RTF_ListenerWriteDoc::_outputData().
bool IE_Exp_RTF::s_escapeString | ( | UT_UTF8String & | sOutStr, | |
UT_UCS4String & | sInStr, | |||
UT_uint32 | iAltChars | |||
) | [static, private] |
References UT_UCS4String::size(), UT_ASSERT_HARMLESS, UT_NOT_IMPLEMENTED, and UT_UTF8String_sprintf().
Referenced by _rtf_pcdata(), and s_escapeString().
bool IE_Exp_RTF::s_escapeString | ( | std::string & | outStr, | |
const std::string & | inStr, | |||
UT_uint32 | iAltChars = 1 | |||
) | [static, private] |
References UT_UTF8String::length(), s_escapeString(), and UT_UTF8String::utf8_str().
std::string IE_Exp_RTF::s_escapeString | ( | const std::string & | inStr, | |
UT_uint32 | iAltChars = 1 | |||
) | [static, private] |
References UT_UTF8String::length(), s_escapeString(), and UT_UTF8String::utf8_str().
bool IE_Exp_RTF::s_escapeString | ( | UT_UTF8String & | sOutStr, | |
const char * | szInStr, | |||
UT_uint32 | iSize, | |||
UT_uint32 | iAltChars | |||
) | [static, private] |
References s_escapeString().
std::string IE_Exp_RTF::s_escapeXMLString | ( | const std::string & | inStr | ) | [static, private] |
References replace_all(), and s.
Referenced by _write_rtf_header().
void IE_Exp_RTF::setByteBuf | ( | UT_ByteBuf * | pBuf | ) | [inline] |
References IE_Exp::_setByteBuf().
Referenced by s_RTF_ListenerWriteDoc::populateStrux().
void IE_Exp_RTF::setCharRTL | ( | UT_BidiCharType | t | ) | [inline] |
Referenced by s_RTF_ListenerWriteDoc::_closeBlock(), and s_RTF_ListenerWriteDoc::_outputData().
friend class s_RTF_ListenerGetProps [friend] |
Referenced by _writeDocumentLocal().
friend class s_RTF_ListenerWriteDoc [friend] |
Referenced by _writeDocumentLocal().
bool IE_Exp_RTF::m_atticFormat [private] |
Referenced by s_RTF_ListenerWriteDoc::_outputData(), _write_rtf_header(), and IE_Exp_RTF().
bool IE_Exp_RTF::m_bLastWasKeyword [private] |
bool IE_Exp_RTF::m_bNeedUnicodeText [private] |
Referenced by s_RTF_ListenerGetProps::_outputData(), and IE_Exp_RTF().
UT_sint32 IE_Exp_RTF::m_braceLevel [private] |
Referenced by s_RTF_ListenerWriteDoc::_openFrame(), _rtf_close_brace(), _rtf_open_brace(), _write_rtf_trailer(), and IE_Exp_RTF().
UT_BidiCharType IE_Exp_RTF::m_CharRTL [private] |
Referenced by _write_charfmt(), and IE_Exp_RTF().
UT_iconv_t IE_Exp_RTF::m_conv [private] |
Referenced by _rtf_chardata(), IE_Exp_RTF(), and ~IE_Exp_RTF().
UT_GenericStringMap<NumberedStyle*> IE_Exp_RTF::m_hashStyles [private] |
Referenced by _clearStyles(), _getStyleNumber(), _selectStyles(), and _write_stylesheets().
Referenced by _writeDocumentLocal(), exportHdrFtr(), and IE_Exp_RTF().
UT_Vector IE_Exp_RTF::m_vecColors [private] |
Referenced by _addColor(), _findColor(), _write_rtf_header(), and ~IE_Exp_RTF().
UT_Vector IE_Exp_RTF::m_vecFonts [private] |
Referenced by _addFont(), _findFont(), _write_rtf_header(), and ~IE_Exp_RTF().
UT_Vector IE_Exp_RTF::m_vecMultiLevel [private] |
Referenced by _write_listtable(), getMultiLevelCount(), and getNthMultiLevel().
UT_Vector IE_Exp_RTF::m_vecOverides [private] |
Referenced by _write_listtable(), getNthOveride(), and getOverideCount().
UT_Vector IE_Exp_RTF::m_vecSimpleList [private] |
Referenced by _write_listtable(), getNthSimple(), and getSimpleListCount().