MSK4Zone.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 MSK4_ZONE
35 # define MSK4_ZONE
36 
37 #include <map>
38 #include <string>
39 
40 #include "MWAWDebug.hxx"
41 #include "MWAWEntry.hxx"
42 #include "MWAWInputStream.hxx"
43 
44 #include "MSKParser.hxx"
45 
46 class MSK4Parser;
47 class MSK4Text;
48 class MSKGraph;
49 
50 namespace MSK4ZoneInternal
51 {
52 struct State;
53 }
54 namespace MSK4ParserInternal
55 {
56 class SubDocument;
57 }
58 
76 class MSK4Zone : public MSKParser
77 {
79  friend class MSK4Parser;
80  friend class MSKGraph;
81  friend class MSK4Text;
82 
83 public:
86  MSK4Parser &parser, std::string const &oleName);
88  ~MSK4Zone();
89 
90 protected:
92  void init();
93 
99 
102 
104  bool createZones(bool mainOle);
105 
109  void readContentZones(MWAWEntry const &entry, bool mainOle);
110 
113  (WPXDocumentInterface *interface,
114  MWAWSubDocumentPtr &header, MWAWSubDocumentPtr &footer);
115 
117  double getTextHeight() const;
118 
120  Vec2f getPageLeftTop() const;
121 
123  void newPage(int number);
124 
128  void sendFootNote(int id);
130  void readFootNote(int id);
131 
133  void sendFrameText(MWAWEntry const &entry, std::string const &frame);
134 
136  void sendRBIL(int id, Vec2i const &sz);
137 
139  void sendOLE(int id, MWAWPosition const &pos, WPXPropertyList frameExtras);
140 
142  MWAWEntry getTextPosition() const;
143 
145  void parse(WPXDocumentInterface *) {
146  MWAW_DEBUG_MSG(("MSK4Zone::parse: must not be called\n"));
147  }
149  bool checkHeader(MWAWHeader *, bool) {
150  MWAW_DEBUG_MSG(("MSK4Zone::checkHeader: must not be called\n"));
151  return false;
152  }
153 
154  //
155  // low level
156  //
157 
159  bool readPRNT(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page);
160 
164  bool readDOP(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page);
165 
169  bool readFRAM(MWAWInputStreamPtr input, MWAWEntry const &entry);
170 
174  bool readRLRB(MWAWInputStreamPtr input, MWAWEntry const &entry);
175 
179  bool readSELN(MWAWInputStreamPtr input, MWAWEntry const &entry);
180 
182  void setAscii(std::string const &oleName);
183 
184 private:
185  MSK4Zone(MSK4Zone const &orig);
186  MSK4Zone &operator=(MSK4Zone const &orig);
187 protected:
188  //
189  // data
190  //
191 
194 
196  shared_ptr<MSK4ZoneInternal::State> m_state;
197 
199  std::multimap<std::string, MWAWEntry> m_entryMap;
200 
202  shared_ptr<MSK4Text> m_textParser;
203 
205  shared_ptr<MSKGraph> m_graphParser;
206 };
207 #endif
208 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
void sendOLE(int id, MWAWPosition const &pos, WPXPropertyList frameExtras)
send an OLE zone
Definition: MSK4Zone.cxx:219
a function used by MWAWDocument to store the version of document and the input
Definition: MWAWHeader.hxx:47
void sendRBIL(int id, Vec2i const &sz)
send a rbil zone
Definition: MSK4Zone.cxx:209
void readFootNote(int id)
sends text corresponding to the footnote id to the listener (via MSK4Text)
Definition: MSK4Zone.cxx:199
shared_ptr< MSKGraph > m_graphParser
the graph parser
Definition: MSK4Zone.hxx:205
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:95
void newPage(int number)
adds a new page
Definition: MSK4Zone.cxx:241
the main class to read the graphic of a Microsoft Works file
Definition: MSKGraph.hxx:68
Vec2f getPageLeftTop() const
returns the page top left point
Definition: MSK4Zone.cxx:232
void sendFrameText(MWAWEntry const &entry, std::string const &frame)
send the frame text
Definition: MSK4Zone.cxx:204
bool readSELN(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the SELN zone which seems to contain some information about the actual
Definition: MSK4Zone.cxx:1115
Internal: the subdocument of a MSK4Parser.
Definition: MSK4Parser.cxx:58
~MSK4Zone()
destructor
Definition: MSK4Zone.cxx:174
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:358
shared_ptr< MSK4ZoneInternal::State > m_state
the internal state
Definition: MSK4Zone.hxx:196
MSK4Zone & operator=(MSK4Zone const &orig)
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:116
bool parseHeaderIndexEntry(MWAWInputStreamPtr &input)
parses an index entry
Definition: MSK4Zone.cxx:310
generic parser for Microsoft Works file
Definition: MSKParser.hxx:58
bool readPRNT(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page)
reads the PRNT zone which contains the printer properties ( page dimension, margins, ...)
Definition: MSK4Zone.cxx:643
bool checkHeader(MWAWHeader *, bool)
empty implementation of the checkHeader function ( to make the class not virtual) ...
Definition: MSK4Zone.hxx:149
void init()
inits all internal variables
Definition: MSK4Zone.cxx:181
bool readRLRB(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the RLRB zone which seems to contain some position in the page ?
Definition: MSK4Zone.cxx:884
void sendFootNote(int id)
creates a document for a footnote which some id (via MSK4Parser )
Definition: MSK4Zone.cxx:195
MWAWContentListenerPtr createListener(WPXDocumentInterface *interface, MWAWSubDocumentPtr &header, MWAWSubDocumentPtr &footer)
creates the main listener
Definition: MSK4Zone.cxx:273
The class which parses the main zones of a mac MS Works document v4.
Definition: MSK4Zone.hxx:76
shared_ptr< MSK4Text > m_textParser
the text parser
Definition: MSK4Zone.hxx:202
bool createZones(bool mainOle)
finds and parses all the zones to prepare the data
Definition: MSK4Zone.cxx:483
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:348
void parse(WPXDocumentInterface *)
empty implementation of the parse function ( to make the class not virtual)
Definition: MSK4Zone.hxx:145
shared_ptr< MWAWContentListener > MWAWContentListenerPtr
a smart pointer of MWAWContentListener
Definition: libmwaw_internal.hxx:340
bool readDOP(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page)
parses the DIO zone which contains the document properties (dimension, ...)
Definition: MSK4Zone.cxx:687
MSK4Parser * m_mainParser
the main parser
Definition: MSK4Zone.hxx:193
the main class to read a MS Works document v4
Definition: MSK4Parser.hxx:65
void readContentZones(MWAWEntry const &entry, bool mainOle)
final reading of a text zone
Definition: MSK4Zone.cxx:575
bool parseHeaderIndex(MWAWInputStreamPtr &input)
tries to find the beginning of the list of indices, then try to find all entries in this list...
Definition: MSK4Zone.cxx:410
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:356
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
bool readFRAM(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the FRAM zone which contains some information about frames (header, footer, ...)
Definition: MSK4Zone.cxx:938
The class which parses text zones in a mac MS Works document v4.
Definition: MSK4Text.hxx:63
std::multimap< std::string, MWAWEntry > m_entryMap
the list of entries, name-&gt;entry
Definition: MSK4Zone.hxx:199
MWAWEntry getTextPosition() const
return the text positions ( used for frame text)
Definition: MSK4Zone.cxx:264
double getTextHeight() const
returns the page height, ie. paper size less margin (in inches) less header/footer size ...
Definition: MSK4Zone.cxx:227
void setAscii(std::string const &oleName)
inits the ascii file
Definition: MSK4Zone.cxx:189
MSK4Zone(MWAWInputStreamPtr input, MWAWParserStatePtr parserState, MSK4Parser &parser, std::string const &oleName)
constructor
Definition: MSK4Zone.cxx:165

Generated on Tue Mar 10 2015 17:32:08 for libmwaw by doxygen 1.8.5