WPS8Graph.h
Go to the documentation of this file.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* libwps
* Version: MPL 2.0 / LGPLv2.1+
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Major Contributor(s):
* Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
*
* 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.1 or later
* (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
* applicable instead of those above.
*
* For further information visit http://libwps.sourceforge.net
*/
#ifndef WPS8_GRAPH
# define WPS8_GRAPH
#include <list>
#include <vector>
#include "libwps_internal.h"
#include "WPSDebug.h"
class WPXBinaryData;
class WPSEntry;
class WPS8Parser;
class WPSPosition;
typedef class WPSContentListener WPS8ContentListener;
typedef shared_ptr<WPS8ContentListener> WPS8ContentListenerPtr;
namespace WPS8GraphInternal
{
struct State;
}
class WPS8Graph
{
friend class WPS8Parser;
public:
WPS8Graph(WPS8Parser &parser);
~WPS8Graph();
void setListener(WPS8ContentListenerPtr &listen)
{
m_listener = listen;
}
void computePositions() const;
int numPages() const;
bool sendObject(WPSPosition const &pos, int id, bool ole);
bool sendIBGF(WPSPosition const &pos, int ibgfId);
void sendObjects(int page, int pageToIgnore=-2);
protected:
int version() const;
void sendBorder(int borderId);
void storeObjects(std::vector<WPXBinaryData> const &objects,
std::vector<int> const &ids,
std::vector<WPSPosition> const &positions);
bool readStructures(WPXInputStreamPtr input);
// low level
bool readPICT(WPXInputStreamPtr input, WPSEntry const &entry);
bool readIBGF(WPXInputStreamPtr input, WPSEntry const &entry);
bool readBDR(WPXInputStreamPtr input, WPSEntry const &entry);
bool readMetaFile(WPXInputStreamPtr input, long endPos, WPXBinaryData &pict);
libwps::DebugFile &ascii()
{
return m_asciiFile;
}
private:
WPS8Graph(WPS8Graph const &orig);
WPS8Graph &operator=(WPS8Graph const &orig);
protected:
WPS8ContentListenerPtr m_listener;
WPS8Parser &m_mainParser;
mutable shared_ptr<WPS8GraphInternal::State> m_state;
libwps::DebugFile &m_asciiFile;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */