GWGraph.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 GreatWorks text document ( graphic part )
*
*/
#ifndef GW_GRAPH
# define GW_GRAPH
#include <set>
#include <string>
#include <vector>
#include <libwpd/libwpd.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
namespace GWGraphInternal
{
struct Frame;
struct FrameBasic;
struct Style;
struct Zone;
struct State;
class SubDocument;
}
class GWParser;
class GWGraph
{
friend class GWParser;
friend class GWGraphInternal::SubDocument;
public:
GWGraph(GWParser &parser);
virtual ~GWGraph();
int version() const;
int numPages() const;
protected:
bool sendPageGraphics();
void flushExtra();
//
// Intermediate level
//
// RSRC
bool readPatterns(MWAWEntry const &entry);
bool readPalettes(MWAWEntry const &entry);
// DataFork: pict
bool sendPageFrames(GWGraphInternal::Zone const &zone);
bool sendFrame(shared_ptr<GWGraphInternal::Frame> frame, GWGraphInternal::Zone const &zone, int order);
bool sendTextbox(MWAWEntry const &entry);
bool sendPicture(MWAWEntry const &entry, MWAWPosition pos);
bool sendBasic(GWGraphInternal::FrameBasic const &graph, GWGraphInternal::Zone const &zone, MWAWPosition pos);
// DataFork: graphic zone
bool readGraphicZone();
bool isGraphicZone();
bool findGraphicZone();
bool isPageFrames();
bool readPageFrames();
shared_ptr<GWGraphInternal::Frame> readFrameHeader();
bool readStyle(GWGraphInternal::Style &style);
bool readLineFormat(std::string &extra);
// interface with mainParser
//
// low level
//
static void buildFrameDataReadOrderFromTree
(std::vector<std::vector<int> > const &tree, int id, std::vector<int> &order, std::set<int> &seen);
private:
GWGraph(GWGraph const &orig);
GWGraph &operator=(GWGraph const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<GWGraphInternal::State> m_state;
GWParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
GWGraph::readPatterns
bool readPatterns(MWAWEntry const &entry)
read a pattern list block ( PAT# resource block )
Definition: GWGraph.cxx:664
libmwaw_internal.hxx
GWGraph::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: GWGraph.cxx:1866
GWGraph::readPageFrames
bool readPageFrames()
try to read a list of page frame ( picture, texture or basic )
Definition: GWGraph.cxx:1194
GWGraph::numPages
int numPages() const
returns the number of pages
Definition: GWGraph.cxx:636
GWGraph::sendPicture
bool sendPicture(MWAWEntry const &entry, MWAWPosition pos)
try to send a picture
Definition: GWGraph.cxx:1679
GWGraph::version
int version() const
returns the file version
Definition: GWGraph.cxx:630
GWGraphInternal::Zone
Internal: a list of graphic corresponding to a page.
Definition: GWGraph.cxx:538
GWGraph::isPageFrames
bool isPageFrames()
check if a zone is or not a page frame zone
Definition: GWGraph.cxx:944
GWGraphInternal::SubDocument
Internal: the subdocument of a GWGraph.
Definition: GWGraph.cxx:565
GWGraph::buildFrameDataReadOrderFromTree
static void buildFrameDataReadOrderFromTree(std::vector< std::vector< int > > const &tree, int id, std::vector< int > &order, std::set< int > &seen)
reconstruct the order to used for reading the frame data
Definition: GWGraph.cxx:1727
GWGraph::~GWGraph
virtual ~GWGraph()
destructor
Definition: GWGraph.cxx:627
GWGraph::sendBasic
bool sendBasic(GWGraphInternal::FrameBasic const &graph, GWGraphInternal::Zone const &zone, MWAWPosition pos)
try to send a basic picture
Definition: GWGraph.cxx:1757
GWGraph::m_mainParser
GWParser * m_mainParser
the main parser;
Definition: GWGraph.hxx:159
GWGraph::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: GWGraph.hxx:153
GWGraph::findGraphicZone
bool findGraphicZone()
try to find the beginning of the next graphic zone
Definition: GWGraph.cxx:874
GWGraph
the main class to read the graphic part of a HanMac Word-J file
Definition: GWGraph.hxx:70
GWGraph::isGraphicZone
bool isGraphicZone()
return true if this corresponds to a graphic zone
Definition: GWGraph.cxx:759
GWGraphInternal::FrameBasic
Internal: the basic graphic of a GWGraph.
Definition: GWGraph.cxx:284
GWGraph::readFrameHeader
shared_ptr< GWGraphInternal::Frame > readFrameHeader()
try to read a basic frame header
Definition: GWGraph.cxx:1575
GWGraph::operator=
GWGraph & operator=(GWGraph const &orig)
MWAWInputStream.hxx
MWAWDebug.hxx
GWGraph::readPalettes
bool readPalettes(MWAWEntry const &entry)
read a list of color and maybe patterns ( PlTT resource block: v2 )
Definition: GWGraph.cxx:703
GWGraph::sendTextbox
bool sendTextbox(MWAWEntry const &entry)
try to send the textbox text
Definition: GWGraph.cxx:650
GWGraphInternal::Style
Internal: the graphic style of a GWGraph.
Definition: GWGraph.cxx:60
GWGraph::sendPageGraphics
bool sendPageGraphics()
try to send the page graphic
Definition: GWGraph.cxx:1851
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
GWParser
the main class to read a GreatWorks text file
Definition: GWParser.hxx:57
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
GWGraph::readGraphicZone
bool readGraphicZone()
try to read the graphic zone ( draw file or end of v2 text file)
Definition: GWGraph.cxx:797
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
GWGraph::readLineFormat
bool readLineFormat(std::string &extra)
try to read a line format style? in v1
Definition: GWGraph.cxx:1172
GWGraph::readStyle
bool readStyle(GWGraphInternal::Style &style)
try to read a zone style
Definition: GWGraph.cxx:1002
GWGraph::sendPageFrames
bool sendPageFrames(GWGraphInternal::Zone const &zone)
try to send all data corresponding to a zone
Definition: GWGraph.cxx:1830
GWGraph::GWGraph
GWGraph(GWParser &parser)
constructor
Definition: GWGraph.cxx:621
GWGraph::m_state
shared_ptr< GWGraphInternal::State > m_state
the state
Definition: GWGraph.hxx:156
GWGraph::sendFrame
bool sendFrame(shared_ptr< GWGraphInternal::Frame > frame, GWGraphInternal::Zone const &zone, int order)
try to send a frame
Definition: GWGraph.cxx:1782