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
00021
00022 #ifndef IE_EXP_HTML_H
00023 #define IE_EXP_HTML_H
00024
00025
00026 #include <gsf/gsf-output.h>
00027
00028 class IE_Exp_HTML;
00029
00030
00031 #include "ie_impexp_HTML.h"
00032 #include "ie_exp_HTML_util.h"
00033 #include "ie_exp_HTML_UtilListeners.h"
00034 #include "ie_exp_HTML_NavigationHelper.h"
00035 #include "ie_exp_HTML_StyleTree.h"
00036 #include "ie_exp_HTML_DocumentWriter.h"
00037 #include "ie_exp_HTML_Listener.h"
00038 #include "xap_Dlg_HTMLOptions.h"
00039
00040
00041 #include <ut_debugmsg.h>
00042 #include <ut_assert.h>
00043 #include <ut_string_class.h>
00044 #include <ut_go_file.h>
00045 #include <xap_App.h>
00046 #include <ie_types.h>
00047 #include <ie_TOC.h>
00048 #include <ap_Strings.h>
00049 #include <xap_Dialog_Id.h>
00050 #include <xap_DialogFactory.h>
00051 #include <xap_Frame.h>
00052 #include <xav_View.h>
00053 #include <ie_exp.h>
00054 #include <pt_Types.h>
00055 #include <ut_path.h>
00056
00057
00058
00059 #define HTML_UCS4
00060
00061
00062
00063 class ABI_EXPORT IE_Exp_HTML_Sniffer : public IE_ExpSniffer
00064 {
00065 friend class IE_Exp;
00066
00067 public:
00068 IE_Exp_HTML_Sniffer ();
00069 virtual ~IE_Exp_HTML_Sniffer () {}
00070
00071 virtual bool recognizeSuffix (const gchar * szSuffix);
00072 virtual bool getDlgLabels (const gchar ** szDesc,
00073 const gchar ** szSuffixList,
00074 IEFileType * ft);
00075 virtual UT_Error constructExporter (PD_Document * pDocument,
00076 IE_Exp ** ppie);
00077
00078 virtual UT_Confidence_t supportsMIME (const gchar * szMimeType);
00079 };
00080
00081 class IE_Exp_HTML_NavigationHelper;
00082 class IE_Exp_HTML_WriterFactory;
00083
00084 class ABI_EXPORT IE_Exp_HTML : public IE_Exp
00085 {
00086 public:
00087 IE_Exp_HTML (PD_Document * pDocument);
00088 virtual ~IE_Exp_HTML ();
00089
00090 static bool RecognizeSuffix (const gchar * szSuffix);
00091 static UT_Error StaticConstructor (PD_Document * pDocument,
00092 IE_Exp ** ppie);
00093 static bool GetDlgLabels (const gchar ** pszDesc,
00094 const gchar ** pszSuffixList,
00095 IEFileType * ft);
00096 static bool SupportsFileType (IEFileType ft);
00097
00098 inline void suppressDialog (bool disable = true) { m_bSuppressDialog = disable; }
00099 inline void set_HTML4 (bool enable = true) { m_exp_opt.bIs4 = enable; }
00100 inline void set_PHTML (bool enable = true) { m_exp_opt.bIsAbiWebDoc = enable; }
00101 inline void set_MHTML (bool enable = true) { m_exp_opt.bMultipart = enable; }
00102 inline void set_AddIdentifiers(bool enable = true) { m_exp_opt.bAddIdentifiers = enable; }
00103 inline void set_MathMLRenderPNG ( bool enable = true) { m_exp_opt.bMathMLRenderPNG = enable; }
00104 inline void set_SplitDocument ( bool enable = true) { m_exp_opt.bSplitDocument = enable; }
00105
00106 inline UT_UTF8String getSuffix() const { return m_suffix; }
00107 inline IE_Exp_HTML_NavigationHelper *getNavigationHelper() { return m_pNavigationHelper; }
00108 void setWriterFactory(IE_Exp_HTML_WriterFactory *pWriterFactory);
00109
00110 private:
00111 UT_Error _doOptions ();
00112 void _buildStyleTree();
00113
00114 protected:
00115 virtual UT_Error _writeDocument ();
00116 void _createChapter(PD_DocumentRange *range, const UT_UTF8String &title, bool isIndex);
00117 void _createMultipart();
00118 public:
00119 virtual UT_Error _writeDocument (bool bClipBoard, bool bTemplateBody);
00120 bool hasMathML(const UT_UTF8String &file);
00121 bool hasMathML(const std::string &file);
00122 static void printStyleTree(PD_Document *pDocument, UT_ByteBuf& sink);
00123 private:
00124
00125 IE_Exp_HTML_StyleTree * m_style_tree;
00126 IE_Exp_HTML_StyleListener *m_styleListener;
00127 bool m_bSuppressDialog;
00128 bool m_bDefaultWriterFactory;
00129 XAP_Exp_HTMLOptions m_exp_opt;
00130 UT_UTF8String m_sLinkCSS;
00131 UT_UTF8String m_sTitle;
00132
00133 UT_UTF8String m_suffix;
00134 IE_Exp_HTML_NavigationHelper *m_pNavigationHelper;
00135 IE_Exp_HTML_WriterFactory *m_pWriterFactory;
00136 std::map<UT_UTF8String, bool> m_mathmlFlags;
00137 };
00138
00139 #endif