00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 * 02110-1301 USA. 00020 */ 00021 00022 #ifndef IE_IMP_XSL_FO_H 00023 #define IE_IMP_XSL_FO_H 00024 00025 #include "ie_imp_XML.h" 00026 #include "ie_Table.h" 00027 00028 class PD_Document; 00029 00030 // The importer/reader for XSL-FO files. 00031 00032 class IE_Imp_XSL_FO_Sniffer : public IE_ImpSniffer 00033 { 00034 friend class IE_Imp; 00035 00036 public: 00037 IE_Imp_XSL_FO_Sniffer(const char * name); 00038 virtual ~IE_Imp_XSL_FO_Sniffer() {} 00039 00040 virtual const IE_SuffixConfidence * getSuffixConfidence (); 00041 virtual UT_Confidence_t recognizeContents (const char * szBuf, 00042 UT_uint32 iNumbytes); 00043 virtual const IE_MimeConfidence * getMimeConfidence () { return NULL; } 00044 virtual bool getDlgLabels (const char ** szDesc, 00045 const char ** szSuffixList, 00046 IEFileType * ft); 00047 virtual UT_Error constructImporter (PD_Document * pDocument, 00048 IE_Imp ** ppie); 00049 00050 }; 00051 00052 class IE_Imp_XSL_FO : public IE_Imp_XML 00053 { 00054 public: 00055 IE_Imp_XSL_FO(PD_Document * pDocument); 00056 virtual ~IE_Imp_XSL_FO(); 00057 00058 void startElement(const gchar *name, 00059 const gchar **atts); 00060 void endElement(const gchar *name); 00061 00062 void charData(const gchar *s, int len); 00063 00064 protected: 00065 00066 bool _isInListTag(void); 00067 UT_uint32 _tagTop(void); 00068 void createImage (const char *name, const gchar **atts); 00069 00070 private: 00071 00072 UT_sint32 m_iBlockDepth; 00073 UT_sint32 m_iListDepth; 00074 UT_sint32 m_iListBlockDepth; 00075 UT_sint32 m_iTableDepth; 00076 UT_uint32 m_iFootnotes; 00077 UT_uint32 m_iImages; 00078 bool m_bOpenedLink; 00079 bool m_bPendingFootnote; 00080 bool m_bInFootnote; 00081 bool m_bIgnoreFootnoteBlock; 00082 00083 UT_NumberStack m_utnsTagStack; 00084 IE_Imp_TableHelperStack * m_TableHelperStack; 00085 }; 00086 00087 #endif /* IE_IMP_XSL_FO_H */