Blame src/lib/LightWayTxtGraph.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
/*
rpm-build 6f7582
 * Parser to LightWay Text document ( graphic part )
rpm-build 6f7582
 *
rpm-build 6f7582
 */
rpm-build 6f7582
#ifndef LIGHT_WAY_TXT_GRAPH
rpm-build 6f7582
#  define LIGHT_WAY_TXT_GRAPH
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 "libmwaw_internal.hxx"
rpm-build 6f7582
rpm-build 6f7582
#include "MWAWDebug.hxx"
rpm-build 6f7582
#include "MWAWInputStream.hxx"
rpm-build 6f7582
rpm-build 6f7582
namespace LightWayTxtGraphInternal
rpm-build 6f7582
{
rpm-build 6f7582
struct State;
rpm-build 6f7582
}
rpm-build 6f7582
rpm-build 6f7582
class LightWayTxtParser;
rpm-build 6f7582
rpm-build 6f7582
/** \brief the main class to read the graphic part of a LightWay Text file
rpm-build 6f7582
 *
rpm-build 6f7582
 *
rpm-build 6f7582
 *
rpm-build 6f7582
 */
rpm-build 6f7582
class LightWayTxtGraph
rpm-build 6f7582
{
rpm-build 6f7582
  friend class LightWayTxtParser;
rpm-build 6f7582
rpm-build 6f7582
public:
rpm-build 6f7582
  //! constructor
rpm-build 6f7582
  explicit LightWayTxtGraph(LightWayTxtParser &parser);
rpm-build 6f7582
  //! destructor
rpm-build 6f7582
  virtual ~LightWayTxtGraph();
rpm-build 6f7582
rpm-build 6f7582
  /** returns the file version */
rpm-build 6f7582
  int version() const;
rpm-build 6f7582
rpm-build 6f7582
  /** returns the number of pages */
rpm-build 6f7582
  int numPages() const;
rpm-build 6f7582
rpm-build 6f7582
protected:
rpm-build 6f7582
  //! finds the different graphic zones
rpm-build 6f7582
  bool createZones();
rpm-build 6f7582
rpm-build 6f7582
  //! sends the data which have not yet been sent to the listener
rpm-build 6f7582
  void flushExtra();
rpm-build 6f7582
rpm-build 6f7582
  //! try to send the page graphic
rpm-build 6f7582
  bool sendPageGraphics();
rpm-build 6f7582
rpm-build 6f7582
  //! try to send a graph
rpm-build 6f7582
  void send(int id);
rpm-build 6f7582
rpm-build 6f7582
  //
rpm-build 6f7582
  // Intermediate level
rpm-build 6f7582
  //
rpm-build 6f7582
rpm-build 6f7582
  //! try to send a JPEG resource
rpm-build 6f7582
  bool sendJPEG(MWAWEntry const &entry);
rpm-build 6f7582
rpm-build 6f7582
  //! try to send a PICT resource
rpm-build 6f7582
  bool sendPICT(MWAWEntry const &entry);
rpm-build 6f7582
rpm-build 6f7582
  //
rpm-build 6f7582
  // low level
rpm-build 6f7582
  //
rpm-build 6f7582
rpm-build 6f7582
  //! try to find a JPEG size
rpm-build 6f7582
  static bool findJPEGSize(librevenge::RVNGBinaryData const &data, MWAWVec2i &sz);
rpm-build 6f7582
rpm-build 6f7582
private:
rpm-build 6f7582
  LightWayTxtGraph(LightWayTxtGraph const &orig) = delete;
rpm-build 6f7582
  LightWayTxtGraph &operator=(LightWayTxtGraph const &orig) = delete;
rpm-build 6f7582
rpm-build 6f7582
protected:
rpm-build 6f7582
  //
rpm-build 6f7582
  // data
rpm-build 6f7582
  //
rpm-build 6f7582
  //! the parser state
rpm-build 6f7582
  MWAWParserStatePtr m_parserState;
rpm-build 6f7582
rpm-build 6f7582
  //! the state
rpm-build 6f7582
  std::shared_ptr<LightWayTxtGraphInternal::State> m_state;
rpm-build 6f7582
rpm-build 6f7582
  //! the main parser;
rpm-build 6f7582
  LightWayTxtParser *m_mainParser;
rpm-build 6f7582
};
rpm-build 6f7582
#endif
rpm-build 6f7582
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: