MSPUBParser97.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libmspub 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 INCLUDED_MSPUBPARSER97_H
11 #define INCLUDED_MSPUBPARSER97_H
12
13 #include "MSPUBParser2k.h"
14
15 namespace libmspub
16 {
17 class MSPUBParser97 : public MSPUBParser2k
18 {
19 struct TextInfo97
20 {
21 std::vector<unsigned char> m_chars;
22 std::vector<unsigned> m_paragraphEnds;
23 std::vector<unsigned> m_shapeEnds;
24 TextInfo97(const std::vector<unsigned char> &chars,
25 const std::vector<unsigned> &paragraphEnds,
26 const std::vector<unsigned> &shapeEnds)
27 : m_chars(chars), m_paragraphEnds(paragraphEnds),
28 m_shapeEnds(shapeEnds)
29 {
30 }
31 };
32
33 struct SpanInfo97
34 {
35 unsigned m_spanEnd;
36 CharacterStyle m_style;
37 SpanInfo97(unsigned spanEnd, const CharacterStyle &style)
38 : m_spanEnd(spanEnd), m_style(style)
39 {
40 }
41 };
42
43 bool m_isBanner;
44
45 bool parseDocument(librevenge::RVNGInputStream *input) override;
46 int translateCoordinateIfNecessary(int coordinate) const override;
47 unsigned getFirstLineOffset() const override;
48 unsigned getSecondLineOffset() const override;
49 unsigned getShapeFillTypeOffset() const override;
50 unsigned getShapeFillColorOffset() const override;
51 unsigned short getTextMarker() const override;
52 unsigned getTextIdOffset() const override;
53 CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input,
54 unsigned length);
55 void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input) override;
56 std::vector<SpanInfo97> getSpansInfo(librevenge::RVNGInputStream *input,
57 unsigned prop1Index, unsigned prop2Index, unsigned prop3Index,
58 unsigned prop3End);
59 TextInfo97 getTextInfo(librevenge::RVNGInputStream *input, unsigned length);
60 public:
61 MSPUBParser97(librevenge::RVNGInputStream *input, MSPUBCollector *collector);
62 bool parse() override;
63 };
64 }
65
66 #endif // INCLUDED_MSPUBPARSER97_H
67
68 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libmspub::MSPUBParser97::MSPUBParser97
MSPUBParser97(librevenge::RVNGInputStream *input, MSPUBCollector *collector)
Definition: MSPUBParser97.cpp:23
libmspub::MSPUBParser97::parse
bool parse() override
Definition: MSPUBParser97.cpp:39
libmspub::MSPUBParser97::TextInfo97::m_chars
std::vector< unsigned char > m_chars
Definition: MSPUBParser97.h:21
libmspub::MSPUBParser97::getShapeFillColorOffset
unsigned getShapeFillColorOffset() const override
Definition: MSPUBParser97.cpp:288
libmspub::MSPUBParser97::readCharacterStyle
CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input, unsigned length)
Definition: MSPUBParser97.cpp:197
libmspub::MSPUBParser97::parseDocument
bool parseDocument(librevenge::RVNGInputStream *input) override
Definition: MSPUBParser97.cpp:55
libmspub::MSPUBParser97::m_isBanner
bool m_isBanner
Definition: MSPUBParser97.h:43
libmspub::MSPUBParser2k
Definition: MSPUBParser2k.h:23
MSPUBParser2k.h
libmspub::MSPUBParser97::getShapeFillTypeOffset
unsigned getShapeFillTypeOffset() const override
Definition: MSPUBParser97.cpp:283
libmspub::MSPUBParser97::getTextInfo
TextInfo97 getTextInfo(librevenge::RVNGInputStream *input, unsigned length)
Definition: MSPUBParser97.cpp:239
libmspub::MSPUBParser97::TextInfo97::TextInfo97
TextInfo97(const std::vector< unsigned char > &chars, const std::vector< unsigned > &paragraphEnds, const std::vector< unsigned > &shapeEnds)
Definition: MSPUBParser97.h:24
libmspub::MSPUBParser97::getTextMarker
unsigned short getTextMarker() const override
Definition: MSPUBParser97.cpp:29
libmspub::MSPUBParser97::getFirstLineOffset
unsigned getFirstLineOffset() const override
Definition: MSPUBParser97.cpp:273
libmspub::MSPUBParser97
Definition: MSPUBParser97.h:17
libmspub::MSPUBParser97::TextInfo97::m_shapeEnds
std::vector< unsigned > m_shapeEnds
Definition: MSPUBParser97.h:23
libmspub::MSPUBParser97::getTextIdOffset
unsigned getTextIdOffset() const override
Definition: MSPUBParser97.cpp:34
libmspub::MSPUBParser97::TextInfo97
Definition: MSPUBParser97.h:19
libmspub
Definition: Arrow.h:13
libmspub::MSPUBParser97::SpanInfo97
Definition: MSPUBParser97.h:33
libmspub::CharacterStyle
Definition: MSPUBTypes.h:112
libmspub::MSPUBParser97::getSecondLineOffset
unsigned getSecondLineOffset() const override
Definition: MSPUBParser97.cpp:278
libmspub::MSPUBParser97::SpanInfo97::SpanInfo97
SpanInfo97(unsigned spanEnd, const CharacterStyle &style)
Definition: MSPUBParser97.h:37
libmspub::MSPUBCollector
Definition: MSPUBCollector.h:43
libmspub::MSPUBParser97::TextInfo97::m_paragraphEnds
std::vector< unsigned > m_paragraphEnds
Definition: MSPUBParser97.h:22
libmspub::MSPUBParser97::translateCoordinateIfNecessary
int translateCoordinateIfNecessary(int coordinate) const override
Definition: MSPUBParser97.cpp:264
libmspub::MSPUBParser97::parseContentsTextIfNecessary
void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input) override
Definition: MSPUBParser97.cpp:71
libmspub::MSPUBParser97::SpanInfo97::m_spanEnd
unsigned m_spanEnd
Definition: MSPUBParser97.h:35
libmspub::MSPUBParser97::SpanInfo97::m_style
CharacterStyle m_style
Definition: MSPUBParser97.h:36
libmspub::MSPUBParser97::getSpansInfo
std::vector< SpanInfo97 > getSpansInfo(librevenge::RVNGInputStream *input, unsigned prop1Index, unsigned prop2Index, unsigned prop3Index, unsigned prop3End)
Definition: MSPUBParser97.cpp:150