MSPUBParser97.h
Go to the documentation of this file.
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* This file is part of the libmspub project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_MSPUBPARSER97_H
#define INCLUDED_MSPUBPARSER97_H
#include <vector>
#include "MSPUBParser2k.h"
namespace libmspub
{
class MSPUBParser97 : public MSPUBParser2k
{
struct TextInfo97
{
std::vector<unsigned char> m_chars;
std::vector<unsigned> m_paragraphEnds;
std::vector<unsigned> m_shapeEnds;
TextInfo97(const std::vector<unsigned char> &chars,
const std::vector<unsigned> &paragraphEnds,
const std::vector<unsigned> &shapeEnds)
: m_chars(chars), m_paragraphEnds(paragraphEnds),
m_shapeEnds(shapeEnds)
{
}
};
struct SpanInfo97
{
unsigned m_spanEnd;
CharacterStyle m_style;
SpanInfo97(unsigned spanEnd, const CharacterStyle &style)
: m_spanEnd(spanEnd), m_style(style)
{
}
};
bool m_isBanner;
bool parseDocument(librevenge::RVNGInputStream *input) override;
int translateCoordinateIfNecessary(int coordinate) const override;
unsigned getFirstLineOffset() const override;
unsigned getSecondLineOffset() const override;
unsigned getShapeFillTypeOffset() const override;
unsigned getShapeFillColorOffset() const override;
unsigned short getTextMarker() const override;
unsigned getTextIdOffset() const override;
CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input,
unsigned length);
void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input) override;
std::vector<SpanInfo97> getSpansInfo(librevenge::RVNGInputStream *input,
unsigned prop1Index, unsigned prop2Index, unsigned prop3Index,
unsigned prop3End);
TextInfo97 getTextInfo(librevenge::RVNGInputStream *input, unsigned length);
public:
MSPUBParser97(librevenge::RVNGInputStream *input, MSPUBCollector *collector);
bool parse() override;
};
}
#endif // INCLUDED_MSPUBPARSER97_H
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
MSPUBParser2k.h
libmspub::MSPUBCollector
Definition MSPUBCollector.h:45
libmspub::MSPUBParser2k::MSPUBParser2k
MSPUBParser2k(librevenge::RVNGInputStream *input, MSPUBCollector *collector)
Definition MSPUBParser2k.cpp:54
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::MSPUBParser97
MSPUBParser97(librevenge::RVNGInputStream *input, MSPUBCollector *collector)
Definition MSPUBParser97.cpp:24
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::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