ReadySetGoParser.hxx Source File documentation

ReadySetGoParser.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 READYSETGO_PARSER
35# define READYSETGO_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 ReadySetGoParserInternal
48{
49struct Layout;
50struct Shape;
51struct State;
52
53class SubDocument;
54}
55
56struct MWAWTabStop;
57
61 class ReadySetGoParser final : public MWAWGraphicParser
62{
63 friend class ReadySetGoParserInternal::SubDocument;
64public:
66 ReadySetGoParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
68 ~ReadySetGoParser() final;
69
71 bool checkHeader(MWAWHeader *header, bool strict=false) final;
72
73 // the main parse function
74 void parse(librevenge::RVNGDrawingInterface *documentInterface) final;
75
76protected:
78 void createDocument(librevenge::RVNGDrawingInterface *documentInterface);
80 bool send(ReadySetGoParserInternal::Shape const &shape);
82 bool sendText(ReadySetGoParserInternal::Shape const &shape);
83
85 bool updateTextBoxLinks();
86
87protected:
89 bool createZones();
91 bool readDocument();
93 bool readLayoutsList();
95 bool readIdsList();
97 bool readStyles();
99 bool readGlossary();
101 bool readFontsBlock();
102
104 bool readShapeV1();
106 bool readShapeV2(ReadySetGoParserInternal::Layout &layout);
108 bool readShapeV3(ReadySetGoParserInternal::Layout &layout, bool &last);
110 bool readStyle(MWAWFont &font, MWAWParagraph &para, int *cPos=nullptr);
112 bool readTabulationsV1(std::vector<MWAWTabStop> &tabulations, std::string &extra);
114 bool readTabulations(std::vector<MWAWTabStop> &tabs, long len=-1, int *cPos=nullptr);
115
116 // Intermediate level
117
119 bool readPrintInfo();
120
121 //
122 // low level
123 //
124
125 //
126 // data
127 //
129 std::shared_ptr<ReadySetGoParserInternal::State> m_state;
130};
131#endif
132// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
MWAWGraphicParser
virtual class which defines the ancestor of all graphic zone parser
Definition: MWAWParser.hxx:251
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
ReadySetGoParserInternal::SubDocument
Internal: the subdocument of a ReadySetGoParser.
Definition: ReadySetGoParser.cxx:358
ReadySetGoParser
the main class to read a ReadySetGo 1.0,2.1,3.0,4.0,4.5 file
Definition: ReadySetGoParser.hxx:62
ReadySetGoParser::updateTextBoxLinks
bool updateTextBoxLinks()
try to update the textboxes link: v3
Definition: ReadySetGoParser.cxx:2906
ReadySetGoParser::readPrintInfo
bool readPrintInfo()
try to read the print info zone
Definition: ReadySetGoParser.cxx:2844
ReadySetGoParser::send
bool send(ReadySetGoParserInternal::Shape const &shape)
try to send a shape
Definition: ReadySetGoParser.cxx:3020
ReadySetGoParser::readShapeV1
bool readShapeV1()
try to read a shape: v1
Definition: ReadySetGoParser.cxx:1346
ReadySetGoParser::readFontsBlock
bool readFontsBlock()
try to read the list of font block: unsure, name + data?, v5
Definition: ReadySetGoParser.cxx:2157
ReadySetGoParser::readDocument
bool readDocument()
try to read the document header: v3
Definition: ReadySetGoParser.cxx:1043
ReadySetGoParser::createZones
bool createZones()
finds the different objects zones
Definition: ReadySetGoParser.cxx:524
ReadySetGoParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition: ReadySetGoParser.cxx:426
ReadySetGoParser::readStyles
bool readStyles()
try to read the list of style block: v4
Definition: ReadySetGoParser.cxx:2422
ReadySetGoParser::createDocument
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: ReadySetGoParser.cxx:466
ReadySetGoParser::m_state
std::shared_ptr< ReadySetGoParserInternal::State > m_state
the state
Definition: ReadySetGoParser.hxx:129
ReadySetGoParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: ReadySetGoParser.cxx:833
ReadySetGoParser::readGlossary
bool readGlossary()
try to read the glossary list: v4
Definition: ReadySetGoParser.cxx:2246
ReadySetGoParser::readLayoutsList
bool readLayoutsList()
try to read the layout list: v3
Definition: ReadySetGoParser.cxx:1274
ReadySetGoParser::readTabulations
bool readTabulations(std::vector< MWAWTabStop > &tabs, long len=-1, int *cPos=nullptr)
try to read a list of tabulations: v3
Definition: ReadySetGoParser.cxx:2735
ReadySetGoParser::readIdsList
bool readIdsList()
try to read an unknown list of IDs: v3
Definition: ReadySetGoParser.cxx:1220
ReadySetGoParser::readShapeV3
bool readShapeV3(ReadySetGoParserInternal::Layout &layout, bool &last)
try to read a shape: v3
Definition: ReadySetGoParser.cxx:1734
ReadySetGoParser::readStyle
bool readStyle(MWAWFont &font, MWAWParagraph &para, int *cPos=nullptr)
try to read a style: v3
Definition: ReadySetGoParser.cxx:2518
ReadySetGoParser::sendText
bool sendText(ReadySetGoParserInternal::Shape const &shape)
try to send the text corresponding to a shape
Definition: ReadySetGoParser.cxx:3100
ReadySetGoParser::readShapeV2
bool readShapeV2(ReadySetGoParserInternal::Layout &layout)
try to read a shape: v2
Definition: ReadySetGoParser.cxx:1486
ReadySetGoParser::~ReadySetGoParser
~ReadySetGoParser() final
destructor
Definition: ReadySetGoParser.cxx:419
ReadySetGoParser::readTabulationsV1
bool readTabulationsV1(std::vector< MWAWTabStop > &tabulations, std::string &extra)
try to read a list of tabulations: v1-2
Definition: ReadySetGoParser.cxx:2661
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
ReadySetGoParserInternal
Internal: the structures of a ReadySetGoParser.
Definition: ReadySetGoParser.cxx:61
librevenge
Definition: MWAWDocument.hxx:57
MWAWTabStop
class to store a tab use by MWAWParagraph
Definition: MWAWParagraph.hxx:46