BeagleWksSSParser.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 BEAGLE_WKS_SS_PARSER
# define BEAGLE_WKS_SS_PARSER
#include <string>
#include <vector>
#include <librevenge/librevenge.h>
#include "MWAWCell.hxx"
#include "MWAWDebug.hxx"
#include "MWAWGraphicStyle.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
#include "BeagleWksStructManager.hxx"
namespace BeagleWksSSParserInternal
{
class SubDocument;
struct Cell;
struct Chart;
struct Spreadsheet;
struct State;
}
class BeagleWksStructManager;
class BeagleWksSSParser final : public MWAWSpreadsheetParser
{
friend struct BeagleWksSSParserInternal::Chart;
friend class BeagleWksSSParserInternal::SubDocument;
public:
BeagleWksSSParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~BeagleWksSSParser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
// the main parse function
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final;
protected:
void init();
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface);
MWAWVec2f getPageLeftTop() const;
void newPage(int number);
bool sendSpreadsheet();
bool sendText(MWAWEntry const &entry, bool headerFooter=false);
bool sendPageFrames();
bool sendFrame(BeagleWksStructManager::Frame const &frame);
bool sendPicture(int pId, MWAWPosition const &pos,
MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle());
protected:
bool createZones();
bool readRSRCZones();
//
// low level
//
// data fork similar than in BeagleWksParser ...
bool readPrintInfo();
// data fork
bool readChartZone();
bool readChart();
bool readSpreadsheet();
bool readRowSheet(BeagleWksSSParserInternal::Spreadsheet &sheet);
bool readCellSheet(BeagleWksSSParserInternal::Cell &cell);
bool readZone0();
bool readColumnWidths(BeagleWksSSParserInternal::Spreadsheet &sheet);
bool readFormula(BeagleWksSSParserInternal::Spreadsheet &sheet);
// resource fork
MWAWInputStreamPtr rsrcInput();
libmwaw::DebugFile &rsrcAscii();
std::shared_ptr<BeagleWksSSParserInternal::State> m_state;
std::shared_ptr<BeagleWksStructManager> m_structureManager;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
BeagleWksStructManager.hxx
MWAWCell.hxx
Defines MWAWCell (cell content and format).
MWAWDebug.hxx
MWAWGraphicStyle.hxx
MWAWInputStream.hxx
MWAWParser.hxx
BeagleWksSSParserInternal::SubDocument
Internal: the subdocument of a BeagleWksSSParser.
Definition BeagleWksSSParser.cxx:272
BeagleWksSSParser::createZones
bool createZones()
finds the different objects zones
Definition BeagleWksSSParser.cxx:457
BeagleWksSSParser::readSpreadsheet
bool readSpreadsheet()
read the spreadsheet zone
Definition BeagleWksSSParser.cxx:943
BeagleWksSSParser::rsrcAscii
libmwaw::DebugFile & rsrcAscii()
a DebugFile used to write what we recognize when we parse the document in rsrc
Definition BeagleWksSSParser.cxx:348
BeagleWksSSParser::sendPicture
bool sendPicture(int pId, MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition BeagleWksSSParser.cxx:1446
BeagleWksSSParser::rsrcInput
MWAWInputStreamPtr rsrcInput()
return the input input
Definition BeagleWksSSParser.cxx:343
BeagleWksSSParser::sendText
bool sendText(MWAWEntry const &entry, bool headerFooter=false)
try to send a text zone
Definition BeagleWksSSParser.cxx:1471
BeagleWksSSParser::readPrintInfo
bool readPrintInfo()
read the print info zone
Definition BeagleWksSSParser.cxx:580
BeagleWksSSParser::readFormula
bool readFormula(BeagleWksSSParserInternal::Spreadsheet &sheet)
read the differents formula
Definition BeagleWksSSParser.cxx:1374
BeagleWksSSParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition BeagleWksSSParser.cxx:1576
BeagleWksSSParser::readColumnWidths
bool readColumnWidths(BeagleWksSSParserInternal::Spreadsheet &sheet)
read the columns widths
Definition BeagleWksSSParser.cxx:1326
BeagleWksSSParser::readRSRCZones
bool readRSRCZones()
read the resource fork zone
Definition BeagleWksSSParser.cxx:542
BeagleWksSSParser::sendPageFrames
bool sendPageFrames()
try to send the page graphic
Definition BeagleWksSSParser.cxx:1423
BeagleWksSSParser::readCellSheet
bool readCellSheet(BeagleWksSSParserInternal::Cell &cell)
read a cell row
Definition BeagleWksSSParser.cxx:1024
BeagleWksSSParser::getPageLeftTop
MWAWVec2f getPageLeftTop() const
returns the page left top point ( in inches)
Definition BeagleWksSSParser.cxx:356
BeagleWksSSParser::sendSpreadsheet
bool sendSpreadsheet()
try to send the main spreadsheet
Definition BeagleWksSSParser.cxx:1507
BeagleWksSSParser::readChart
bool readChart()
read a chart
Definition BeagleWksSSParser.cxx:670
BeagleWksSSParser::readRowSheet
bool readRowSheet(BeagleWksSSParserInternal::Spreadsheet &sheet)
read the spreadsheet row
Definition BeagleWksSSParser.cxx:975
BeagleWksSSParser::readChartZone
bool readChartZone()
read the chart zone
Definition BeagleWksSSParser.cxx:636
BeagleWksSSParser::parse
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final
virtual function used to parse the input
Definition BeagleWksSSParser.cxx:381
BeagleWksSSParser::~BeagleWksSSParser
~BeagleWksSSParser() final
destructor
Definition BeagleWksSSParser.cxx:327
BeagleWksSSParser::m_structureManager
std::shared_ptr< BeagleWksStructManager > m_structureManager
the structure manager
Definition BeagleWksSSParser.hxx:158
BeagleWksSSParser::newPage
void newPage(int number)
adds a new page
Definition BeagleWksSSParser.cxx:365
BeagleWksSSParser::init
void init()
inits all internal variables
Definition BeagleWksSSParser.cxx:331
BeagleWksSSParser::m_state
std::shared_ptr< BeagleWksSSParserInternal::State > m_state
the state
Definition BeagleWksSSParser.hxx:155
BeagleWksSSParser::readZone0
bool readZone0()
read an unknown zone ( which appears before and after the columns's width zone )
Definition BeagleWksSSParser.cxx:1305
BeagleWksSSParser::BeagleWksSSParser
BeagleWksSSParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition BeagleWksSSParser.cxx:319
BeagleWksSSParser::createDocument
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface)
creates the listener which will be associated to the document
Definition BeagleWksSSParser.cxx:410
BeagleWksSSParser::sendFrame
bool sendFrame(BeagleWksStructManager::Frame const &frame)
try to send a frame
Definition BeagleWksSSParser.cxx:1431
BeagleWksStructManager
the main class to read the structure shared between different BeagleWorks files
Definition BeagleWksStructManager.hxx:58
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWGraphicStyle
a structure used to define a picture style
Definition MWAWGraphicStyle.hxx:48
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition MWAWHeader.hxx:57
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition MWAWPosition.hxx:48
MWAWSpreadsheetParser::MWAWSpreadsheetParser
MWAWSpreadsheetParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:291
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition libmwaw_internal.hxx:561
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition libmwaw_internal.hxx:842
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
BeagleWksSSParserInternal
Internal: the structures of a BeagleWksSSParser.
Definition BeagleWksSSParser.cxx:61
libmwaw
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition libmwaw_internal.cxx:51
librevenge
Definition MWAWDocument.hxx:57
BeagleWksSSParserInternal::Cell
Internal: the cell of a BeagleWksSSParser.
Definition BeagleWksSSParser.cxx:63
BeagleWksSSParserInternal::Chart
Internal: the chart of a BeagleWksSSParser.
Definition BeagleWksSSParser.cxx:173
BeagleWksSSParserInternal::Spreadsheet
Internal: the spreadsheet of a BeagleWksSSParser.
Definition BeagleWksSSParser.cxx:89
BeagleWksSSParserInternal::State
Internal: the state of a BeagleWksSSParser.
Definition BeagleWksSSParser.cxx:206