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