MSK4Zone.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
#ifndef MSK4_ZONE
# define MSK4_ZONE
#include <map>
#include <string>
#include "MWAWDebug.hxx"
#include "MWAWEntry.hxx"
#include "MWAWInputStream.hxx"
#include "MSKParser.hxx"
class MSK4Parser;
class MSK4Text;
class MSKGraph;
namespace MSK4ZoneInternal
{
struct State;
}
namespace MSK4ParserInternal
{
class SubDocument;
}
class MSK4Zone : public MSKParser
{
friend class MSK4ParserInternal::SubDocument;
friend class MSK4Parser;
friend class MSKGraph;
friend class MSK4Text;
public:
MSK4Zone(MWAWInputStreamPtr input, MWAWParserStatePtr parserState,
MSK4Parser &parser, std::string const &oleName);
~MSK4Zone();
protected:
void init();
bool parseHeaderIndex(MWAWInputStreamPtr &input);
bool parseHeaderIndexEntry(MWAWInputStreamPtr &input);
bool createZones(bool mainOle);
void readContentZones(MWAWEntry const &entry, bool mainOle);
MWAWContentListenerPtr createListener
(WPXDocumentInterface *interface,
MWAWSubDocumentPtr &header, MWAWSubDocumentPtr &footer);
double getTextHeight() const;
Vec2f getPageLeftTop() const;
void newPage(int number);
void sendFootNote(int id);
void readFootNote(int id);
void sendFrameText(MWAWEntry const &entry, std::string const &frame);
void sendRBIL(int id, Vec2i const &sz);
void sendOLE(int id, MWAWPosition const &pos, WPXPropertyList frameExtras);
MWAWEntry getTextPosition() const;
void parse(WPXDocumentInterface *) {
MWAW_DEBUG_MSG(("MSK4Zone::parse: must not be called\n"));
}
bool checkHeader(MWAWHeader *, bool) {
MWAW_DEBUG_MSG(("MSK4Zone::checkHeader: must not be called\n"));
return false;
}
//
// low level
//
bool readPRNT(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page);
bool readDOP(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page);
bool readFRAM(MWAWInputStreamPtr input, MWAWEntry const &entry);
bool readRLRB(MWAWInputStreamPtr input, MWAWEntry const &entry);
bool readSELN(MWAWInputStreamPtr input, MWAWEntry const &entry);
void setAscii(std::string const &oleName);
private:
MSK4Zone(MSK4Zone const &orig);
MSK4Zone &operator=(MSK4Zone const &orig);
protected:
//
// data
//
MSK4Parser *m_mainParser;
shared_ptr<MSK4ZoneInternal::State> m_state;
std::multimap<std::string, MWAWEntry> m_entryMap;
shared_ptr<MSK4Text> m_textParser;
shared_ptr<MSKGraph> m_graphParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MSKParser.hxx
MSK4Zone::sendOLE
void sendOLE(int id, MWAWPosition const &pos, WPXPropertyList frameExtras)
send an OLE zone
Definition: MSK4Zone.cxx:219
MWAWHeader
a function used by MWAWDocument to store the version of document and the input
Definition: MWAWHeader.hxx:47
MSK4Zone::sendRBIL
void sendRBIL(int id, Vec2i const &sz)
send a rbil zone
Definition: MSK4Zone.cxx:209
MSK4Zone::readFootNote
void readFootNote(int id)
sends text corresponding to the footnote id to the listener (via MSK4Text)
Definition: MSK4Zone.cxx:199
MSK4Zone::m_graphParser
shared_ptr< MSKGraph > m_graphParser
the graph parser
Definition: MSK4Zone.hxx:205
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:95
MWAWEntry.hxx
MSK4Zone::newPage
void newPage(int number)
adds a new page
Definition: MSK4Zone.cxx:241
MSKGraph
the main class to read the text part of Claris Works file
Definition: MSKGraph.hxx:71
MSK4Zone::getPageLeftTop
Vec2f getPageLeftTop() const
returns the page top left point
Definition: MSK4Zone.cxx:232
MSK4Zone::sendFrameText
void sendFrameText(MWAWEntry const &entry, std::string const &frame)
send the frame text
Definition: MSK4Zone.cxx:204
MSK4Zone::readSELN
bool readSELN(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the SELN zone which seems to contain some information about the actual
Definition: MSK4Zone.cxx:1115
MSK4ParserInternal::SubDocument
Internal: the subdocument of a MSK4Parser.
Definition: MSK4Parser.cxx:58
MSK4Zone::~MSK4Zone
~MSK4Zone()
destructor
Definition: MSK4Zone.cxx:174
MWAWSubDocumentPtr
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:344
MSK4Zone::m_state
shared_ptr< MSK4ZoneInternal::State > m_state
the internal state
Definition: MSK4Zone.hxx:196
MSK4Zone::operator=
MSK4Zone & operator=(MSK4Zone const &orig)
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:111
MSK4Zone::parseHeaderIndexEntry
bool parseHeaderIndexEntry(MWAWInputStreamPtr &input)
parses an index entry
Definition: MSK4Zone.cxx:310
MSKParser
generic parser for Microsoft Works file
Definition: MSKParser.hxx:57
MSK4Zone::readPRNT
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
MSK4Zone::checkHeader
bool checkHeader(MWAWHeader *, bool)
empty implementation of the checkHeader function ( to make the class not virtual) ...
Definition: MSK4Zone.hxx:149
MSK4Zone::init
void init()
inits all internal variables
Definition: MSK4Zone.cxx:181
MSK4Zone::readRLRB
bool readRLRB(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the RLRB zone which seems to contain some position in the page ?
Definition: MSK4Zone.cxx:884
MSK4Zone::sendFootNote
void sendFootNote(int id)
creates a document for a footnote which some id (via MSK4Parser )
Definition: MSK4Zone.cxx:195
MSK4Zone::createListener
MWAWContentListenerPtr createListener(WPXDocumentInterface *interface, MWAWSubDocumentPtr &header, MWAWSubDocumentPtr &footer)
creates the main listener
Definition: MSK4Zone.cxx:273
MSK4Zone
The class which parses the main zones of a mac MS Works document v4.
Definition: MSK4Zone.hxx:76
MSK4Zone::m_textParser
shared_ptr< MSK4Text > m_textParser
the text parser
Definition: MSK4Zone.hxx:202
MSK4Zone::createZones
bool createZones(bool mainOle)
finds and parses all the zones to prepare the data
Definition: MSK4Zone.cxx:483
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
MWAWInputStream.hxx
MWAWDebug.hxx
MSK4Zone::parse
void parse(WPXDocumentInterface *)
empty implementation of the parse function ( to make the class not virtual)
Definition: MSK4Zone.hxx:145
MWAWContentListenerPtr
shared_ptr< MWAWContentListener > MWAWContentListenerPtr
a smart pointer of MWAWContentListener
Definition: libmwaw_internal.hxx:330
MSK4Zone::readDOP
bool readDOP(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page)
parses the DIO zone which contains the document properties (dimension, ...)
Definition: MSK4Zone.cxx:687
MSK4Zone::m_mainParser
MSK4Parser * m_mainParser
the main parser
Definition: MSK4Zone.hxx:193
MSK4Parser
the main class to read a MS Works document v4
Definition: MSK4Parser.hxx:65
MSK4Zone::readContentZones
void readContentZones(MWAWEntry const &entry, bool mainOle)
final reading of a text zone
Definition: MSK4Zone.cxx:575
MSK4Zone::parseHeaderIndex
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
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
Vec2< float >
MSK4Zone::readFRAM
bool readFRAM(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the FRAM zone which contains some information about frames (header, footer, ...)
Definition: MSK4Zone.cxx:938
MSK4Text
The class which parses text zones in a mac MS Works document v4.
Definition: MSK4Text.hxx:63
MSK4Zone::m_entryMap
std::multimap< std::string, MWAWEntry > m_entryMap
the list of entries, name->entry
Definition: MSK4Zone.hxx:199
MSK4Zone::getTextPosition
MWAWEntry getTextPosition() const
return the text positions ( used for frame text)
Definition: MSK4Zone.cxx:264
MSK4Zone::getTextHeight
double getTextHeight() const
returns the page height, ie. paper size less margin (in inches) less header/footer size ...
Definition: MSK4Zone.cxx:227
MSK4Zone::setAscii
void setAscii(std::string const &oleName)
inits the ascii file
Definition: MSK4Zone.cxx:189
MSK4Zone::MSK4Zone
MSK4Zone(MWAWInputStreamPtr input, MWAWParserStatePtr parserState, MSK4Parser &parser, std::string const &oleName)
constructor
Definition: MSK4Zone.cxx:165