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 MWAWHeader;
48 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
49 
50 class MSK4Parser;
51 class MSK4Text;
52 class MSKGraph;
53 
54 namespace MSK4ZoneInternal
55 {
56 struct State;
57 }
58 namespace MSK4ParserInternal
59 {
60 class SubDocument;
61 }
62 
80 class MSK4Zone : public MSKParser
81 {
83  friend class MSK4Parser;
84  friend class MSKGraph;
85  friend class MSK4Text;
86 
87 public:
90  MSK4Parser &parser, std::string const &oleName);
92  ~MSK4Zone();
93 
94 protected:
96  void init();
97 
103 
106 
108  bool createZones(bool mainOle);
109 
113  void readContentZones(MWAWEntry const &entry, bool mainOle);
114 
117  (WPXDocumentInterface *interface,
118  MWAWSubDocumentPtr &header, MWAWSubDocumentPtr &footer);
119 
121  double getTextHeight() const;
122 
124  Vec2f getPageTopLeft() const;
125 
127  void newPage(int number);
128 
132  void sendFootNote(int id);
134  void readFootNote(int id);
135 
137  void sendFrameText(MWAWEntry const &entry, std::string const &frame);
138 
140  void sendRBIL(int id, Vec2i const &sz);
141 
143  void sendOLE(int id, MWAWPosition const &pos, WPXPropertyList frameExtras);
144 
146  MWAWEntry getTextPosition() const;
147 
149  void parse(WPXDocumentInterface *) {
150  MWAW_DEBUG_MSG(("MSK4Zone::parse: must not be called\n"));
151  }
153  bool checkHeader(MWAWHeader *, bool) {
154  MWAW_DEBUG_MSG(("MSK4Zone::checkHeader: must not be called\n"));
155  return false;
156  }
157 
158  //
159  // low level
160  //
161 
163  bool readPRNT(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page);
164 
168  bool readDOP(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page);
169 
173  bool readFRAM(MWAWInputStreamPtr input, MWAWEntry const &entry);
174 
178  bool readRLRB(MWAWInputStreamPtr input, MWAWEntry const &entry);
179 
183  bool readSELN(MWAWInputStreamPtr input, MWAWEntry const &entry);
184 
186  void setAscii(std::string const &oleName);
187 
188 private:
189  MSK4Zone(MSK4Zone const &orig);
190  MSK4Zone &operator=(MSK4Zone const &orig);
191 protected:
192  //
193  // data
194  //
195 
198 
200  shared_ptr<MSK4ZoneInternal::State> m_state;
201 
203  std::multimap<std::string, MWAWEntry> m_entryMap;
204 
206  shared_ptr<MSK4Text> m_textParser;
207 
209  shared_ptr<MSKGraph> m_graphParser;
210 };
211 #endif
212 // 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:49
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
Definition: MSK4Zone.hxx:47
void sendRBIL(int id, Vec2i const &sz)
send a rbil zone
Definition: MSK4Zone.cxx:209
shared_ptr< MWAWParserState > MWAWParserStatePtr
Definition: ACText.hxx:49
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
Definition: ACText.hxx:44
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:209
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:100
void newPage(int number)
adds a new page
Definition: MSK4Zone.cxx:241
the main class to read the text part of Claris Works file
Definition: MSKGraph.hxx:74
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
Vec2f getPageTopLeft() const
returns the page top left point
Definition: MSK4Zone.cxx:232
~MSK4Zone()
destructor
Definition: MSK4Zone.cxx:174
shared_ptr< MWAWContentListener > MWAWContentListenerPtr
Definition: MWAWContentListener.hxx:260
shared_ptr< MSK4ZoneInternal::State > m_state
the internal state
Definition: MSK4Zone.hxx:200
MSK4Zone & operator=(MSK4Zone const &orig)
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:111
bool parseHeaderIndexEntry(MWAWInputStreamPtr &input)
parses an index entry
Definition: MSK4Zone.cxx:310
generic parser for Microsoft Works file
Definition: MSKParser.hxx:58
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:49
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:153
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:80
shared_ptr< MSK4Text > m_textParser
the text parser
Definition: MSK4Zone.hxx:206
bool createZones(bool mainOle)
finds and parses all the zones to prepare the data
Definition: MSK4Zone.cxx:483
void parse(WPXDocumentInterface *)
empty implementation of the parse function ( to make the class not virtual)
Definition: MSK4Zone.hxx:149
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:197
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
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:67
std::multimap< std::string, MWAWEntry > m_entryMap
the list of entries, name-&gt;entry
Definition: MSK4Zone.hxx:203
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 for libmwaw by doxygen 1.8.5