MSK3Parser.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 MSK3_PARSER
35 # define MSK3_PARSER
36 
37 #include <list>
38 #include <string>
39 #include <vector>
40 
41 #include "MWAWDebug.hxx"
42 #include "MWAWEntry.hxx"
43 #include "MWAWInputStream.hxx"
44 
45 #include "MSKParser.hxx"
46 
47 namespace MSK3ParserInternal
48 {
49 struct State;
50 struct Zone;
51 class SubDocument;
52 }
53 
54 class MSKGraph;
55 class MSK3Text;
56 
62 class MSK3Parser : public MSKParser
63 {
65  friend class MSKGraph;
66  friend class MSK3Text;
67 public:
69  MSK3Parser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
71  virtual ~MSK3Parser();
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 
84  void createDocument(WPXDocumentInterface *documentInterface);
85 
87  bool createZones();
88 
90  double getTextHeight() const;
91 
93  Vec2f getPageLeftTop() const;
94 
96  void newPage(int number, bool softBreak=false);
97 
98  //
99  // intermediate level
100  //
101 
105  bool readDocumentInfo();
107  bool readGroup(MSK3ParserInternal::Zone &zone, MWAWEntry &entry, int check);
109  bool readGroupHeaderInfo(bool header, int check);
111  bool sendFootNote(int zoneId, int noteId);
112 
114  void sendText(int id, int noteId=-1);
115 
117  void sendZone(int zoneType);
118 
119  //
120  // low level
121  //
122 
124  bool readPrintInfo();
125 
126 protected:
127  //
128  // data
129  //
131  shared_ptr<MSK3ParserInternal::State> m_state;
132 
134  std::vector<MWAWEntry> m_listZones;
135 
137  shared_ptr<MSKGraph> m_graphParser;
138 
140  shared_ptr<MSK3Text> m_textParser;
141 };
142 #endif
143 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:

Generated on Sat Apr 26 2014 04:35:18 for libmwaw by doxygen 1.8.3.1