FullWrtParser.hxx Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

FullWrtParser.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 /*
35 * Parser to convert FullWrite document
36 *
37 */
38 #ifndef FULL_WRT_PARSER
39 # define FULL_WRT_PARSER
40
41 #include <list>
42 #include <string>
43 #include <vector>
44
45 #include <librevenge/librevenge.h>
46
47 #include "MWAWInputStream.hxx"
48
49 #include "FullWrtStruct.hxx"
50 #include "MWAWParser.hxx"
51
52 namespace FullWrtParserInternal
53 {
54 struct State;
55 class SubDocument;
56 }
57
58 class FullWrtGraph;
59 class FullWrtText;
60
66 class FullWrtParser : public MWAWTextParser
67 {
68 friend class FullWrtGraph;
69 friend class FullWrtText;
70 friend class FullWrtParserInternal::SubDocument;
71
72 public:
74 FullWrtParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
76 virtual ~FullWrtParser();
77
79 bool checkHeader(MWAWHeader *header, bool strict=false);
80
81 // the main parse function
82 void parse(librevenge::RVNGTextInterface *documentInterface);
83
84 protected:
86 void init();
87
89 void createDocument(librevenge::RVNGTextInterface *documentInterface);
90
92 bool createZones();
93
95 bool createFileZones();
96
98 void newPage(int number);
99
101 bool readDocPosition();
102
104 bool readFileZoneFlags(FullWrtStruct::EntryPtr zone);
105
107 bool readFileZonePos(FullWrtStruct::EntryPtr zone);
108
110 bool readDocZoneData(FullWrtStruct::EntryPtr zone);
111
113 bool readDocZoneStruct(FullWrtStruct::EntryPtr zone);
114
116 bool readDocInfo(FullWrtStruct::EntryPtr zone);
117
119 bool readEndDocInfo(FullWrtStruct::EntryPtr zone);
120
122 bool readCitationDocInfo(FullWrtStruct::EntryPtr zone);
123
125 bool readPrintInfo(FullWrtStruct::EntryPtr zone);
126
127 //
128 // interface to the graph parser
129 //
130
132 Vec2f getPageLeftTop() const;
134 bool getBorder(int bId, FullWrtStruct::Border &border) const;
135
136 //
137 // interface to the text parser
138 //
139
141 void sendText(int docId, libmwaw::SubDocumentType type, MWAWNote::Type which=MWAWNote::FootNote);
143 void sendGraphic(int docId);
145 void sendVariable(int docId);
147 void sendReference(int docId);
149 bool send(int fileId, MWAWColor fontColor=MWAWColor::black());
150
151 //
152 // interface ( mainly debugging function)
153 //
154
156 int getNumDocZoneStruct() const;
158 std::string getDocumentTypeName(int zId) const;
159
160 //
161 // low level
162 //
163
165 bool readReferenceData(FullWrtStruct::EntryPtr zone);
167 bool readGenericDocData(FullWrtStruct::EntryPtr zone, FullWrtStruct::ZoneHeader &doc);
168
169 protected:
170 //
171 // data
172 //
174 shared_ptr<FullWrtParserInternal::State> m_state;
175
177 shared_ptr<FullWrtGraph> m_graphParser;
179 shared_ptr<FullWrtText> m_textParser;
180 };
181 #endif
182 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
FullWrtStruct::ZoneHeader
a structure used to store the data of a zone header in a FullWrite file
Definition: FullWrtStruct.hxx:150
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
FullWrtParser::getPageLeftTop
Vec2f getPageLeftTop() const
returns the page left top point ( in inches)
Definition: FullWrtParser.cxx:322
FullWrtParser::getDocumentTypeName
std::string getDocumentTypeName(int zId) const
returns a the type of a document zone ( mainly used for debugging)
Definition: FullWrtParser.cxx:338
FullWrtParser::sendGraphic
void sendGraphic(int docId)
try to send a graphic
Definition: FullWrtParser.cxx:345
MWAWParser.hxx
FullWrtParser
the main class to read a FullWrite file
Definition: FullWrtParser.hxx:66
FullWrtParser::getNumDocZoneStruct
int getNumDocZoneStruct() const
returns the number of zone struct
Definition: FullWrtParser.cxx:333
FullWrtParser::sendReference
void sendReference(int docId)
try to send a reference, in pratice do nothing
Definition: FullWrtParser.cxx:1912
FullWrtParser::m_graphParser
shared_ptr< FullWrtGraph > m_graphParser
the graph parser
Definition: FullWrtParser.hxx:177
FullWrtStruct::EntryPtr
shared_ptr< Entry > EntryPtr
Definition: FullWrtStruct.hxx:147
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:211
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:163
FullWrtParser::newPage
void newPage(int number)
adds a new page
Definition: FullWrtParser.cxx:309
FullWrtParser::FullWrtParser
FullWrtParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: FullWrtParser.cxx:277
FullWrtParser::send
bool send(int fileId, MWAWColor fontColor=MWAWColor::black())
ask the text parser to send a zone
Definition: FullWrtParser.cxx:360
FullWrtParser::readDocZoneData
bool readDocZoneData(FullWrtStruct::EntryPtr zone)
try to read the zone containing the data of each doc zone (ie. Zone0)
Definition: FullWrtParser.cxx:1105
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:167
FullWrtParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: FullWrtParser.cxx:639
FullWrtParser::init
void init()
inits all internal variables
Definition: FullWrtParser.cxx:292
FullWrtParser::readFileZonePos
bool readFileZonePos(FullWrtStruct::EntryPtr zone)
try to read the file zones position
Definition: FullWrtParser.cxx:1703
MWAWNote::Type
Type
enum to define note type
Definition: libmwaw_internal.hxx:386
MWAWRSRCParserPtr
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:439
FullWrtParser::readDocPosition
bool readDocPosition()
find the last position of the document and read data
Definition: FullWrtParser.cxx:1839
FullWrtParser::sendText
void sendText(int docId, libmwaw::SubDocumentType type, MWAWNote::Type which=MWAWNote::FootNote)
try to send a footnote/endnote entry
Definition: FullWrtParser.cxx:1986
FullWrtParser::m_state
shared_ptr< FullWrtParserInternal::State > m_state
the state
Definition: FullWrtParser.hxx:174
MWAWTextParser
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:284
FullWrtParser::createFileZones
bool createFileZones()
create the file zone ( first step of create zones)
Definition: FullWrtParser.cxx:516
FullWrtParser::~FullWrtParser
virtual ~FullWrtParser()
destructor
Definition: FullWrtParser.cxx:283
FullWrtParser::readDocInfo
bool readDocInfo(FullWrtStruct::EntryPtr zone)
try to read zone2, a zone which stores the document information zone, ...
Definition: FullWrtParser.cxx:665
FullWrtParser::sendVariable
void sendVariable(int docId)
try to send a variable, in pratice do nothing
Definition: FullWrtParser.cxx:1942
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:429
FullWrtParserInternal::SubDocument
Internal: the subdocument of a FullWrtParser.
Definition: FullWrtParser.cxx:227
FullWrtParser::readFileZoneFlags
bool readFileZoneFlags(FullWrtStruct::EntryPtr zone)
try to read the file zones main flags
Definition: FullWrtParser.cxx:1606
MWAWInputStream.hxx
MWAWNote::FootNote
Definition: libmwaw_internal.hxx:386
FullWrtText
the main class to read the text part of writenow file
Definition: FullWrtText.hxx:66
FullWrtParser::readEndDocInfo
bool readEndDocInfo(FullWrtStruct::EntryPtr zone)
try to read the end of zone2 (only v2) ?
Definition: FullWrtParser.cxx:909
FullWrtParser::createDocument
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition: FullWrtParser.cxx:446
FullWrtParser::createZones
bool createZones()
finds the different objects zones
Definition: FullWrtParser.cxx:550
FullWrtParser::m_textParser
shared_ptr< FullWrtText > m_textParser
the text parser
Definition: FullWrtParser.hxx:179
FullWrtParser::readCitationDocInfo
bool readCitationDocInfo(FullWrtStruct::EntryPtr zone)
try to read the list of citation (at the end of doc info)
Definition: FullWrtParser.cxx:966
FullWrtParser::readPrintInfo
bool readPrintInfo(FullWrtStruct::EntryPtr zone)
try read the print info zone
Definition: FullWrtParser.cxx:1031
FullWrtStruct::Border
Internal: class to store a border which appear in docInfo.
Definition: FullWrtStruct.hxx:60
FullWrtParser::readDocZoneStruct
bool readDocZoneStruct(FullWrtStruct::EntryPtr zone)
try to read the zone which stores the structure of zone0, ... (ie. Zone1)
Definition: FullWrtParser.cxx:1296
FullWrtGraph
the main class to read the graphic part of a FullWrite Text file
Definition: FullWrtGraph.hxx:67
Vec2< float >
FullWrtParser::parse
void parse(librevenge::RVNGTextInterface *documentInterface)
virtual function used to parse the input
Definition: FullWrtParser.cxx:372
FullWrtParser::getBorder
bool getBorder(int bId, FullWrtStruct::Border &border) const
try to return a border corresponding to an id
Definition: FullWrtParser.cxx:328
FullWrtParser::readGenericDocData
bool readGenericDocData(FullWrtStruct::EntryPtr zone, FullWrtStruct::ZoneHeader &doc)
try to read the data of a zone which begins with a generic header
Definition: FullWrtParser.cxx:1441
FullWrtParserInternal
Internal: the structures of a FullWrtParser.
Definition: FullWrtParser.cxx:61
FullWrtParser::readReferenceData
bool readReferenceData(FullWrtStruct::EntryPtr zone)
try to read the reference data
Definition: FullWrtParser.cxx:1542
FullWrtStruct.hxx