|
rpm-build |
6f7582 |
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
/* libmwaw
|
|
rpm-build |
6f7582 |
* Version: MPL 2.0 / LGPLv2+
|
|
rpm-build |
6f7582 |
*
|
|
rpm-build |
6f7582 |
* The contents of this file are subject to the Mozilla Public License Version
|
|
rpm-build |
6f7582 |
* 2.0 (the "License"); you may not use this file except in compliance with
|
|
rpm-build |
6f7582 |
* the License or as specified alternatively below. You may obtain a copy of
|
|
rpm-build |
6f7582 |
* the License at http://www.mozilla.org/MPL/
|
|
rpm-build |
6f7582 |
*
|
|
rpm-build |
6f7582 |
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
rpm-build |
6f7582 |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
rpm-build |
6f7582 |
* for the specific language governing rights and limitations under the
|
|
rpm-build |
6f7582 |
* License.
|
|
rpm-build |
6f7582 |
*
|
|
rpm-build |
6f7582 |
* Major Contributor(s):
|
|
rpm-build |
6f7582 |
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
|
|
rpm-build |
6f7582 |
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
|
|
rpm-build |
6f7582 |
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
|
|
rpm-build |
6f7582 |
* Copyright (C) 2006, 2007 Andrew Ziem
|
|
rpm-build |
6f7582 |
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
|
|
rpm-build |
6f7582 |
*
|
|
rpm-build |
6f7582 |
*
|
|
rpm-build |
6f7582 |
* All Rights Reserved.
|
|
rpm-build |
6f7582 |
*
|
|
rpm-build |
6f7582 |
* For minor contributions see the git repository.
|
|
rpm-build |
6f7582 |
*
|
|
rpm-build |
6f7582 |
* Alternatively, the contents of this file may be used under the terms of
|
|
rpm-build |
6f7582 |
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
|
|
rpm-build |
6f7582 |
* in which case the provisions of the LGPLv2+ are applicable
|
|
rpm-build |
6f7582 |
* instead of those above.
|
|
rpm-build |
6f7582 |
*/
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
#ifndef GREAT_WKS_SS_PARSER
|
|
rpm-build |
6f7582 |
# define GREAT_WKS_SS_PARSER
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
#include <string>
|
|
rpm-build |
6f7582 |
#include <vector>
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
#include <librevenge/librevenge.h>
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
#include "MWAWCell.hxx"
|
|
rpm-build |
6f7582 |
#include "MWAWDebug.hxx"
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
#include "MWAWParser.hxx"
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
namespace GreatWksSSParserInternal
|
|
rpm-build |
6f7582 |
{
|
|
rpm-build |
6f7582 |
class Cell;
|
|
rpm-build |
6f7582 |
struct State;
|
|
rpm-build |
6f7582 |
class SubDocument;
|
|
rpm-build |
6f7582 |
}
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
class GreatWksDocument;
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
/** \brief the main class to read a GreatWorks spreadsheet file
|
|
rpm-build |
6f7582 |
*/
|
|
rpm-build |
6f7582 |
class GreatWksSSParser final : public MWAWSpreadsheetParser
|
|
rpm-build |
6f7582 |
{
|
|
rpm-build |
6f7582 |
friend class GreatWksSSParserInternal::SubDocument;
|
|
rpm-build |
6f7582 |
public:
|
|
rpm-build |
6f7582 |
//! constructor
|
|
rpm-build |
6f7582 |
GreatWksSSParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
|
|
rpm-build |
6f7582 |
//! destructor
|
|
rpm-build |
6f7582 |
~GreatWksSSParser() final;
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//! checks if the document header is correct (or not)
|
|
rpm-build |
6f7582 |
bool checkHeader(MWAWHeader *header, bool strict=false) final;
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
// the main parse function
|
|
rpm-build |
6f7582 |
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final;
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
protected:
|
|
rpm-build |
6f7582 |
//! inits all internal variables
|
|
rpm-build |
6f7582 |
void init();
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//! creates the listener which will be associated to the document
|
|
rpm-build |
6f7582 |
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface);
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//! try to send the main spreadsheet
|
|
rpm-build |
6f7582 |
bool sendSpreadsheet();
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
// interface with the text parser
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//! try to send the i^th header/footer
|
|
rpm-build |
6f7582 |
bool sendHF(int id);
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
protected:
|
|
rpm-build |
6f7582 |
//! finds the different objects zones
|
|
rpm-build |
6f7582 |
bool createZones();
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//
|
|
rpm-build |
6f7582 |
// low level
|
|
rpm-build |
6f7582 |
//
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//! try to read the styles
|
|
rpm-build |
6f7582 |
bool readStyles();
|
|
rpm-build |
6f7582 |
//! read the spreadsheet block ( many unknown data )
|
|
rpm-build |
6f7582 |
bool readSpreadsheet();
|
|
rpm-build |
6f7582 |
//! try to read the chart zone: v2
|
|
rpm-build |
6f7582 |
bool readChart();
|
|
rpm-build |
6f7582 |
//! try to read a cell
|
|
rpm-build |
6f7582 |
bool readCell(GreatWksSSParserInternal::Cell &cell);
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//
|
|
rpm-build |
6f7582 |
// data
|
|
rpm-build |
6f7582 |
//
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//! the state
|
|
rpm-build |
6f7582 |
std::shared_ptr<GreatWksSSParserInternal::State> m_state;
|
|
rpm-build |
6f7582 |
|
|
rpm-build |
6f7582 |
//! the document
|
|
rpm-build |
6f7582 |
std::shared_ptr<GreatWksDocument> m_document;
|
|
rpm-build |
6f7582 |
};
|
|
rpm-build |
6f7582 |
#endif
|
|
rpm-build |
6f7582 |
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
|