Blame src/lib/ActaParser.hxx

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 ACTA_PARSER
rpm-build 6f7582
#  define ACTA_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 "MWAWDebug.hxx"
rpm-build 6f7582
#include "MWAWInputStream.hxx"
rpm-build 6f7582
rpm-build 6f7582
#include "MWAWParser.hxx"
rpm-build 6f7582
rpm-build 6f7582
namespace ActaParserInternal
rpm-build 6f7582
{
rpm-build 6f7582
class SubDocument;
rpm-build 6f7582
struct State;
rpm-build 6f7582
}
rpm-build 6f7582
rpm-build 6f7582
class ActaText;
rpm-build 6f7582
rpm-build 6f7582
/** \brief the main class to read a Acta file
rpm-build 6f7582
 */
rpm-build 6f7582
class ActaParser final : public MWAWTextParser
rpm-build 6f7582
{
rpm-build 6f7582
  friend class ActaParserInternal::SubDocument;
rpm-build 6f7582
  friend class ActaText;
rpm-build 6f7582
public:
rpm-build 6f7582
  //! constructor
rpm-build 6f7582
  ActaParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
rpm-build 6f7582
  //! destructor
rpm-build 6f7582
  ~ActaParser() 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::RVNGTextInterface *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::RVNGTextInterface *documentInterface);
rpm-build 6f7582
rpm-build 6f7582
  //! returns the page left top point ( in inches)
rpm-build 6f7582
  MWAWVec2f getPageLeftTop() const;
rpm-build 6f7582
  //! adds a new page
rpm-build 6f7582
  void newPage(int number);
rpm-build 6f7582
rpm-build 6f7582
  // interface with the text parser
rpm-build 6f7582
rpm-build 6f7582
  //! returns a list to be used in the text
rpm-build 6f7582
  std::shared_ptr<MWAWList> getMainList();
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
  //! read the resource fork zone
rpm-build 6f7582
  bool readRSRCZones();
rpm-build 6f7582
rpm-build 6f7582
  //! read the end file data zones
rpm-build 6f7582
  bool readEndDataV3();
rpm-build 6f7582
rpm-build 6f7582
  //! sends the header/footer data
rpm-build 6f7582
  void sendHeaderFooter();
rpm-build 6f7582
rpm-build 6f7582
  //! read a PrintInfo block ( PSET resource block )
rpm-build 6f7582
  bool readPrintInfo(MWAWEntry const &entry);
rpm-build 6f7582
rpm-build 6f7582
  //! read the window position ( WSIZ resource block )
rpm-build 6f7582
  bool readWindowPos(MWAWEntry const &entry);
rpm-build 6f7582
rpm-build 6f7582
  //! read the label type
rpm-build 6f7582
  bool readLabel(MWAWEntry const &entry);
rpm-build 6f7582
rpm-build 6f7582
  //! read the Header/Footer property (QHDR block)
rpm-build 6f7582
  bool readHFProperties(MWAWEntry const &entry);
rpm-build 6f7582
rpm-build 6f7582
  //! read the QOPT resource block (small print change )
rpm-build 6f7582
  bool readOption(MWAWEntry const &entry);
rpm-build 6f7582
rpm-build 6f7582
  //
rpm-build 6f7582
  // low level
rpm-build 6f7582
  //
rpm-build 6f7582
rpm-build 6f7582
  //! return the input input
rpm-build 6f7582
  MWAWInputStreamPtr rsrcInput();
rpm-build 6f7582
rpm-build 6f7582
  //! a DebugFile used to write what we recognize when we parse the document in rsrc
rpm-build 6f7582
  libmwaw::DebugFile &rsrcAscii();
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<ActaParserInternal::State> m_state;
rpm-build 6f7582
rpm-build 6f7582
  //! the text parser
rpm-build 6f7582
  std::shared_ptr<ActaText> m_textParser;
rpm-build 6f7582
};
rpm-build 6f7582
#endif
rpm-build 6f7582
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: