RagTimeParser.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 RAG_TIME_PARSER
35 # define RAG_TIME_PARSER
36 
37 #include <set>
38 #include <vector>
39 
40 #include "MWAWDebug.hxx"
41 #include "MWAWInputStream.hxx"
42 
43 #include "MWAWParser.hxx"
44 
45 namespace RagTimeParserInternal
46 {
47 struct State;
48 class SubDocument;
49 }
50 
51 class RagTimeText;
52 class RagTimeSpreadsheet;
53 
60 {
62  friend class RagTimeText;
63  friend class RagTimeSpreadsheet;
64 
65 public:
69  virtual ~RagTimeParser();
70 
72  bool checkHeader(MWAWHeader *header, bool strict=false);
73 
74  // the main parse function
75  void parse(librevenge::RVNGTextInterface *documentInterface);
76 
77 protected:
79  void init();
80 
81  //
82  // interface with text parser
83  //
84 
86  int getFontId(int localId) const;
87 
89  void createDocument(librevenge::RVNGTextInterface *documentInterface);
91  bool sendZones();
92 
94  void newPage(int number);
95 
97  bool createZones();
98 
100  bool findDataZones();
102  bool readDataZoneHeader(int id, long endPos);
104  bool findPagesZones();
105 
107  bool findRsrcZones();
108 
110  bool sendPageZone(int page);
112  bool send(int zId);
114  bool sendText(int zId);
115 
117  bool sendPicture(int zId, MWAWPosition const &pos);
119  bool sendBasicPicture(int zId, MWAWPosition const &pos);
121  void flushExtra();
122 
125  bool readPageZone(MWAWEntry &entry);
126 
128  bool readPictZone(MWAWEntry &entry);
129 
131  bool readPictZoneV2(MWAWEntry &entry);
132 
133  // some rsrc zone
134 
136  bool readColorMapV2(MWAWEntry &entry);
138  bool readPrintInfo(MWAWEntry &entry);
140  bool readLinks(MWAWEntry &entry);
142  bool readRsrcFormat(MWAWEntry &entry);
144  bool readItemFormats(MWAWEntry &entry);
146  bool readRsrcCHTa(MWAWEntry &entry);
147 
148  // unknown data fork zone
149 
151  bool readZone6(MWAWEntry &entry);
152 
153  // unknown rsrc fork zone
155  bool readRsrcBeDc(MWAWEntry &entry);
156 
158  bool readRsrcStructured(MWAWEntry &entry);
160  bool readRsrcUnamed(MWAWEntry &entry);
161 
163  bool readRsrcBtch(MWAWEntry &entry);
165  bool readRsrcCalc(MWAWEntry &entry);
167  bool readRsrcfppr(MWAWEntry &entry);
169  bool readRsrcSele(MWAWEntry &entry);
171  bool readRsrcSpDo(MWAWEntry &entry);
173  bool readRsrcSpDI(MWAWEntry &entry);
174  // maybe FH=footer/header zone
176  bool readRsrcFHsl(MWAWEntry &entry);
178  bool readRsrcFHwl(MWAWEntry &entry);
179 protected:
180  //
181  // data
182  //
184  shared_ptr<RagTimeParserInternal::State> m_state;
186  shared_ptr<RagTimeSpreadsheet> m_spreadsheetParser;
188  shared_ptr<RagTimeText> m_textParser;
189 };
190 #endif
191 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
shared_ptr< RagTimeParserInternal::State > m_state
the state
Definition: RagTimeParser.hxx:184
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
shared_ptr< RagTimeText > m_textParser
the text parser
Definition: RagTimeParser.hxx:188
bool readRsrcfppr(MWAWEntry &entry)
try to read the fppr zone (zone with id=0)
Definition: RagTimeParser.cxx:2085
RagTimeParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: RagTimeParser.cxx:338
void init()
inits all internal variables
Definition: RagTimeParser.cxx:348
bool sendPicture(int zId, MWAWPosition const &pos)
sends the picture
Definition: RagTimeParser.cxx:2402
bool findPagesZones()
try to sort the zone on each page
Definition: RagTimeParser.cxx:665
bool sendZones()
try to send the different zones
Definition: RagTimeParser.cxx:2555
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition: RagTimeParser.cxx:427
Internal: the subdocument of a RagTimeParser.
Definition: RagTimeParser.cxx:285
bool sendBasicPicture(int zId, MWAWPosition const &pos)
sends a basic shape
Definition: RagTimeParser.cxx:2519
the main class to read the text part of ragTime file
Definition: RagTimeText.hxx:69
bool readRsrcSele(MWAWEntry &entry)
try to read the Sele zone (zone with id=0), maybe related to selection
Definition: RagTimeParser.cxx:2121
bool readRsrcFHwl(MWAWEntry &entry)
try to read the FHwl zone ( one by file with id=0), maybe width length?
Definition: RagTimeParser.cxx:1896
bool readLinks(MWAWEntry &entry)
try to read the File Link zone: FLink
Definition: RagTimeParser.cxx:1517
void flushExtra()
flush unsent zone (debugging function)
Definition: RagTimeParser.cxx:2609
bool findRsrcZones()
try to create the resource zones list
Definition: RagTimeParser.cxx:953
bool readRsrcSpDI(MWAWEntry &entry)
try to read the SpDI zone (zone with id=0)
Definition: RagTimeParser.cxx:1951
the main class to read a RagTime v3 file
Definition: RagTimeParser.hxx:59
bool readPictZone(MWAWEntry &entry)
try to read pictZone ( a big zone)
Definition: RagTimeParser.cxx:1019
void newPage(int number)
adds a new page
Definition: RagTimeParser.cxx:375
bool createZones()
finds the different objects zones
Definition: RagTimeParser.cxx:465
virtual ~RagTimeParser()
destructor
Definition: RagTimeParser.cxx:344
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:388
bool send(int zId)
try to send a zone
Definition: RagTimeParser.cxx:2562
bool readZone6(MWAWEntry &entry)
try to read zone6 ( a big zone)
Definition: RagTimeParser.cxx:1374
bool findDataZones()
try to create the main data zones list
Definition: RagTimeParser.cxx:618
the main class to read the spreadsheet part of ragTime file
Definition: RagTimeSpreadsheet.hxx:69
bool sendText(int zId)
try to send the text zone (interface of RagTimeText)
Definition: RagTimeParser.cxx:367
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: RagTimeParser.cxx:2322
bool readRsrcCalc(MWAWEntry &entry)
try to read the Calc zone (zone with id=0)
Definition: RagTimeParser.cxx:1808
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:260
bool readRsrcBtch(MWAWEntry &entry)
try to read the Btch zone (zone with id=0)
Definition: RagTimeParser.cxx:2053
void parse(librevenge::RVNGTextInterface *documentInterface)
virtual function used to parse the input
Definition: RagTimeParser.cxx:391
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:380
bool readPrintInfo(MWAWEntry &entry)
read a printInfo block (a PREC rsrc)
Definition: RagTimeParser.cxx:1306
bool readRsrcStructured(MWAWEntry &entry)
try to read a structured zone
Definition: RagTimeParser.cxx:2222
bool readColorMapV2(MWAWEntry &entry)
try to read the color map:v2
Definition: RagTimeParser.cxx:1209
bool readRsrcBeDc(MWAWEntry &entry)
try to read the BeDc zone ( zone of size 52, one by file with id=0);
Definition: RagTimeParser.cxx:2008
bool readRsrcUnamed(MWAWEntry &entry)
try to read a unamed zone (5 by file, all with id=0)
Definition: RagTimeParser.cxx:2270
bool readDataZoneHeader(int id, long endPos)
try to read a data zone header
Definition: RagTimeParser.cxx:705
bool readRsrcCHTa(MWAWEntry &entry)
try to read the char table zone (CHTa) ?
Definition: RagTimeParser.cxx:1670
bool readRsrcFHsl(MWAWEntry &entry)
try to read the FHsl zone (s=style?)
Definition: RagTimeParser.cxx:1851
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
int getFontId(int localId) const
returns a mac font id corresponding to a local id
Definition: RagTimeParser.cxx:362
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
bool readPageZone(MWAWEntry &entry)
try to read page zone ( unknown content of size 40).
Definition: RagTimeParser.cxx:1472
bool sendPageZone(int page)
try to send the different zones of a page
Definition: RagTimeParser.cxx:2545
bool readPictZoneV2(MWAWEntry &entry)
try to read pictZone ( a big zone):v2
Definition: RagTimeParser.cxx:1090
shared_ptr< RagTimeSpreadsheet > m_spreadsheetParser
the spreadsheet parser
Definition: RagTimeParser.hxx:186
bool readRsrcSpDo(MWAWEntry &entry)
try to read the SpDo zone (zone with id=0)
Definition: RagTimeParser.cxx:2166
bool readRsrcFormat(MWAWEntry &entry)
try to read the format table zone: FoTa
Definition: RagTimeParser.cxx:1587
bool readItemFormats(MWAWEntry &entry)
try to read the item format zone: RTml zones
Definition: RagTimeParser.cxx:1741

Generated on Fri Jul 25 2014 13:24:33 for libmwaw by doxygen 1.8.7