MSPUBParser97.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 __MSPUBPARSER97_H__
11 #define __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);
46 int translateCoordinateIfNecessary(int coordinate) const;
47 unsigned getFirstLineOffset() const;
48 unsigned getSecondLineOffset() const;
49 unsigned getShapeFillTypeOffset() const;
50 unsigned getShapeFillColorOffset() const;
51 unsigned short getTextMarker() const;
52 unsigned getTextIdOffset() const;
53 CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input,
54 unsigned length);
55 void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input);
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();
63 };
64 }
65
66 #endif // __MSPUBPARSER97_H__
67
68 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libmspub::MSPUBParser97::MSPUBParser97
MSPUBParser97(librevenge::RVNGInputStream *input, MSPUBCollector *collector)
Definition: MSPUBParser97.cpp:18
libmspub::MSPUBParser97::TextInfo97::m_chars
std::vector< unsigned char > m_chars
Definition: MSPUBParser97.h:21
libmspub::MSPUBParser97::readCharacterStyle
CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input, unsigned length)
Definition: MSPUBParser97.cpp:194
libmspub::MSPUBParser97::parseContentsTextIfNecessary
void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input)
Definition: MSPUBParser97.cpp:67
libmspub::MSPUBParser97::m_isBanner
bool m_isBanner
Definition: MSPUBParser97.h:43
libmspub::MSPUBParser2k
Definition: MSPUBParser2k.h:22
MSPUBParser2k.h
libmspub::MSPUBParser97::getShapeFillColorOffset
unsigned getShapeFillColorOffset() const
Definition: MSPUBParser97.cpp:287
libmspub::MSPUBParser97::getTextInfo
TextInfo97 getTextInfo(librevenge::RVNGInputStream *input, unsigned length)
Definition: MSPUBParser97.cpp:236
libmspub::MSPUBParser97::getTextIdOffset
unsigned getTextIdOffset() const
Definition: MSPUBParser97.cpp:29
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::getShapeFillTypeOffset
unsigned getShapeFillTypeOffset() const
Definition: MSPUBParser97.cpp:282
libmspub::MSPUBParser97
Definition: MSPUBParser97.h:17
libmspub::MSPUBParser97::translateCoordinateIfNecessary
int translateCoordinateIfNecessary(int coordinate) const
Definition: MSPUBParser97.cpp:260
libmspub::MSPUBParser97::getTextMarker
unsigned short getTextMarker() const
Definition: MSPUBParser97.cpp:24
libmspub::MSPUBParser97::TextInfo97::m_shapeEnds
std::vector< unsigned > m_shapeEnds
Definition: MSPUBParser97.h:23
libmspub::MSPUBParser97::TextInfo97
Definition: MSPUBParser97.h:19
libmspub
Definition: Arrow.h:13
libmspub::MSPUBParser97::SpanInfo97
Definition: MSPUBParser97.h:33
libmspub::CharacterStyle
Definition: MSPUBTypes.h:88
libmspub::MSPUBParser97::parse
bool parse()
Definition: MSPUBParser97.cpp:34
libmspub::MSPUBParser97::SpanInfo97::SpanInfo97
SpanInfo97(unsigned spanEnd, const CharacterStyle &style)
Definition: MSPUBParser97.h:37
libmspub::MSPUBParser97::getFirstLineOffset
unsigned getFirstLineOffset() const
Definition: MSPUBParser97.cpp:272
libmspub::MSPUBCollector
Definition: MSPUBCollector.h:46
libmspub::MSPUBParser97::TextInfo97::m_paragraphEnds
std::vector< unsigned > m_paragraphEnds
Definition: MSPUBParser97.h:22
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:146
libmspub::MSPUBParser97::parseDocument
bool parseDocument(librevenge::RVNGInputStream *input)
Definition: MSPUBParser97.cpp:51
libmspub::MSPUBParser97::getSecondLineOffset
unsigned getSecondLineOffset() const
Definition: MSPUBParser97.cpp:277