MWParser.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 MW_PARSER
35 # define MW_PARSER
36 
37 #include <vector>
38 
39 #include "MWAWPageSpan.hxx"
40 
41 #include "MWAWDebug.hxx"
42 #include "MWAWInputStream.hxx"
43 
44 #include "MWAWParser.hxx"
45 
46 class WPXBinaryData;
47 
48 class MWAWEntry;
49 
50 namespace MWParserInternal
51 {
52 struct State;
53 struct Information;
54 struct Paragraph;
55 class SubDocument;
56 }
57 
63 class MWParser : public MWAWParser
64 {
66 
67 public:
69  MWParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
71  virtual ~MWParser();
72 
74  bool checkHeader(MWAWHeader *header, bool strict=false);
75 
76  // the main parse function
77  void parse(WPXDocumentInterface *documentInterface);
78 
79 protected:
81  void init();
82 
85 
87  void createDocument(WPXDocumentInterface *documentInterface);
88 
90  bool sendWindow(int zone);
91 
93  bool createZones();
94 
96  bool createZonesV3();
97 
99  bool readPrintInfo();
100 
102  bool readWindowsInfo(int wh);
103 
105  bool readLinesHeight(MWAWEntry const &entry, std::vector<int> &firstParagLine,
106  std::vector<int> &linesHeight);
107 
109  bool readInformationsV3(int numInfo,
110  std::vector<MWParserInternal::Information> &informations);
111 
113  bool readInformations(MWAWEntry const &entry,
114  std::vector<MWParserInternal::Information> &informations);
115 
118 
120  bool readGraphic(MWParserInternal::Information const &info);
123  bool isMagicPic(WPXBinaryData const &dt) const;
124 
126  bool readText(MWParserInternal::Information const &info, std::vector<int> const &lineHeight);
127 
130 
132  bool checkFreeList();
133 
135  float pageHeight() const;
137  float pageWidth() const;
138 
140  void newPage(int number);
141 
142 protected:
143  //
144  // data
145  //
147  shared_ptr<MWParserInternal::State> m_state;
148 
151 };
152 #endif
153 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:

Generated on Tue Apr 30 2013 06:16:19 for libmwaw by doxygen 1.8.3.1