WPS4.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) 2006, 2007 Andrew Ziem
* Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
* Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
*
* 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.
*/
#ifndef WPS4_H
#define WPS4_H
#include <vector>
#include <libwpd-stream/WPXStream.h>
#include "libwps_internal.h"
#include "WPSParser.h"
class WPXString;
class WPSContentListener;
typedef WPSContentListener WPS4ContentListener;
class WPSEntry;
class WPSPosition;
class WPSPageSpan;
namespace WPS4ParserInternal
{
class SubDocument;
struct State;
}
class WPS4Graph;
class WPS4Text;
class WPS4Parser : public WPSParser
{
friend class WPS4ParserInternal::SubDocument;
friend class WPS4Graph;
friend class WPS4Text;
public:
WPS4Parser(WPXInputStreamPtr &input, WPSHeaderPtr &header);
~WPS4Parser();
void parse(WPXDocumentInterface *documentInterface);
protected:
bool getColor(int id, uint32_t &color) const;
long getSizeFile() const;
void setSizeFile(long sz);
bool checkInFile(long pos);
void newPage(int number);
void setListener(shared_ptr<WPS4ContentListener> listener);
bool createStructures();
bool createOLEStructures();
shared_ptr<WPS4ContentListener> createListener(WPXDocumentInterface *interface);
// interface with text parser
float pageHeight() const;
float pageWidth() const;
int numColumns() const;
void createDocument(WPSEntry const &entry, libwps::SubDocumentType type);
void createNote(WPSEntry const &entry, WPXString const &label);
void createTextBox(WPSEntry const &entry, WPSPosition const &pos, WPXPropertyList &extras);
void send(WPSEntry const &entry, libwps::SubDocumentType type);
// interface with graph parser
int readObject(WPXInputStreamPtr input, WPSEntry const &entry);
void sendObject(Vec2f const &size, int id);
//
// low level
//
bool findZones();
bool parseEntry(std::string const &name);
bool readDocDim();
bool readPrnt(WPSEntry const &entry);
bool readDocWindowsInfo(WPSEntry const &entry);
shared_ptr<WPS4ContentListener> m_listener; /* the listener (if set)*/
shared_ptr<WPS4Graph> m_graphParser;
shared_ptr<WPS4Text> m_textParser;
shared_ptr<WPS4ParserInternal::State> m_state;
};
#endif /* WPS4_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */