00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* libe-book 00003 * Version: MPL 2.0 / LGPLv2.1+ 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 * 00009 * Alternatively, the contents of this file may be used under the terms 00010 * of the GNU Lesser General Public License Version 2.1 or later 00011 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are 00012 * applicable instead of those above. 00013 * 00014 * For further information visit http://libebook.sourceforge.net 00015 */ 00016 00017 #ifndef FB2CONTENTCOLLECTOR_H_INCLUDED 00018 #define FB2CONTENTCOLLECTOR_H_INCLUDED 00019 00020 #include "FB2Collector.h" 00021 00022 class WPXDocumentInterface; 00023 class WPXPropertyList; 00024 00025 namespace libebook 00026 { 00027 00028 class FB2ContentMap; 00029 00030 class FB2ContentCollector : public FB2Collector 00031 { 00032 // no copying 00033 FB2ContentCollector(const FB2ContentCollector &other); 00034 FB2ContentCollector &operator=(const FB2ContentCollector &other); 00035 00036 public: 00037 FB2ContentCollector(WPXDocumentInterface *m_document, const WPXPropertyList &metadata, const FB2ContentMap ¬es, const FB2ContentMap &bitmaps); 00038 00039 private: 00040 virtual void defineMetadataEntry(const char *name, const char *value); 00041 virtual void openMetadataEntry(const char *name); 00042 virtual void closeMetadataEntry(); 00043 00044 virtual void defineID(const char *id); 00045 00046 virtual void openPageSpan(); 00047 virtual void closePageSpan(); 00048 00049 virtual void openBlock(); 00050 virtual void closeBlock(); 00051 00052 virtual void openParagraph(const FB2BlockFormat &format); 00053 virtual void closeParagraph(); 00054 00055 virtual void openSpan(const FB2Style &style); 00056 virtual void closeSpan(); 00057 00058 virtual void insertText(const char *text); 00059 00060 virtual void openTable(const FB2BlockFormat &format); 00061 virtual void closeTable(); 00062 00063 virtual void openTableRow(const FB2BlockFormat &format); 00064 virtual void closeTableRow(); 00065 00066 virtual void openTableCell(int rowspan, int colspan); 00067 virtual void closeTableCell(); 00068 virtual void insertCoveredTableCell(); 00069 00070 virtual void insertFootnote(const char *id); 00071 00072 virtual void insertBitmap(const char *id); 00073 virtual void insertBitmapData(const char *contentType, const char *base64Data); 00074 00075 private: 00076 WPXDocumentInterface *m_document; 00077 const WPXPropertyList &m_metadata; 00078 const FB2ContentMap &m_notes; 00079 const FB2ContentMap &m_bitmaps; 00080 int m_currentFootnote; 00081 }; 00082 00083 } 00084 00085 #endif // FB2CONTENTCOLLECTOR_H_INCLUDED 00086 00087 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */