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 ZTXTPARSER_H_INCLUDED 00011 #define ZTXTPARSER_H_INCLUDED 00012 00013 #include "PDXParser.h" 00014 00015 00016 namespace libebook 00017 { 00018 00019 class ZTXTParser : public PDXParser 00020 { 00021 public: 00022 explicit ZTXTParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document = 0); 00023 00024 static bool checkType(unsigned type, unsigned creator); 00025 00026 virtual void readAppInfoRecord(librevenge::RVNGInputStream *record); 00027 virtual void readSortInfoRecord(librevenge::RVNGInputStream *record); 00028 virtual void readIndexRecord(librevenge::RVNGInputStream *record); 00029 virtual void readDataRecord(librevenge::RVNGInputStream *record, bool = true); 00030 00031 virtual void readDataRecords(); 00032 00033 private: 00034 void openDocument(); 00035 void closeDocument(); 00036 void handleText(const librevenge::RVNGString &text); 00037 00038 private: 00039 unsigned m_recordCount; 00040 unsigned m_size; 00041 unsigned m_recordSize; 00042 }; 00043 00044 } // namespace libebook 00045 00046 #endif // ZTXTPARSER_H_INCLUDED 00047 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */