MSPUBParser97.h Source File documentation

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 <vector>
14
15#include "MSPUBParser2k.h"
16
17namespace libmspub
18{
19 class MSPUBParser97 : public MSPUBParser2k
20{
21 struct TextInfo97
22 {
23 std::vector<unsigned char> m_chars;
24 std::vector<unsigned> m_paragraphEnds;
25 std::vector<unsigned> m_shapeEnds;
26 TextInfo97(const std::vector<unsigned char> &chars,
27 const std::vector<unsigned> &paragraphEnds,
28 const std::vector<unsigned> &shapeEnds)
29 : m_chars(chars), m_paragraphEnds(paragraphEnds),
30 m_shapeEnds(shapeEnds)
31 {
32 }
33 };
34
35 struct SpanInfo97
36 {
37 unsigned m_spanEnd;
38 CharacterStyle m_style;
39 SpanInfo97(unsigned spanEnd, const CharacterStyle &style)
40 : m_spanEnd(spanEnd), m_style(style)
41 {
42 }
43 };
44
45 bool m_isBanner;
46
47 bool parseDocument(librevenge::RVNGInputStream *input) override;
48 int translateCoordinateIfNecessary(int coordinate) const override;
49 unsigned getFirstLineOffset() const override;
50 unsigned getSecondLineOffset() const override;
51 unsigned getShapeFillTypeOffset() const override;
52 unsigned getShapeFillColorOffset() const override;
53 unsigned short getTextMarker() const override;
54 unsigned getTextIdOffset() const override;
55 CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input,
56 unsigned length);
57 void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input) override;
58 std::vector<SpanInfo97> getSpansInfo(librevenge::RVNGInputStream *input,
59 unsigned prop1Index, unsigned prop2Index, unsigned prop3Index,
60 unsigned prop3End);
61 TextInfo97 getTextInfo(librevenge::RVNGInputStream *input, unsigned length);
62public:
63 MSPUBParser97(librevenge::RVNGInputStream *input, MSPUBCollector *collector);
64 bool parse() override;
65};
66}
67
68#endif // INCLUDED_MSPUBPARSER97_H
69
70/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
MSPUBParser2k.h
libmspub::MSPUBCollector
Definition MSPUBCollector.h:45
libmspub::MSPUBParser2k
Definition MSPUBParser2k.h:24
libmspub::MSPUBParser97
Definition MSPUBParser97.h:20
libmspub::MSPUBParser97::getFirstLineOffset
unsigned getFirstLineOffset() const override
Definition MSPUBParser97.cpp:274
libmspub::MSPUBParser97::getTextMarker
unsigned short getTextMarker() const override
Definition MSPUBParser97.cpp:30
libmspub::MSPUBParser97::parseDocument
bool parseDocument(librevenge::RVNGInputStream *input) override
Definition MSPUBParser97.cpp:56
libmspub::MSPUBParser97::getShapeFillTypeOffset
unsigned getShapeFillTypeOffset() const override
Definition MSPUBParser97.cpp:284
libmspub::MSPUBParser97::parseContentsTextIfNecessary
void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input) override
Definition MSPUBParser97.cpp:72
libmspub::MSPUBParser97::m_isBanner
bool m_isBanner
Definition MSPUBParser97.h:45
libmspub::MSPUBParser97::getShapeFillColorOffset
unsigned getShapeFillColorOffset() const override
Definition MSPUBParser97.cpp:289
libmspub::MSPUBParser97::readCharacterStyle
CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input, unsigned length)
Definition MSPUBParser97.cpp:198
libmspub::MSPUBParser97::getSecondLineOffset
unsigned getSecondLineOffset() const override
Definition MSPUBParser97.cpp:279
libmspub::MSPUBParser97::parse
bool parse() override
Definition MSPUBParser97.cpp:40
libmspub::MSPUBParser97::getTextIdOffset
unsigned getTextIdOffset() const override
Definition MSPUBParser97.cpp:35
libmspub::MSPUBParser97::translateCoordinateIfNecessary
int translateCoordinateIfNecessary(int coordinate) const override
Definition MSPUBParser97.cpp:265
libmspub::MSPUBParser97::getSpansInfo
std::vector< SpanInfo97 > getSpansInfo(librevenge::RVNGInputStream *input, unsigned prop1Index, unsigned prop2Index, unsigned prop3Index, unsigned prop3End)
Definition MSPUBParser97.cpp:151
libmspub::MSPUBParser97::getTextInfo
TextInfo97 getTextInfo(librevenge::RVNGInputStream *input, unsigned length)
Definition MSPUBParser97.cpp:240
libmspub
Definition Arrow.h:14
libmspub::CharacterStyle
Definition MSPUBTypes.h:113
libmspub::MSPUBParser97::SpanInfo97
Definition MSPUBParser97.h:36
libmspub::MSPUBParser97::SpanInfo97::m_spanEnd
unsigned m_spanEnd
Definition MSPUBParser97.h:37
libmspub::MSPUBParser97::SpanInfo97::SpanInfo97
SpanInfo97(unsigned spanEnd, const CharacterStyle &style)
Definition MSPUBParser97.h:39
libmspub::MSPUBParser97::SpanInfo97::m_style
CharacterStyle m_style
Definition MSPUBParser97.h:38
libmspub::MSPUBParser97::TextInfo97
Definition MSPUBParser97.h:22
libmspub::MSPUBParser97::TextInfo97::m_paragraphEnds
std::vector< unsigned > m_paragraphEnds
Definition MSPUBParser97.h:24
libmspub::MSPUBParser97::TextInfo97::m_chars
std::vector< unsigned char > m_chars
Definition MSPUBParser97.h:23
libmspub::MSPUBParser97::TextInfo97::TextInfo97
TextInfo97(const std::vector< unsigned char > &chars, const std::vector< unsigned > &paragraphEnds, const std::vector< unsigned > &shapeEnds)
Definition MSPUBParser97.h:26
libmspub::MSPUBParser97::TextInfo97::m_shapeEnds
std::vector< unsigned > m_shapeEnds
Definition MSPUBParser97.h:25