Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef IE_EXP_RTF_LISTENERWRITEDOC
00021 #define IE_EXP_RTF_LISTENERWRITEDOC
00022 #include "ie_exp_RTF.h"
00023 #include "ut_wctomb.h"
00024 #include "ut_stack.h"
00025 #include "ie_Table.h"
00026 #include "pp_PropertyMap.h"
00027
00028 #include <list>
00029 #include <string>
00030
00031 class PX_ChangeRecord_Object;
00032
00033
00034
00035
00036
00037
00038
00039 class ABI_EXPORT s_RTF_ListenerWriteDoc : public PL_Listener
00040 {
00041 friend class IE_Exp_RTF;
00042 public:
00043 s_RTF_ListenerWriteDoc(PD_Document * pDocument,
00044 IE_Exp_RTF * pie,
00045 bool bToClipboard,
00046 bool bHasMultiBlock);
00047 virtual ~s_RTF_ListenerWriteDoc();
00048
00049 virtual bool populate(fl_ContainerLayout* sfh,
00050 const PX_ChangeRecord * pcr);
00051
00052 virtual bool populateStrux(pf_Frag_Strux* sdh,
00053 const PX_ChangeRecord * pcr,
00054 fl_ContainerLayout* * psfh);
00055
00056 virtual bool change(fl_ContainerLayout* sfh,
00057 const PX_ChangeRecord * pcr);
00058
00059 virtual bool insertStrux(fl_ContainerLayout* sfh,
00060 const PX_ChangeRecord * pcr,
00061 pf_Frag_Strux* sdh,
00062 PL_ListenerId lid,
00063 void (* pfnBindHandles)(pf_Frag_Strux* sdhNew,
00064 PL_ListenerId lid,
00065 fl_ContainerLayout* sfhNew));
00066
00067 virtual bool signal(UT_uint32 iSignal);
00068
00069 protected:
00070 UT_sint32 getRightOfCell(UT_sint32 row,UT_sint32 col);
00071 void _closeSection(void);
00072 void _closeBlock(PT_AttrPropIndex nextApi = 0);
00073 void _closeSpan();
00074 void _openFrame(PT_AttrPropIndex api);
00075 void _closeFrame(void);
00076 void _writeSPNumProp(const char * prop, UT_sint32 val);
00077 void _openSpan(PT_AttrPropIndex apiSpan,const PP_AttrProp * pSpanAP = NULL );
00078 void _openTag(const char * szPrefix, const char * szSuffix,
00079 bool bNewLineAfter, PT_AttrPropIndex api);
00080 void _outputData(const UT_UCSChar * p, UT_uint32 length, PT_DocPosition pos, bool bIgnorePos);
00081 void _writeTOC(PT_AttrPropIndex api);
00082 bool _isListBlock(void) const { return m_bIsListBlock;}
00083 bool _isTabEaten(void) const { return m_bIsTabEaten;}
00084 void _setListBlock( bool bListBlock)
00085 { m_bIsListBlock = bListBlock;}
00086 void _setTabEaten( bool bTabEaten)
00087 { m_bIsTabEaten = bTabEaten;}
00088 void _rtf_info (void);
00089 void _rtf_docfmt(void);
00090 void _rtf_open_section(PT_AttrPropIndex api);
00091 void _rtf_open_block(PT_AttrPropIndex api);
00092 void _writeImageInRTF(const PX_ChangeRecord_Object * pcro);
00093 void _writeBookmark(const PX_ChangeRecord_Object * pcro);
00094 void _writeRDFAnchor(const PX_ChangeRecord_Object * pcro);
00095 void _writeHyperlink(const PX_ChangeRecord_Object * pcro);
00096 void _writeAnnotation(const PX_ChangeRecord_Object * pcro);
00097 void _writeFieldPreamble(const PP_AttrProp * pSpanAP);
00098 void _writeEmbedData(const std::string & Name,
00099 const UT_ConstByteBufPtr & pbb,
00100 const std::string & mime_type);
00101 const UT_UCSChar * _getFieldValue(void);
00102 void _writeFieldTrailer(void);
00103 void _close_cell(void);
00104 void _close_table(void);
00105 void _open_cell(PT_AttrPropIndex api);
00106 void _open_table(PT_AttrPropIndex api, bool bIsCell = false);
00107 void _export_AbiWord_Table_props(PT_AttrPropIndex api);
00108 void _fillTableProps(PT_AttrPropIndex api, std::string & sTableProps);
00109 void _export_AbiWord_Cell_props(PT_AttrPropIndex api,bool bFill);
00110 void _fillCellProps(PT_AttrPropIndex api, std::string & sCellProps);
00111 void _exportCellProps(PT_AttrPropIndex api, std::string & sTableProps);
00112 void _exportTableProps(PT_AttrPropIndex api);
00113 void _getPropString(const std::string& sPropString, const char * szProp, std::string & sVal);
00114 void _newRow(void);
00115 void _outputTableBorders(UT_sint32 iThick);
00116 void _outputCellBorders(UT_sint32 iThick);
00117 double _getColumnWidthInches(void);
00118 private:
00119 PD_Document * m_pDocument;
00120 IE_Exp_RTF * m_pie;
00121 bool m_bInSpan;
00122 bool m_bInBlock;
00123 bool m_bJustStartingDoc;
00124 bool m_bJustStartingSection;
00125 bool m_bToClipboard;
00126 PT_AttrPropIndex m_apiLastSpan;
00127 bool m_bIsListBlock;
00128
00129 bool m_bIsTabEaten;
00130 PT_AttrPropIndex m_apiThisSection;
00131 PT_AttrPropIndex m_apiThisBlock;
00132 PT_AttrPropIndex m_apiThisFrame;
00133 bool m_bInFrame;
00134 bool m_bJustOpennedFrame;
00135 UT_Wctomb m_wctomb;
00136 pf_Frag_Strux* m_sdh;
00137 UT_uint32 m_currID;
00138 PT_DocPosition m_posDoc;
00139 bool m_bBlankLine;
00140 bool m_bStartedList;
00141 ie_Table m_Table;
00142 bool m_bNewTable;
00143 UT_sint32 m_iCurRow;
00144 UT_sint32 m_iLeft;
00145 UT_sint32 m_iRight;
00146 UT_sint32 m_iTop;
00147 UT_sint32 m_iBot;
00148 PT_AttrPropIndex m_apiSavedBlock;
00149 pf_Frag_Strux* m_sdhSavedBlock;
00150 bool m_bOpennedFootnote;
00151 PP_PropertyMap::TypeLineStyle m_LastLinestyle;
00152 UT_String m_sLastColor;
00153 UT_sint32 m_iFirstTop;
00154 bool m_bHyperLinkOpen;
00155 bool m_bRDFAnchorOpen;
00156 bool m_bOpenBlockForSpan;
00157 bool m_bTextBox;
00158
00159 bool m_bAnnotationOpen;
00160 UT_uint32 m_iAnnotationNumber;
00161 UT_ByteBuf * m_pAnnContent;
00162 UT_ByteBuf * m_pSavedBuf;
00163 UT_UTF8String m_sAnnTitle;
00164 UT_UTF8String m_sAnnAuthor;
00165 UT_UTF8String m_sAnnDate;
00166
00167 std::list< std::string > m_rdfAnchorStack;
00168 };
00169
00170 #endif
00171
00172
00173