MSK3Parser.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 MSK3_PARSER
# define MSK3_PARSER
#include <list>
#include <string>
#include <vector>
#include "MWAWDebug.hxx"
#include "MWAWEntry.hxx"
#include "MWAWInputStream.hxx"
#include "MSKParser.hxx"
namespace MSK3ParserInternal
{
struct State;
struct Zone;
class SubDocument;
}
class MSKGraph;
class MSK3Text;
class MSK3Parser : public MSKParser
{
friend class MSK3ParserInternal::SubDocument;
friend class MSKGraph;
friend class MSK3Text;
public:
MSK3Parser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
virtual ~MSK3Parser();
bool checkHeader(MWAWHeader *header, bool strict=false);
// the main parse function
void parse(WPXDocumentInterface *documentInterface);
protected:
void init();
void createDocument(WPXDocumentInterface *documentInterface);
bool createZones();
double getTextHeight() const;
Vec2f getPageLeftTop() const;
void newPage(int number, bool softBreak=false);
//
// intermediate level
//
bool readZone(MSK3ParserInternal::Zone &zone);
bool readDocumentInfo();
bool readGroup(MSK3ParserInternal::Zone &zone, MWAWEntry &entry, int check);
bool readGroupHeaderInfo(bool header, int check);
bool sendFootNote(int zoneId, int noteId);
void sendText(int id, int noteId=-1);
void sendZone(int zoneType);
//
// low level
//
bool readPrintInfo();
protected:
//
// data
//
shared_ptr<MSK3ParserInternal::State> m_state;
std::vector<MWAWEntry> m_listZones;
shared_ptr<MSKGraph> m_graphParser;
shared_ptr<MSK3Text> m_textParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MSKParser.hxx
MSK3Parser::readGroupHeaderInfo
bool readGroupHeaderInfo(bool header, int check)
try to read a zone information (zone0)
Definition: MSK3Parser.cxx:845
MWAWHeader
a function used by MWAWDocument to store the version of document and the input
Definition: MWAWHeader.hxx:47
MSK3Parser::createDocument
void createDocument(WPXDocumentInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MSK3Parser.cxx:305
MSK3Parser::~MSK3Parser
virtual ~MSK3Parser()
destructor
Definition: MSK3Parser.cxx:192
MSK3Parser::sendZone
void sendZone(int zoneType)
try to send a zone
Definition: MSK3Parser.cxx:283
MSK3Parser::readPrintInfo
bool readPrintInfo()
read the print info zone
Definition: MSK3Parser.cxx:942
MWAWEntry.hxx
MSK3ParserInternal::Zone
Internal: a zone of a MSK3Parser ( main, header, footer )
Definition: MSK3Parser.cxx:59
MSK3Parser::m_state
shared_ptr< MSK3ParserInternal::State > m_state
the state
Definition: MSK3Parser.hxx:131
MSKGraph
the main class to read the text part of Claris Works file
Definition: MSKGraph.hxx:71
MSK3Parser::readGroup
bool readGroup(MSK3ParserInternal::Zone &zone, MWAWEntry &entry, int check)
try to read a group zone (zone3)
Definition: MSK3Parser.cxx:754
MSK3Parser::getPageLeftTop
Vec2f getPageLeftTop() const
returns the page top left point
Definition: MSK3Parser.cxx:218
MSK3Text
the main class to read the text part of Microsoft Works file
Definition: MSK3Text.hxx:64
MSK3Parser::createZones
bool createZones()
finds the different objects zones
Definition: MSK3Parser.cxx:371
MSK3Parser::newPage
void newPage(int number, bool softBreak=false)
adds a new page
Definition: MSK3Parser.cxx:227
MWAWRSRCParserPtr
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:340
MSKParser
generic parser for Microsoft Works file
Definition: MSKParser.hxx:57
MSK3Parser
the main class to read a Microsoft Works file
Definition: MSK3Parser.hxx:62
MSK3Parser::readDocumentInfo
bool readDocumentInfo()
try to read the documentinfo ( zone2)
Definition: MSK3Parser.cxx:644
MSK3Parser::MSK3Parser
MSK3Parser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: MSK3Parser.cxx:186
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
MWAWInputStream.hxx
MWAWDebug.hxx
MSK3Parser::m_textParser
shared_ptr< MSK3Text > m_textParser
the text parser
Definition: MSK3Parser.hxx:140
MSK3Parser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: MSK3Parser.cxx:475
MSK3Parser::init
void init()
inits all internal variables
Definition: MSK3Parser.cxx:196
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
MSK3ParserInternal::SubDocument
Internal: the subdocument of a MSK3Parser.
Definition: MSK3Parser.cxx:107
Vec2< float >
MSK3Parser::parse
void parse(WPXDocumentInterface *documentInterface)
virtual function used to parse the input
Definition: MSK3Parser.cxx:246
MSK3Parser::m_graphParser
shared_ptr< MSKGraph > m_graphParser
the graph parser
Definition: MSK3Parser.hxx:137
MSK3Parser::sendText
void sendText(int id, int noteId=-1)
try to send a text entry
Definition: MSK3Parser.cxx:275
MSK3Parser::sendFootNote
bool sendFootNote(int zoneId, int noteId)
try to send a note
Definition: MSK3Parser.cxx:293
MSK3Parser::m_listZones
std::vector< MWAWEntry > m_listZones
the list of different Zones
Definition: MSK3Parser.hxx:134
MSK3Parser::getTextHeight
double getTextHeight() const
returns the page height, ie. paper size less margin (in inches) less header/footer size ...
Definition: MSK3Parser.cxx:213
MSK3Parser::readZone
bool readZone(MSK3ParserInternal::Zone &zone)
try to read a generic zone
Definition: MSK3Parser.cxx:429