Debian Codegraph @

src/lib/QXPTextParser.h

raw
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libqxp project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef QXPTEXTPARSER_H_INCLUDED
11 #define QXPTEXTPARSER_H_INCLUDED
12
13 #include <memory>
14 #include <vector>
15
16 #include "libqxp_utils.h"
17 #include "QXPBlockParser.h"
18
19 namespace libqxp
20 {
21
22 class QXPHeader;
23
24 struct CharFormat;
25 struct ParagraphFormat;
26 struct Text;
27
28 class QXPTextParser
29 {
30 // disable copying
31 QXPTextParser(const QXPTextParser &other) = delete;
32 QXPTextParser &operator=(const QXPTextParser &other) = delete;
33
34 public:
35 QXPTextParser(const std::shared_ptr<librevenge::RVNGInputStream> &input, const std::shared_ptr<QXPHeader> &header);
36
37 std::shared_ptr<Text> parseText(unsigned index,
38 const std::vector<std::shared_ptr<CharFormat>> &charFormats,
39 const std::vector<std::shared_ptr<ParagraphFormat>> &paragraphFormats);
40
41 private:
42 const std::shared_ptr<QXPHeader> m_header;
43 const bool be; // big endian
44 const char *m_encoding;
45 QXPBlockParser m_blockParser;
46 };
47
48 }
49
50 #endif // QXPTEXTPARSER_H_INCLUDED
51
52 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */