00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef IE_EXP_HTML_H
00024 #define IE_EXP_HTML_H
00025
00026 #include "ie_exp.h"
00027
00028
00029
00030
00031
00032
00033
00034 #define HTML_UCS4
00035
00036
00037
00038 #define HTML_NAMED_CONSTRUCTORS
00039
00040
00041
00042 #define HTML_DIALOG_OPTIONS
00043
00044
00045
00046 #define HTML_TABLES_SUPPORTED
00047
00048
00049
00050 #define HTML_META_SUPPORTED
00051
00052
00053
00054
00055
00056 #ifndef HTML_DIALOG_OPTIONS
00057 #define HTML_ENABLE_HTML4
00058 #define HTML_ENABLE_PHTML
00059 #endif
00060 #define HTML_ENABLE_MHTML
00061
00062
00063 class PD_Document;
00064
00065
00066
00067 class ABI_EXPORT IE_Exp_HTML_Sniffer : public IE_ExpSniffer
00068 {
00069 friend class IE_Exp;
00070
00071 public:
00072 IE_Exp_HTML_Sniffer ();
00073 virtual ~IE_Exp_HTML_Sniffer () {}
00074
00075 virtual bool recognizeSuffix (const char * szSuffix);
00076 virtual bool getDlgLabels (const char ** szDesc,
00077 const char ** szSuffixList,
00078 IEFileType * ft);
00079 virtual UT_Error constructExporter (PD_Document * pDocument,
00080 IE_Exp ** ppie);
00081
00082 virtual UT_Confidence_t supportsMIME (const char * szMimeType);
00083 };
00084
00085 #ifdef HTML_ENABLE_HTML4
00086
00087 class ABI_EXPORT IE_Exp_HTML4_Sniffer : public IE_ExpSniffer
00088 {
00089 friend class IE_Exp;
00090
00091 public:
00092 IE_Exp_HTML4_Sniffer ();
00093 virtual ~IE_Exp_HTML4_Sniffer () {}
00094
00095 virtual bool recognizeSuffix (const char * szSuffix);
00096 virtual bool getDlgLabels (const char ** szDesc,
00097 const char ** szSuffixList,
00098 IEFileType * ft);
00099 virtual UT_Error constructExporter (PD_Document * pDocument,
00100 IE_Exp ** ppie);
00101
00102 virtual UT_Confidence_t supportsMIME (const char * szMimeType);
00103 };
00104
00105 #endif
00106
00107 #ifdef HTML_ENABLE_PHTML
00108
00109 class ABI_EXPORT IE_Exp_PHTML_Sniffer : public IE_ExpSniffer
00110 {
00111 friend class IE_Exp;
00112
00113 public:
00114 IE_Exp_PHTML_Sniffer ();
00115 virtual ~IE_Exp_PHTML_Sniffer () {}
00116
00117 virtual bool recognizeSuffix (const char * szSuffix);
00118 virtual bool getDlgLabels (const char ** szDesc,
00119 const char ** szSuffixList,
00120 IEFileType * ft);
00121 virtual UT_Error constructExporter (PD_Document * pDocument,
00122 IE_Exp ** ppie);
00123 };
00124
00125 #endif
00126
00127 #ifdef HTML_ENABLE_MHTML
00128
00129 class ABI_EXPORT IE_Exp_MHTML_Sniffer : public IE_ExpSniffer
00130 {
00131 friend class IE_Exp;
00132
00133 public:
00134 IE_Exp_MHTML_Sniffer ();
00135 virtual ~IE_Exp_MHTML_Sniffer () {}
00136
00137 virtual bool recognizeSuffix (const char * szSuffix);
00138 virtual bool getDlgLabels (const char ** szDesc,
00139 const char ** szSuffixList,
00140 IEFileType * ft);
00141 virtual UT_Error constructExporter (PD_Document * pDocument,
00142 IE_Exp ** ppie);
00143 };
00144
00145 #endif
00146
00147 #ifdef HTML_DIALOG_OPTIONS
00148 #include "xap_Dlg_HTMLOptions.h"
00149 #else
00150
00151
00152
00153
00154 struct XAP_Exp_HTMLOptions
00155 {
00156 bool bIs4;
00157 bool bIsAbiWebDoc;
00158 bool bDeclareXML;
00159 bool bAllowAWML;
00160 bool bEmbedCSS;
00161 bool bLinkCSS;
00162 bool bEmbedImages;
00163 bool bClassOnly;
00164 bool bAbsUnits;
00165 bool bScaleUnits;
00166 UT_uint32 iCompact;
00167
00168
00169 bool bMultipart;
00170 };
00171
00172 #endif
00173
00174 class s_StyleTree;
00175
00176 class ABI_EXPORT IE_Exp_HTML : public IE_Exp
00177 {
00178 public:
00179 IE_Exp_HTML (PD_Document * pDocument);
00180 virtual ~IE_Exp_HTML ();
00181
00182 static bool RecognizeSuffix (const char * szSuffix);
00183 static UT_Error StaticConstructor (PD_Document * pDocument,
00184 IE_Exp ** ppie);
00185 static bool GetDlgLabels (const char ** pszDesc,
00186 const char ** pszSuffixList,
00187 IEFileType * ft);
00188 static bool SupportsFileType (IEFileType ft);
00189
00190 inline void suppressDialog (bool disable = true) { m_bSuppressDialog = disable; }
00191
00192 inline void set_HTML4 (bool enable = true) { m_exp_opt.bIs4 = enable; }
00193 inline void set_PHTML (bool enable = true) { m_exp_opt.bIsAbiWebDoc = enable; }
00194 inline void set_MHTML (bool enable = true) { m_exp_opt.bMultipart = enable; }
00195
00196 static void printStyleTree(PD_Document *pDocument, UT_ByteBuf& tree);
00197
00198 private:
00199 UT_Error _doOptions ();
00200 void _buildStyleTree ();
00201 protected:
00202 virtual UT_Error _writeDocument ();
00203 public:
00204 virtual UT_Error _writeDocument (bool bClipBoard, bool bTemplateBody);
00205 private:
00206 s_StyleTree * m_style_tree;
00207 bool m_bSuppressDialog;
00208 XAP_Exp_HTMLOptions m_exp_opt;
00209 UT_UTF8String m_sLinkCSS;
00210 UT_UTF8String m_sTitle;
00211 };
00212
00213 #endif