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
00023
00024 #ifndef IE_IMP_GOChart_H
00025 #define IE_IMP_GOChart_H
00026
00027 #include <stdio.h>
00028 #include "ie_imp.h"
00029 #include "ut_mbtowc.h"
00030 #include "pd_Document.h"
00031 class UT_ByteBuf;
00032 class ImportStream;
00033
00034
00035
00036 class IE_Imp_Object_Sniffer : public IE_ImpSniffer
00037 {
00038 friend class IE_Imp;
00039 friend class IE_Imp_Object;
00040
00041 public:
00042 IE_Imp_Object_Sniffer();
00043 virtual ~IE_Imp_Object_Sniffer() {}
00044
00045 virtual const IE_SuffixConfidence * getSuffixConfidence ();
00046
00047 virtual const IE_MimeConfidence * getMimeConfidence ();
00048
00049 virtual UT_Confidence_t recognizeContents (const char * szBuf,
00050 UT_uint32 iNumbytes);
00051 const char * recognizeContentsType (const char * szBuf,
00052 UT_uint32 iNumbytes);
00053 virtual bool getDlgLabels (const char ** szDesc,
00054 const char ** szSuffixList,
00055 IEFileType * ft);
00056 virtual UT_Error constructImporter (PD_Document * pDocument,
00057 IE_Imp ** ppie);
00058
00059 protected:
00060 enum UCS2_Endian { UE_BigEnd = -1, UE_NotUCS = 0, UE_LittleEnd };
00061
00062 static bool _recognizeUTF8 (const char * szBuf,
00063 UT_uint32 iNumbytes);
00064 static UCS2_Endian _recognizeUCS2 (const char * szBuf,
00065 UT_uint32 iNumbytes,
00066 bool bDeep);
00067 };
00068
00069
00070
00071 class IE_Imp_Object : public IE_Imp
00072 {
00073 public:
00074 IE_Imp_Object(PD_Document * pDocument);
00075 virtual ~IE_Imp_Object();
00076
00077 virtual bool pasteFromBuffer(PD_DocumentRange * pDocRange,
00078 const unsigned char * pData, UT_uint32 lenData, const char * szEncoding = 0);
00079 UT_ByteBuf * getByteBuf(void) const {return m_pByteBuf;}
00080
00081 protected:
00082 virtual UT_Error _loadFile (GsfInput * input);
00083 UT_Error _parseStream(ImportStream * pStream);
00084
00085 private:
00086 UT_ByteBuf * m_pByteBuf;
00087 };
00088
00089 #endif