MsWks4Zone.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 MS_WKS4_ZONE
# define MS_WKS4_ZONE
#include <map>
#include <string>
#include "MWAWDebug.hxx"
#include "MWAWEntry.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
#include "MsWksDocument.hxx"
class MsWksParser;
class MsWksDRParser;
namespace MsWks4ZoneInternal
{
struct State;
}
class MsWks4Zone
{
friend class MsWksDocument;
friend class MsWksDRParser;
friend class MsWksParser;
friend class MsWks4Text;
public:
MsWks4Zone(MWAWInputStreamPtr const &input, MWAWParserStatePtr const &parserState,
MWAWParser &parser, std::string const &oleName);
~MsWks4Zone();
protected:
void init();
MWAWInputStreamPtr getInput();
bool parseHeaderIndex(MWAWInputStreamPtr &input);
bool parseHeaderIndexEntry(MWAWInputStreamPtr &input);
bool createZones(bool mainOle);
void readContentZones(MWAWEntry const &entry, bool mainOle);
MWAWTextListenerPtr createListener(librevenge::RVNGTextInterface *interface);
double getTextHeight() const;
void newPage(int number, bool soft=false);
void readFootNote(int id);
MWAWEntry getTextPosition() const;
//
// 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);
libmwaw::DebugFile &ascii();
private:
MsWks4Zone(MsWks4Zone const &orig) = delete;
MsWks4Zone &operator=(MsWks4Zone const &orig) = delete;
protected:
//
// data
//
MWAWParser *m_mainParser;
std::shared_ptr<MWAWParserState> m_parserState;
std::shared_ptr<MsWks4ZoneInternal::State> m_state;
std::shared_ptr<MsWksDocument> m_document;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWEntry.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MsWksDocument.hxx
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWPageSpan
A class which defines the page properties.
Definition MWAWPageSpan.hxx:99
MWAWParser
virtual class which defines the ancestor of all main zone parser
Definition MWAWParser.hxx:100
MsWks4Zone::m_mainParser
MWAWParser * m_mainParser
the main parser
Definition MsWks4Zone.hxx:166
MsWks4Zone::createZones
bool createZones(bool mainOle)
finds and parses all the zones to prepare the data
Definition MsWks4Zone.cxx:471
MsWks4Zone::m_parserState
std::shared_ptr< MWAWParserState > m_parserState
the parser state
Definition MsWks4Zone.hxx:169
MsWks4Zone::readFootNote
void readFootNote(int id)
sends text corresponding to the footnote id to the listener (via MsWks4Text)
Definition MsWks4Zone.cxx:222
MsWks4Zone::getTextHeight
double getTextHeight() const
returns the page height, ie. paper size less margin (in inches) less header/footer size
Definition MsWks4Zone.cxx:230
MsWks4Zone::readFRAM
bool readFRAM(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the FRAM zone which contains some information about frames (header, footer,...
Definition MsWks4Zone.cxx:928
MsWks4Zone::setAscii
void setAscii(std::string const &oleName)
inits the ascii file
Definition MsWks4Zone.cxx:211
MsWks4Zone::getInput
MWAWInputStreamPtr getInput()
returns the actual input
Definition MsWks4Zone.cxx:206
MsWks4Zone::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 MsWks4Zone.cxx:392
MsWks4Zone::readRLRB
bool readRLRB(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the RLRB zone which seems to contain some position in the page ?
Definition MsWks4Zone.cxx:874
MsWks4Zone::getTextPosition
MWAWEntry getTextPosition() const
return the text positions ( used for frame text)
Definition MsWks4Zone.cxx:261
MsWks4Zone::parseHeaderIndexEntry
bool parseHeaderIndexEntry(MWAWInputStreamPtr &input)
parses an index entry
Definition MsWks4Zone.cxx:292
MsWks4Zone::MsWksParser
friend class MsWksParser
Definition MsWks4Zone.hxx:77
MsWks4Zone::readDOP
bool readDOP(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page)
parses the DIO zone which contains the document properties (dimension, ...)
Definition MsWks4Zone.cxx:678
MsWks4Zone::readPRNT
bool readPRNT(MWAWInputStreamPtr input, MWAWEntry const &entry, MWAWPageSpan &page)
reads the PRNT zone which contains the printer properties ( page dimension, margins,...
Definition MsWks4Zone.cxx:633
MsWks4Zone::MsWks4Zone
MsWks4Zone(MsWks4Zone const &orig)=delete
MsWks4Zone::createListener
MWAWTextListenerPtr createListener(librevenge::RVNGTextInterface *interface)
creates the main listener
Definition MsWks4Zone.cxx:269
MsWks4Zone::newPage
void newPage(int number, bool soft=false)
adds a new page
Definition MsWks4Zone.cxx:238
MsWks4Zone::MsWks4Zone
MsWks4Zone(MWAWInputStreamPtr const &input, MWAWParserStatePtr const &parserState, MWAWParser &parser, std::string const &oleName)
constructor
Definition MsWks4Zone.cxx:180
MsWks4Zone::ascii
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition MsWks4Zone.cxx:217
MsWks4Zone::operator=
MsWks4Zone & operator=(MsWks4Zone const &orig)=delete
MsWks4Zone::m_document
std::shared_ptr< MsWksDocument > m_document
the zone data
Definition MsWks4Zone.hxx:175
MsWks4Zone::MsWks4Text
friend class MsWks4Text
Definition MsWks4Zone.hxx:78
MsWks4Zone::readContentZones
void readContentZones(MWAWEntry const &entry, bool mainOle)
final reading of a text zone
Definition MsWks4Zone.cxx:566
MsWks4Zone::init
void init()
inits all internal variables
Definition MsWks4Zone.cxx:200
MsWks4Zone::readSELN
bool readSELN(MWAWInputStreamPtr input, MWAWEntry const &entry)
parses the SELN zone which seems to contain some information about the actual
Definition MsWks4Zone.cxx:1093
MsWks4Zone::MsWksDocument
friend class MsWksDocument
Definition MsWks4Zone.hxx:75
MsWks4Zone::~MsWks4Zone
~MsWks4Zone()
destructor
Definition MsWks4Zone.cxx:193
MsWks4Zone::MsWksDRParser
friend class MsWksDRParser
Definition MsWks4Zone.hxx:76
MsWks4Zone::m_state
std::shared_ptr< MsWks4ZoneInternal::State > m_state
the internal state
Definition MsWks4Zone.hxx:172
MsWksDRParser
the main class to read a Microsoft Works graphic file
Definition MsWksDRParser.hxx:60
MsWksParser
the main class to read a Microsoft Works file: v1-v4
Definition MsWksParser.hxx:60
libmwaw::DebugFile
Definition MWAWDebug.hxx:66
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
MWAWTextListenerPtr
std::shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition libmwaw_internal.hxx:567
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
MsWks4ZoneInternal
Internal: the structures of a MsWks4Zone.
Definition MsWks4Zone.cxx:58
MsWks4ZoneInternal::State
Internal: the state of a MsWks4Zone.
Definition MsWks4Zone.cxx:142