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 00023 #ifndef IE_IMP_MIF_H 00024 #define IE_IMP_MIF_H 00025 00026 #include <stdio.h> 00027 #include "ie_imp.h" 00028 #include"ut_mbtowc.h" 00029 class PD_Document; 00030 00031 // The importer/reader for MIF files 00032 00033 class IE_Imp_MIF_Sniffer : public IE_ImpSniffer 00034 { 00035 friend class IE_Imp; 00036 00037 public: 00038 IE_Imp_MIF_Sniffer(const char * name); 00039 virtual ~IE_Imp_MIF_Sniffer() {} 00040 00041 virtual const IE_SuffixConfidence * getSuffixConfidence (); 00042 virtual const IE_MimeConfidence * getMimeConfidence () { return NULL; } 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_MIF : public IE_Imp 00054 { 00055 public: 00056 IE_Imp_MIF(PD_Document * pDocument); 00057 ~IE_Imp_MIF(); 00058 00059 protected: 00060 virtual UT_Error _loadFile(GsfInput * fp); 00061 00062 UT_Error _parseFile(GsfInput * fp); 00063 UT_Error _writeHeader(GsfInput * fp); 00064 00065 private: 00066 UT_UCS4_mbtowc m_Mbtowc; 00067 }; 00068 00069 #endif /* IE_IMP_MIF_H */