• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ie_imp_DocBook.h

Go to the documentation of this file.
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_DOCBOOK_H
00024 #define IE_IMP_DOCBOOK_H
00025 
00026 #include    "ie_imp_XML.h"
00027 #include    "ie_Table.h"
00028 #include    "fl_AutoNum.h"
00029 
00030 class PD_Document;
00031 
00032 class IE_Imp_DocBook_Sniffer : public IE_ImpSniffer
00033 {
00034     friend class IE_Imp;
00035 
00036 public:
00037     IE_Imp_DocBook_Sniffer(const char * name);
00038     virtual ~IE_Imp_DocBook_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 // The importer/reader for DocBook files.
00053 
00054 class IE_Imp_DocBook : public IE_Imp_XML
00055 {
00056 public:
00057     IE_Imp_DocBook(PD_Document * pDocument);
00058     virtual ~IE_Imp_DocBook();
00059 
00060     static bool     RecognizeContents(const char * szBuf,
00061                           UT_uint32 iNumbytes);
00062     static bool     RecognizeSuffix(const char * szSuffix);
00063     static UT_Error     StaticConstructor(PD_Document * pDocument,
00064                           IE_Imp ** ppie);
00065     static bool     GetDlgLabels(const char ** pszDesc,
00066                          const char ** pszSuffixList,
00067                          IEFileType * ft);
00068     static bool         SupportsFileType(IEFileType ft);
00069 
00070 
00071     void            startElement(const gchar *name,
00072                           const gchar **atts);
00073     void            endElement(const gchar *name);
00074 
00075     void charData(const gchar *s, int len);
00076 
00077 protected:
00078     int m_iCurListID;
00079     int m_iBlockDepth;
00080     int m_iDataDepth;
00081     int m_iListDepth;
00082     int m_iFootnotes;
00083     int m_iImages;
00084     int m_iSectionDepth;
00085     size_t m_iTitleDepth;
00086     UT_sint32 m_iNoteID;
00087     std::vector<fl_AutoNumPtr> m_utvTitles;
00088     bool m_bMustAddTitle;
00089     bool m_bRequiredBlock;
00090     bool m_bTitleAdded;
00091     bool m_bMustNumber;
00092     bool m_bWroteBold;
00093     bool m_bWroteEntryPara;
00094     bool m_bInFrame;
00095     bool m_bInIndex;
00096     bool m_bInMath;
00097     bool m_bInMeta;
00098     bool m_bInNote;
00099     bool m_bInTable;
00100     bool m_bInTOC;
00101     bool m_bReadBook;
00102     UT_NumberStack m_utnsTagStack;
00103     UT_UTF8String m_sectionRole;
00104     ie_Table * m_TableHelperStack;
00105 
00106     void createList (void);
00107     void createTitle (void);
00108     void createImage (const char *name, const gchar **atts);
00109     void requireBlock(void);
00110     const gchar ** getCondition (const gchar **atts);
00111     UT_uint32 tagTop(void);
00112 };
00113 
00114 #endif /* IE_IMP_DocBook_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1