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
17 namespace 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);
62 public:
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: */
libmspub::readU32
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libmspub_utils.cpp:292
libmspub::MSPUBParser97::getTextIdOffset
unsigned getTextIdOffset() const override
Definition: MSPUBParser97.cpp:35
libmspub::MSPUBParser::m_collector
MSPUBCollector * m_collector
Definition: MSPUBParser.h:150
libmspub::MSPUBParser97::TextInfo97::m_chars
std::vector< unsigned char > m_chars
Definition: MSPUBParser97.h:23
libmspub::TextParagraph
Definition: MSPUBTypes.h:193
libmspub::MSPUBParser97
Definition: MSPUBParser97.h:20
MSPUB_DEBUG_MSG
#define MSPUB_DEBUG_MSG(M)
Definition: libmspub_utils.h:55
libmspub::stillReading
bool stillReading(librevenge::RVNGInputStream *input, unsigned long until)
Definition: libmspub_utils.cpp:416
libmspub::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libmspub_utils.cpp:266
libmspub::MSPUBParser97::parse
bool parse() override
Definition: MSPUBParser97.cpp:40
libmspub
Definition: Arrow.h:14
libmspub::MSPUBParser97::getTextMarker
unsigned short getTextMarker() const override
Definition: MSPUBParser97.cpp:30
libmspub::MSPUBParser97::SpanInfo97::m_style
CharacterStyle m_style
Definition: MSPUBParser97.h:38
libmspub::MSPUBParser97::getSpansInfo
std::vector< SpanInfo97 > getSpansInfo(librevenge::RVNGInputStream *input, unsigned prop1Index, unsigned prop2Index, unsigned prop3Index, unsigned prop3End)
Definition: MSPUBParser97.cpp:151
libmspub::CharacterStyle::bold
bool bold
Definition: MSPUBTypes.h:129
libmspub::CharacterStyle::textSizeInPt
boost::optional< double > textSizeInPt
Definition: MSPUBTypes.h:130
libmspub::MSPUBParser97::getTextInfo
TextInfo97 getTextInfo(librevenge::RVNGInputStream *input, unsigned length)
Definition: MSPUBParser97.cpp:240
libmspub::TextSpan
Definition: MSPUBTypes.h:186
libmspub::readU16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libmspub_utils.cpp:285
libmspub::MSPUBCollector
Definition: MSPUBCollector.h:45
MSPUBParser2k.h
libmspub_utils.h
MSPUBTypes.h
MSPUBParser97.h
libmspub::MSPUBParser97::MSPUBParser97
MSPUBParser97(librevenge::RVNGInputStream *input, MSPUBCollector *collector)
Definition: MSPUBParser97.cpp:24
libmspub::MSPUBParser::m_input
librevenge::RVNGInputStream * m_input
Definition: MSPUBParser.h:148
libmspub::MSPUBParser97::readCharacterStyle
CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input, unsigned length)
Definition: MSPUBParser97.cpp:198
MSPUBCollector.h
libmspub::MSPUBCollector::useEncodingHeuristic
void useEncodingHeuristic()
Definition: MSPUBCollector.cpp:510
libmspub::MSPUBParser97::getShapeFillTypeOffset
unsigned getShapeFillTypeOffset() const override
Definition: MSPUBParser97.cpp:284
libmspub::CharacterStyle::colorIndex
int colorIndex
Definition: MSPUBTypes.h:131
libmspub::MSPUBCollector::addTextString
bool addTextString(const std::vector< TextParagraph > &str, unsigned id)
Definition: MSPUBCollector.cpp:1876
libmspub::readS8
int8_t readS8(librevenge::RVNGInputStream *input)
Definition: libmspub_utils.cpp:301
libmspub::CharacterStyle::underline
boost::optional< Underline > underline
Definition: MSPUBTypes.h:127
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::ParagraphStyle
Definition: MSPUBTypes.h:164
libmspub::MSPUBParser97::TextInfo97::m_paragraphEnds
std::vector< unsigned > m_paragraphEnds
Definition: MSPUBParser97.h:24
libmspub::MSPUBCollector::go
bool go()
Definition: MSPUBCollector.cpp:1832
libmspub::MSPUBParser97::TextInfo97::m_shapeEnds
std::vector< unsigned > m_shapeEnds
Definition: MSPUBParser97.h:25
libmspub::MSPUBParser97::translateCoordinateIfNecessary
int translateCoordinateIfNecessary(int coordinate) const override
Definition: MSPUBParser97.cpp:265
libmspub::MSPUBParser2k
Definition: MSPUBParser2k.h:24
libmspub::MSPUBParser97::parseContentsTextIfNecessary
void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input) override
Definition: MSPUBParser97.cpp:72
libmspub::MSPUBParser2k::getColorIndexByQuillEntry
unsigned getColorIndexByQuillEntry(unsigned entry) override
Definition: MSPUBParser2k.cpp:60
libmspub::MSPUBParser::m_documentChunkIndex
boost::optional< unsigned > m_documentChunkIndex
Definition: MSPUBParser.h:160
libmspub::Underline::Single
@ Single
libmspub::CharacterStyle::fontIndex
boost::optional< unsigned > fontIndex
Definition: MSPUBTypes.h:132
libmspub::MSPUBParser97::getShapeFillColorOffset
unsigned getShapeFillColorOffset() const override
Definition: MSPUBParser97.cpp:289
libmspub::MSPUBParser97::getFirstLineOffset
unsigned getFirstLineOffset() const override
Definition: MSPUBParser97.cpp:274
libmspub::MSPUBParser97::TextInfo97
Definition: MSPUBParser97.h:22
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::CharacterStyle
Definition: MSPUBTypes.h:113
libmspub::CharacterStyle::italic
bool italic
Definition: MSPUBTypes.h:128
libmspub::MSPUBParser::m_length
unsigned m_length
Definition: MSPUBParser.h:149
libmspub::MSPUBParser97::getSecondLineOffset
unsigned getSecondLineOffset() const override
Definition: MSPUBParser97.cpp:279
libmspub::MSPUBParser2k::parseContents
bool parseContents(librevenge::RVNGInputStream *input) override
Definition: MSPUBParser2k.cpp:347
libmspub::MSPUBParser97::SpanInfo97
Definition: MSPUBParser97.h:36
libmspub::MSPUBParser97::parseDocument
bool parseDocument(librevenge::RVNGInputStream *input) override
Definition: MSPUBParser97.cpp:56
libmspub::MSPUBCollector::setWidthInEmu
void setWidthInEmu(unsigned long)
Definition: MSPUBCollector.cpp:1900
libmspub::MSPUBCollector::setHeightInEmu
void setHeightInEmu(unsigned long)
Definition: MSPUBCollector.cpp:1907
libmspub::MSPUBParser::m_contentChunks
std::vector< ContentChunkReference > m_contentChunks
Definition: MSPUBParser.h:152
libmspub::readS16
int16_t readS16(librevenge::RVNGInputStream *input)
Definition: libmspub_utils.cpp:306
libmspub::MSPUBParser97::m_isBanner
bool m_isBanner
Definition: MSPUBParser97.h:45
EMUS_IN_INCH
#define EMUS_IN_INCH
Definition: MSPUBConstants.h:13