FB2ContentCollector.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libe-book project.
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 
00010 #ifndef FB2CONTENTCOLLECTOR_H_INCLUDED
00011 #define FB2CONTENTCOLLECTOR_H_INCLUDED
00012 
00013 #include "FB2Collector.h"
00014 
00015 
00016 namespace libebook
00017 {
00018 
00019 class FB2ContentMap;
00020 
00021 class FB2ContentCollector : public FB2Collector
00022 {
00023   // no copying
00024   FB2ContentCollector(const FB2ContentCollector &other);
00025   FB2ContentCollector &operator=(const FB2ContentCollector &other);
00026 
00027 public:
00028   FB2ContentCollector(librevenge::RVNGTextInterface *m_document, const librevenge::RVNGPropertyList &metadata, const FB2ContentMap &notes, const FB2ContentMap &bitmaps);
00029 
00030 private:
00031   virtual void defineMetadataEntry(const char *name, const char *value);
00032   virtual void openMetadataEntry(const char *name);
00033   virtual void closeMetadataEntry();
00034 
00035   virtual void defineID(const char *id);
00036 
00037   virtual void openPageSpan();
00038   virtual void closePageSpan();
00039 
00040   virtual void openBlock();
00041   virtual void closeBlock();
00042 
00043   virtual void openParagraph(const FB2BlockFormat &format);
00044   virtual void closeParagraph();
00045 
00046   virtual void openSpan(const FB2Style &style);
00047   virtual void closeSpan();
00048 
00049   virtual void insertText(const char *text);
00050 
00051   virtual void openTable(const FB2BlockFormat &format);
00052   virtual void closeTable();
00053 
00054   virtual void openTableRow(const FB2BlockFormat &format);
00055   virtual void closeTableRow();
00056 
00057   virtual void openTableCell(int rowspan, int colspan);
00058   virtual void closeTableCell();
00059   virtual void insertCoveredTableCell();
00060 
00061   virtual void insertFootnote(const char *id);
00062 
00063   virtual void insertBitmap(const char *id);
00064   virtual void insertBitmapData(const char *contentType, const char *base64Data);
00065 
00066 private:
00067   librevenge::RVNGTextInterface *m_document;
00068   const librevenge::RVNGPropertyList &m_metadata;
00069   const FB2ContentMap &m_notes;
00070   const FB2ContentMap &m_bitmaps;
00071   int m_currentFootnote;
00072   int m_openPara;
00073 };
00074 
00075 }
00076 
00077 #endif // FB2CONTENTCOLLECTOR_H_INCLUDED
00078 
00079 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */