MRWGraph.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* 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 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
/*
* Parser to Mariner Write text document ( graphic part )
*
*/
#ifndef MRW_GRAPH
# define MRW_GRAPH
#include <string>
#include <vector>
#include <libwpd/libwpd.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
namespace MRWGraphInternal
{
struct State;
struct PSZone;
struct Token;
class SubDocument;
}
struct MRWEntry;
struct MRWStruct;
class MRWParser;
class MRWGraph
{
friend class MRWParser;
friend class MRWGraphInternal::SubDocument;
public:
MRWGraph(MRWParser &parser);
virtual ~MRWGraph();
int version() const;
int numPages() const;
protected:
bool sendPageGraphics();
void flushExtra();
float getPatternPercent(int id) const;
//
// Intermediate level
//
bool readPostscript(MRWEntry const &entry, int zoneId);
bool readToken(MRWEntry const &entry, int zoneId);
bool readTokenBlock0(MRWStruct const &data, MRWGraphInternal::Token &tkn, std::string &res);
void sendPicture(MRWGraphInternal::Token const &tkn);
void sendRule(MRWGraphInternal::Token const &tkn, MWAWFont const &actFont);
void sendPSZone(MRWGraphInternal::PSZone const &ps, MWAWPosition const &pos);
// interface with mainParser
void sendToken(int zoneId, long tokenId, MWAWFont const &actFont);
void sendText(int zoneId);
private:
MRWGraph(MRWGraph const &orig);
MRWGraph &operator=(MRWGraph const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<MRWGraphInternal::State> m_state;
MRWParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MRWGraph::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: MRWGraph.cxx:975
MRWGraph::version
int version() const
returns the file version
Definition: MRWGraph.cxx:352
MRWParser
the main class to read a Mariner Write file
Definition: MRWParser.hxx:121
MRWGraphInternal::Token
Internal: the struct use to store a token entry.
Definition: MRWGraph.cxx:61
MRWGraph::sendText
void sendText(int zoneId)
ask the main parser to send a text zone
Definition: MRWGraph.cxx:378
MRWGraph::numPages
int numPages() const
returns the number of pages
Definition: MRWGraph.cxx:357
libmwaw_internal.hxx
MRWGraph::MRWGraph
MRWGraph(MRWParser &parser)
constructor
Definition: MRWGraph.cxx:343
MRWGraph::m_state
shared_ptr< MRWGraphInternal::State > m_state
the state
Definition: MRWGraph.hxx:130
MRWGraph::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: MRWGraph.hxx:127
MRWGraph::readTokenBlock0
bool readTokenBlock0(MRWStruct const &data, MRWGraphInternal::Token &tkn, std::string &res)
try to read the first token zone ( which can contains some field text )
Definition: MRWGraph.cxx:794
MRWGraph::operator=
MRWGraph & operator=(MRWGraph const &orig)
MRWGraph::sendToken
void sendToken(int zoneId, long tokenId, MWAWFont const &actFont)
try to send a token
Definition: MRWGraph.cxx:384
MRWGraph
the main class to read the graphic part of a Mariner Write file
Definition: MRWGraph.hxx:68
MRWGraph::sendRule
void sendRule(MRWGraphInternal::Token const &tkn, MWAWFont const &actFont)
try to send a rule
Definition: MRWGraph.cxx:476
MRWGraph::sendPicture
void sendPicture(MRWGraphInternal::Token const &tkn)
try to send a picture token as char
Definition: MRWGraph.cxx:529
MRWGraph::sendPageGraphics
bool sendPageGraphics()
try to send the page graphic
Definition: MRWGraph.cxx:970
MRWEntry
a entry to store a zone structure
Definition: MRWParser.hxx:64
MWAWInputStream.hxx
MWAWDebug.hxx
MRWGraph::sendPSZone
void sendPSZone(MRWGraphInternal::PSZone const &ps, MWAWPosition const &pos)
try to send a ps picture as pos
Definition: MRWGraph.cxx:562
MRWGraph::readToken
bool readToken(MRWEntry const &entry, int zoneId)
try to read a token zone (can be a picture or a field)
Definition: MRWGraph.cxx:599
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
MRWGraph::m_mainParser
MRWParser * m_mainParser
the main parser;
Definition: MRWGraph.hxx:133
MRWGraph::getPatternPercent
float getPatternPercent(int id) const
return the pattern percent which corresponds to an id (or -1)
Definition: MRWGraph.cxx:366
MRWGraphInternal::PSZone
Internal: the struct use to store a ps zone of a MRWGraph.
Definition: MRWGraph.cxx:208
MRWStruct
Internal: a struct used to read some field.
Definition: MRWParser.hxx:90
MRWGraphInternal::SubDocument
Internal: the subdocument of a MRWGraph.
Definition: MRWGraph.cxx:285
MRWGraph::~MRWGraph
virtual ~MRWGraph()
destructor
Definition: MRWGraph.cxx:349
MRWGraph::readPostscript
bool readPostscript(MRWEntry const &entry, int zoneId)
try to read a postscript zone
Definition: MRWGraph.cxx:896