WPS8.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 WPS8_H
#define WPS8_H
#include <vector>
#include <libwpd/libwpd.h>
#include "libwps_internal.h"
#include "WPSParser.h"
class WPXString;
class WPSContentListener;
typedef WPSContentListener WPS8ContentListener;
class WPSEntry;
class WPSPosition;
class WPSPageSpan;
namespace WPS8ParserInternal
{
class SubDocument;
struct State;
}
class WPS8Graph;
class WPS8Table;
class WPS8Text;
class WPS8Parser : public WPSParser
{
friend class WPS8ParserInternal::SubDocument;
friend class WPS8Graph;
friend class WPS8Table;
friend class WPS8Text;
public:
WPS8Parser(WPXInputStreamPtr &input, WPSHeaderPtr &header);
~WPS8Parser();
void parse(WPXDocumentInterface *documentInterface);
protected:
bool checkInFile(long pos);
void newPage(int number);
void setListener(shared_ptr<WPS8ContentListener> listener);
shared_ptr<WPS8ContentListener> createListener(WPXDocumentInterface *interface);
bool createStructures();
bool createOLEStructures();
float pageHeight() const;
float pageWidth() const;
int numColumns() const;
void sendPageFrames();
// interface with text parser
void sendTextBox(WPSPosition const &pos, int strsid,
WPXPropertyList frameExtras=WPXPropertyList());
void send(WPSEntry const &entry);
void send(int strsId);
void sendTextInCell(int strsId, int cellId);
// interface with table parser
bool sendTable(Vec2f const &size, int objectId);
int getTableSTRSId(int tableId) const;
// interface with graph parser
bool sendObject(Vec2f const &size, int objectId, bool ole);
//
// low level
//
bool parseHeaderIndexEntry();
bool parseHeaderIndexEntryEnd(long endPos, WPSEntry &hie,std::string &mess);
bool parseHeaderIndex();
bool readDocProperties(WPSEntry const &entry, WPSPageSpan &page);
bool readFRAM(WPSEntry const &entry);
bool readSYID(WPSEntry const &entry, std::vector<int> &listId);
bool readWNPR(WPSEntry const &entry);
bool readSPELLING(WPXInputStreamPtr input, std::string const &oleName);
shared_ptr<WPS8ContentListener> m_listener; /* the listener (if set)*/
shared_ptr<WPS8Graph> m_graphParser;
shared_ptr<WPS8Table> m_tableParser;
shared_ptr<WPS8Text> m_textParser;
shared_ptr<WPS8ParserInternal::State> m_state;
};
#endif /* WPS8_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */