QXPTextParser.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 libqxp 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 QXPTEXTPARSER_H_INCLUDED
00011 #define QXPTEXTPARSER_H_INCLUDED
00012 
00013 #include <memory>
00014 #include <vector>
00015 
00016 #include "libqxp_utils.h"
00017 #include "QXPBlockParser.h"
00018 
00019 namespace libqxp
00020 {
00021 
00022 class QXPHeader;
00023 
00024 struct CharFormat;
00025 struct ParagraphFormat;
00026 struct Text;
00027 
00028 class QXPTextParser
00029 {
00030   // disable copying
00031   QXPTextParser(const QXPTextParser &other) = delete;
00032   QXPTextParser &operator=(const QXPTextParser &other) = delete;
00033 
00034 public:
00035   QXPTextParser(const std::shared_ptr<librevenge::RVNGInputStream> &input, const std::shared_ptr<QXPHeader> &header);
00036 
00037   std::shared_ptr<Text> parseText(unsigned index,
00038                                   const std::vector<std::shared_ptr<CharFormat>> &charFormats,
00039                                   const std::vector<std::shared_ptr<ParagraphFormat>> &paragraphFormats);
00040 
00041 private:
00042   const std::shared_ptr<QXPHeader> m_header;
00043   const bool be; // big endian
00044   const char *m_encoding;
00045   QXPBlockParser m_blockParser;
00046 };
00047 
00048 }
00049 
00050 #endif // QXPTEXTPARSER_H_INCLUDED
00051 
00052 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */