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
47 namespace ScoopParserInternal
48{
49 struct FrameZone;
50 struct Paragraph;
51 struct Shape;
52 struct TextZone;
53
54 struct State;
55
56 class SubDocument;
57}
58
62 class ScoopParser final : public MWAWGraphicParser
63{
64 friend class ScoopParserInternal::SubDocument;
65 public:
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);
108 bool readShape(ScoopParserInternal::Shape &shape, int id);
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:294
ScoopParser::readShapesList
bool readShapesList(std::vector< ScoopParserInternal::Shape > &shapes)
try to read a list of shape
Definition ScoopParser.cxx:1523
ScoopParser::readPrintInfo
bool readPrintInfo()
try to read the print info zone
Definition ScoopParser.cxx:2070
ScoopParser::readFont
bool readFont(MWAWFont &font)
try to read a font style
Definition ScoopParser.cxx:1249
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:1956
ScoopParser::readTextZoneParagraph
bool readTextZoneParagraph(ScoopParserInternal::Paragraph &para, int id)
try to read a frame paragraph
Definition ScoopParser.cxx:1060
ScoopParser::readShape
bool readShape(ScoopParserInternal::Shape &shape, int id)
try to read a shape
Definition ScoopParser.cxx:1560
ScoopParser::readBitmap
bool readBitmap(MWAWEntry const &entry, MWAWEmbeddedObject &object, bool compressed=true)
try to read a bitmap
Definition ScoopParser.cxx:1839
ScoopParser::createDocument
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition ScoopParser.cxx:425
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:842
ScoopParser::send
bool send(ScoopParserInternal::Shape const &shape, MWAWVec2i const &decal)
try to send a shape
Definition ScoopParser.cxx:501
ScoopParser::readText
bool readText(MWAWEntry &entry, std::string const &what)
try to read a text zone
Definition ScoopParser.cxx:1495
ScoopParser::ScoopParser
ScoopParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition ScoopParser.cxx:351
ScoopParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition ScoopParser.cxx:1920
ScoopParser::readParagraph
bool readParagraph(MWAWParagraph &para, bool define=false)
try to read a paragraph style
Definition ScoopParser.cxx:1294
ScoopParser::~ScoopParser
~ScoopParser() final
destructor
Definition ScoopParser.cxx:360
ScoopParser::createZones
bool createZones()
finds the different objects zones
Definition ScoopParser.cxx:467
ScoopParser::sendText
bool sendText(long tZoneId, int subZone)
try to send the text of a text zone
Definition ScoopParser.cxx:747
ScoopParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition ScoopParser.cxx:367
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:137
ScoopParserInternal::Shape
Internal: the shape of a ScoopParser.
Definition ScoopParser.cxx:60
ScoopParserInternal::State
Internal: the state of a ScoopParser.
Definition ScoopParser.cxx:216
ScoopParserInternal::TextZone
Internal: a text zone of a ScoopParser.
Definition ScoopParser.cxx:191