ScoopParser.hxx Source File documentation

ScoopParser.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3/* libmwaw
4* Version: MPL 2.0 / LGPLv2+
5*
6* The contents of this file are subject to the Mozilla Public License Version
7* 2.0 (the "License"); you may not use this file except in compliance with
8* the License or as specified alternatively below. You may obtain a copy of
9* the License at http://www.mozilla.org/MPL/
10*
11* Software distributed under the License is distributed on an "AS IS" basis,
12* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13* for the specific language governing rights and limitations under the
14* License.
15*
16* Major Contributor(s):
17* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20* Copyright (C) 2006, 2007 Andrew Ziem
21* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22*
23*
24* All Rights Reserved.
25*
26* For minor contributions see the git repository.
27*
28* Alternatively, the contents of this file may be used under the terms of
29* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30* in which case the provisions of the LGPLv2+ are applicable
31* instead of those above.
32*/
33
34#ifndef SCOOP_PARSER
35# define SCOOP_PARSER
36
37#include <string>
38#include <vector>
39
40#include <librevenge/librevenge.h>
41
42#include "MWAWDebug.hxx"
43#include "MWAWInputStream.hxx"
44
45#include "MWAWParser.hxx"
46
47namespace ScoopParserInternal
48{
49struct FrameZone;
50struct Paragraph;
51struct Shape;
52struct TextZone;
53
54struct State;
55
56class SubDocument;
57}
58
62 class ScoopParser final : public MWAWGraphicParser
63{
64 friend class ScoopParserInternal::SubDocument;
65public:
67 ScoopParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
69 ~ScoopParser() final;
70
72 bool checkHeader(MWAWHeader *header, bool strict=false) final;
73
74 // the main parse function
75 void parse(librevenge::RVNGDrawingInterface *documentInterface) final;
76
77protected:
79 void createDocument(librevenge::RVNGDrawingInterface *documentInterface);
80
81protected:
83 bool createZones();
84
85 // Intermediate level
86
88 bool readPrintInfo();
90 bool readHeader();
91
94 bool readTextZone(ScoopParserInternal::TextZone &tZone);
96 bool readTextZoneParagraph(ScoopParserInternal::Paragraph &para, int id);
97
99 bool readFont(MWAWFont &font);
101 bool readParagraph(MWAWParagraph &para, bool define=false);
103 bool readText(MWAWEntry &entry, std::string const &what);
104
106 bool readShapesList(std::vector<ScoopParserInternal::Shape> &shapes, int depth=0);
108 bool readShape(ScoopParserInternal::Shape &shape, int id, int depth=0);
110 bool readBitmap(MWAWEntry const &entry, MWAWEmbeddedObject &object, bool compressed=true);
111
112 //
113 // low level
114 //
115
116 //
117 // data
118 //
119
121 bool send(ScoopParserInternal::Shape const &shape, MWAWVec2i const &decal);
123 bool sendText(long tZoneId, int subZone);
125 bool sendText(ScoopParserInternal::Paragraph const &paragraph);
126
128 std::shared_ptr<ScoopParserInternal::State> m_state;
129};
130#endif
131// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWFont
Class to store font.
Definition MWAWFont.hxx:44
MWAWGraphicParser::MWAWGraphicParser
MWAWGraphicParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:259
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition MWAWHeader.hxx:57
MWAWParagraph
class to store the paragraph properties
Definition MWAWParagraph.hxx:85
ScoopParserInternal::SubDocument
Internal: the subdocument of a ScoopParser.
Definition ScoopParser.cxx:296
ScoopParser::readPrintInfo
bool readPrintInfo()
try to read the print info zone
Definition ScoopParser.cxx:2076
ScoopParser::readFont
bool readFont(MWAWFont &font)
try to read a font style
Definition ScoopParser.cxx:1251
ScoopParser::m_state
std::shared_ptr< ScoopParserInternal::State > m_state
the state
Definition ScoopParser.hxx:128
ScoopParser::readHeader
bool readHeader()
try to the header zone
Definition ScoopParser.cxx:1962
ScoopParser::readTextZoneParagraph
bool readTextZoneParagraph(ScoopParserInternal::Paragraph &para, int id)
try to read a frame paragraph
Definition ScoopParser.cxx:1062
ScoopParser::readBitmap
bool readBitmap(MWAWEntry const &entry, MWAWEmbeddedObject &object, bool compressed=true)
try to read a bitmap
Definition ScoopParser.cxx:1845
ScoopParser::readShape
bool readShape(ScoopParserInternal::Shape &shape, int id, int depth=0)
try to read a shape
Definition ScoopParser.cxx:1566
ScoopParser::readShapesList
bool readShapesList(std::vector< ScoopParserInternal::Shape > &shapes, int depth=0)
try to read a list of shape
Definition ScoopParser.cxx:1525
ScoopParser::createDocument
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition ScoopParser.cxx:427
ScoopParser::readTextZone
bool readTextZone(ScoopParserInternal::TextZone &tZone)
try to read the data associated to a text zone: its name, its content, the list of shape which displa...
Definition ScoopParser.cxx:844
ScoopParser::send
bool send(ScoopParserInternal::Shape const &shape, MWAWVec2i const &decal)
try to send a shape
Definition ScoopParser.cxx:503
ScoopParser::readText
bool readText(MWAWEntry &entry, std::string const &what)
try to read a text zone
Definition ScoopParser.cxx:1497
ScoopParser::ScoopParser
ScoopParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition ScoopParser.cxx:353
ScoopParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition ScoopParser.cxx:1926
ScoopParser::readParagraph
bool readParagraph(MWAWParagraph &para, bool define=false)
try to read a paragraph style
Definition ScoopParser.cxx:1296
ScoopParser::~ScoopParser
~ScoopParser() final
destructor
Definition ScoopParser.cxx:362
ScoopParser::createZones
bool createZones()
finds the different objects zones
Definition ScoopParser.cxx:469
ScoopParser::sendText
bool sendText(long tZoneId, int subZone)
try to send the text of a text zone
Definition ScoopParser.cxx:749
ScoopParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition ScoopParser.cxx:369
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition libmwaw_internal.hxx:838
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition libmwaw_internal.hxx:561
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
ScoopParserInternal
Internal: the structures of a ScoopParser.
Definition ScoopParser.cxx:57
librevenge
Definition MWAWDocument.hxx:57
MWAWEmbeddedObject
small class use to define a embedded object
Definition libmwaw_internal.hxx:467
ScoopParserInternal::Paragraph
Internal: a paragraph of a ScoopParser.
Definition ScoopParser.cxx:139
ScoopParserInternal::Shape
Internal: the shape of a ScoopParser.
Definition ScoopParser.cxx:62
ScoopParserInternal::State
Internal: the state of a ScoopParser.
Definition ScoopParser.cxx:218
ScoopParserInternal::TextZone
Internal: a text zone of a ScoopParser.
Definition ScoopParser.cxx:193