CanvasGraph.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 Canvas text document ( graphic part )
*
*/
#ifndef CANVAS_GRAPH
# define CANVAS_GRAPH
#include <string>
#include <vector>
#include <librevenge/librevenge.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWGraphicStyle.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWPosition.hxx"
namespace CanvasGraphInternal
{
struct LocalTransform;
struct Shape;
struct State;
class SubDocument;
}
class CanvasParser;
class CanvasStyleManager;
class CanvasGraph
{
friend class CanvasGraphInternal::SubDocument;
friend class CanvasParser;
public:
explicit CanvasGraph(CanvasParser &parser);
virtual ~CanvasGraph();
int version() const;
protected:
void setInput(MWAWInputStreamPtr &input);
MWAWInputStreamPtr &getInput();
// interface with main parser
bool sendShape(int id);
//
// Intermediate level
//
bool readShapes(int numShapes, unsigned long shapeLength, unsigned long dataLength);
bool readShape(int n, std::vector<MWAWEntry> const &dataZonesList);
bool readShapeData(CanvasGraphInternal::Shape &shape);
bool getBitmapBW(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj);
bool getBitmap(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj);
bool readFileBitmap(long length);
bool getPicture(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj);
//
// send data to the listener
//
void update(CanvasGraphInternal::Shape const &shape, MWAWGraphicStyle &style) const;
bool send(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const *local=nullptr, int depth=0);
bool sendDimension(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local);
bool sendMultiLines(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local);
bool sendSpecial(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local);
bool sendText(CanvasGraphInternal::Shape const &shape);
bool sendText(int zId);
//
// Low level
//
void markSent(int id);
void checkUnsent() const;
private:
CanvasGraph(CanvasGraph const &orig) = delete;
CanvasGraph &operator=(CanvasGraph const &orig) = delete;
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
std::shared_ptr<CanvasGraphInternal::State> m_state;
CanvasParser *m_mainParser;
std::shared_ptr<CanvasStyleManager> m_styleManager;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWGraphicStyle.hxx
MWAWInputStream.hxx
MWAWPosition.hxx
CanvasGraphInternal::SubDocument
Internal: the subdocument of a CanvasGraph.
Definition CanvasGraph.cxx:376
CanvasGraph::getBitmapBW
bool getBitmapBW(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj)
tries to read a bitmap stored in the rectangle's data
Definition CanvasGraph.cxx:1236
CanvasGraph::readShapeData
bool readShapeData(CanvasGraphInternal::Shape &shape)
try to read the shapes data
Definition CanvasGraph.cxx:734
CanvasGraph::getBitmap
bool getBitmap(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj)
tries to read the color bitmap stored in 55's shape: v3.5
Definition CanvasGraph.cxx:1073
CanvasGraph::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition CanvasGraph.hxx:152
CanvasGraph::checkUnsent
void checkUnsent() const
look for unsent shapes in debug mode
Definition CanvasGraph.cxx:1498
CanvasGraph::CanvasGraph
CanvasGraph(CanvasGraph const &orig)=delete
CanvasGraph::sendSpecial
bool sendSpecial(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local)
tries to send the special content
Definition CanvasGraph.cxx:2564
CanvasGraph::update
void update(CanvasGraphInternal::Shape const &shape, MWAWGraphicStyle &style) const
updates the style corresponding to a shape
Definition CanvasGraph.cxx:1520
CanvasGraph::getInput
MWAWInputStreamPtr & getInput()
returns the current input
Definition CanvasGraph.cxx:475
CanvasGraph::CanvasGraph
CanvasGraph(CanvasParser &parser)
constructor
Definition CanvasGraph.cxx:453
CanvasGraph::~CanvasGraph
virtual ~CanvasGraph()
destructor
Definition CanvasGraph.cxx:461
CanvasGraph::m_state
std::shared_ptr< CanvasGraphInternal::State > m_state
the state
Definition CanvasGraph.hxx:155
CanvasGraph::operator=
CanvasGraph & operator=(CanvasGraph const &orig)=delete
CanvasGraph::version
int version() const
returns the file version
Definition CanvasGraph.cxx:465
CanvasGraph::getPicture
bool getPicture(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj)
tries to read a picture stored in the picture's data
Definition CanvasGraph.cxx:1436
CanvasGraph::markSent
void markSent(int id)
mark the id's shape as read in debug mode
Definition CanvasGraph.cxx:1480
CanvasGraph::m_styleManager
std::shared_ptr< CanvasStyleManager > m_styleManager
the style manager
Definition CanvasGraph.hxx:160
CanvasGraph::m_mainParser
CanvasParser * m_mainParser
the main parser;
Definition CanvasGraph.hxx:158
CanvasGraph::readShape
bool readShape(int n, std::vector< MWAWEntry > const &dataZonesList)
try to read a shape: to do
Definition CanvasGraph.cxx:592
CanvasGraph::readShapes
bool readShapes(int numShapes, unsigned long shapeLength, unsigned long dataLength)
try to read the shapes: in fact, the compression header + the list of shapes
Definition CanvasGraph.cxx:500
CanvasGraph::sendMultiLines
bool sendMultiLines(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local)
tries the multiligne's special shape: Palm
Definition CanvasGraph.cxx:2246
CanvasGraph::send
bool send(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const *local=nullptr, int depth=0)
tries to send a shape
Definition CanvasGraph.cxx:1599
CanvasGraph::sendText
bool sendText(CanvasGraphInternal::Shape const &shape)
tries to send the text of a text's shape
Definition CanvasGraph.cxx:2786
CanvasGraph::CanvasParser
friend class CanvasParser
Definition CanvasGraph.hxx:73
CanvasGraph::sendDimension
bool sendDimension(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local)
tries the dimension line's special shape: DIMN
Definition CanvasGraph.cxx:1914
CanvasGraph::readFileBitmap
bool readFileBitmap(long length)
tries to read the file bitmap: windows v3.5
Definition CanvasGraph.cxx:1341
CanvasGraph::setInput
void setInput(MWAWInputStreamPtr &input)
store the actual input
Definition CanvasGraph.cxx:470
CanvasGraph::sendShape
bool sendShape(int id)
tries to send a shape with id
Definition CanvasGraph.cxx:480
CanvasParser
the main class to read a Canvas 2 and 3 files
Definition CanvasParser.hxx:62
CanvasStyleManager
the main class to read the style part of Canvas file
Definition CanvasStyleManager.hxx:67
MWAWGraphicStyle
a structure used to define a picture style
Definition MWAWGraphicStyle.hxx:48
libmwaw_internal.hxx
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
CanvasGraphInternal
Internal: the structures of a CanvasGraph.
Definition CanvasGraph.cxx:66
CanvasGraphInternal::LocalTransform
Internal: the local state of a CanvasGraph.
Definition CanvasGraph.cxx:288
CanvasGraphInternal::Shape
Internal: the shape of a CanvasGraph.
Definition CanvasGraph.cxx:71
CanvasGraphInternal::State
Internal: the state of a CanvasGraph.
Definition CanvasGraph.cxx:354
MWAWEmbeddedObject
small class use to define a embedded object
Definition libmwaw_internal.hxx:467