00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 1998-2003 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 00023 #ifndef IE_IMP_WML_H 00024 #define IE_IMP_WML_H 00025 00026 #include "ie_imp_XML.h" 00027 #include "ie_Table.h" 00028 00029 class PD_Document; 00030 00031 // The importer/reader for WML files. 00032 00033 class IE_Imp_WML_Sniffer : public IE_ImpSniffer 00034 { 00035 friend class IE_Imp; 00036 00037 public: 00038 IE_Imp_WML_Sniffer(const char * name); 00039 virtual ~IE_Imp_WML_Sniffer() {} 00040 00041 virtual const IE_SuffixConfidence * getSuffixConfidence (); 00042 virtual const IE_MimeConfidence * getMimeConfidence (); 00043 virtual UT_Confidence_t recognizeContents (const char * szBuf, 00044 UT_uint32 iNumbytes); 00045 virtual bool getDlgLabels (const char ** szDesc, 00046 const char ** szSuffixList, 00047 IEFileType * ft); 00048 virtual UT_Error constructImporter (PD_Document * pDocument, 00049 IE_Imp ** ppie); 00050 00051 }; 00052 00053 class IE_Imp_WML : public IE_Imp_XML 00054 { 00055 public: 00056 IE_Imp_WML(PD_Document * pDocument); 00057 virtual ~IE_Imp_WML(); 00058 00059 void startElement(const gchar *name, 00060 const gchar **atts); 00061 void endElement(const gchar *name); 00062 void charData(const gchar *s, int len); 00063 00064 private: 00065 void openTable(const gchar **atts); 00066 void closeTable(void); 00067 void openRow(const gchar **atts); 00068 void closeRow(void); 00069 void openCell(const gchar **atts); 00070 void closeCell(void); 00071 void createImage(const char *name, const gchar **atts); 00072 00073 bool m_bOpenedBlock; 00074 bool m_bOpenedSection; 00075 UT_sint32 m_iColumns; 00076 UT_uint32 m_iImages; 00077 UT_sint32 m_iOpenedColumns; 00078 IE_Imp_TableHelperStack * m_TableHelperStack; 00079 }; 00080 00081 #endif /* IE_IMP_WML_H */