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_WML_H
00021 #define IE_EXP_WML_H
00022
00023 #include "ie_exp.h"
00024 #include "ie_Table.h"
00025 #include "pl_Listener.h"
00026 #include "pp_AttrProp.h"
00027
00028 class PD_Document;
00029 class s_WML_Listener;
00030
00031
00032
00033 class IE_Exp_WML_Sniffer : public IE_ExpSniffer
00034 {
00035 friend class IE_Exp;
00036
00037 public:
00038 IE_Exp_WML_Sniffer (const char * name);
00039 virtual ~IE_Exp_WML_Sniffer () {}
00040
00041 virtual bool recognizeSuffix (const char * szSuffix);
00042 virtual bool getDlgLabels (const char ** szDesc,
00043 const char ** szSuffixList,
00044 IEFileType * ft);
00045 virtual UT_Error constructExporter (PD_Document * pDocument,
00046 IE_Exp ** ppie);
00047 };
00048
00049 class IE_Exp_WML : public IE_Exp
00050 {
00051 public:
00052 IE_Exp_WML(PD_Document *pDocument);
00053 virtual ~IE_Exp_WML();
00054
00055 protected:
00056 virtual UT_Error _writeDocument(void);
00057
00058 private:
00059 s_WML_Listener * m_pListener;
00060 };
00061
00062 class IE_TOCHelper;
00063 class s_WML_Listener : public PL_Listener
00064 {
00065 public:
00066 s_WML_Listener(PD_Document * pDocument,
00067 IE_Exp_WML * pie);
00068 virtual ~s_WML_Listener();
00069
00070 virtual bool populate(fl_ContainerLayout* sfh,
00071 const PX_ChangeRecord * pcr);
00072
00073 virtual bool populateStrux(pf_Frag_Strux* sdh,
00074 const PX_ChangeRecord * pcr,
00075 fl_ContainerLayout* * psfh);
00076
00077 virtual bool change(fl_ContainerLayout* sfh,
00078 const PX_ChangeRecord * pcr);
00079
00080 virtual bool insertStrux(fl_ContainerLayout* sfh,
00081 const PX_ChangeRecord * pcr,
00082 pf_Frag_Strux* sdh,
00083 PL_ListenerId lid,
00084 void (* pfnBindHandles)(pf_Frag_Strux* sdhNew,
00085 PL_ListenerId lid,
00086 fl_ContainerLayout* sfhNew));
00087
00088 virtual bool signal(UT_uint32 iSignal);
00089
00090 protected:
00091 void _closeSection(void);
00092 void _closeBlock(void);
00093 void _closeSpan(void);
00094 void _closeAnchor(void);
00095 void _closeHyperlink(void);
00096 void _openParagraph(PT_AttrPropIndex api);
00097 void _openSection(PT_AttrPropIndex api);
00098 void _openSpan(PT_AttrPropIndex api);
00099
00100 void _openTable(PT_AttrPropIndex api);
00101 void _closeTable(void);
00102 void _openCell(void);
00103 void _openRow(void);
00104 void _closeCell(void);
00105 void _closeRow(void);
00106
00107 void _outputData(const UT_UCSChar * p, UT_uint32 length);
00108 void _outputDataUnchecked(const UT_UCSChar * p, UT_uint32 length);
00109 void _handleDataItems(void);
00110 void _handleBookmark(PT_AttrPropIndex api);
00111 void _handleEmbedded(PT_AttrPropIndex api);
00112 void _handleField(const PX_ChangeRecord_Object * pcro, PT_AttrPropIndex api);
00113 void _handleHyperlink(PT_AttrPropIndex api);
00114 void _handleImage(PT_AttrPropIndex api, bool bPos = false);
00115 void _handleMath(PT_AttrPropIndex api);
00116 void _handleMetaData(void);
00117
00118 void _emitTOC (PT_AttrPropIndex api);
00119 bool _styleDescendsFrom(const char * style_name, const char * base_name);
00120
00121 PD_Document * m_pDocument;
00122 IE_Exp_WML * m_pie;
00123 bool m_bInSection;
00124 bool m_bInBlock;
00125 bool m_bInSpan;
00126 bool m_bInAnchor;
00127 bool m_bInHyperlink;
00128 bool m_bInCell;
00129 bool m_bInRow;
00130 bool m_bInTable;
00131 bool m_bPendingClose;
00132 bool m_bWasSpace;
00133 UT_uint32 m_iCards;
00134 UT_uint32 m_iTableDepth;
00135
00136 const PP_AttrProp* m_pAP_Span;
00137
00138 UT_Vector m_utvDataIDs;
00139 ie_Table mTableHelper;
00140 IE_TOCHelper * m_toc;
00141 UT_uint32 m_heading_count;
00142 };
00143
00144 #endif