CanvasGraph.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3/* libmwaw
4* Version: MPL 2.0 / LGPLv2+
5*
6* The contents of this file are subject to the Mozilla Public License Version
7* 2.0 (the "License"); you may not use this file except in compliance with
8* the License or as specified alternatively below. You may obtain a copy of
9* the License at http://www.mozilla.org/MPL/
10*
11* Software distributed under the License is distributed on an "AS IS" basis,
12* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13* for the specific language governing rights and limitations under the
14* License.
15*
16* Major Contributor(s):
17* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20* Copyright (C) 2006, 2007 Andrew Ziem
21* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22*
23*
24* All Rights Reserved.
25*
26* For minor contributions see the git repository.
27*
28* Alternatively, the contents of this file may be used under the terms of
29* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30* in which case the provisions of the LGPLv2+ are applicable
31* instead of those above.
32*/
33
34/*
35 * Parser to Canvas text document ( graphic part )
36 *
37 */
38#ifndef CANVAS_GRAPH
39# define CANVAS_GRAPH
40
41#include <string>
42#include <vector>
43
44#include <librevenge/librevenge.h>
45
46#include "libmwaw_internal.hxx"
47
48#include "MWAWDebug.hxx"
49#include "MWAWGraphicStyle.hxx"
50#include "MWAWInputStream.hxx"
51#include "MWAWPosition.hxx"
52
53namespace CanvasGraphInternal
54{
55struct LocalTransform;
56struct Shape;
57struct State;
58
59class SubDocument;
60}
61
62class CanvasParser;
64
71{
73 friend class CanvasParser;
74
75public:
77 explicit CanvasGraph(CanvasParser &parser);
79 virtual ~CanvasGraph();
80
82 int version() const;
83
84protected:
86 void setInput(MWAWInputStreamPtr &input);
89
90 // interface with main parser
91
93 bool sendShape(int id);
94
95 //
96 // Intermediate level
97 //
98
100 bool readShapes(int numShapes, unsigned long shapeLength, unsigned long dataLength);
102 bool readShape(int n, std::vector<MWAWEntry> const &dataZonesList);
105
111 bool readFileBitmap(long length);
114
115 //
116 // send data to the listener
117 //
118
120 void update(CanvasGraphInternal::Shape const &shape, MWAWGraphicStyle &style) const;
122 bool send(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const *local=nullptr);
130 bool sendText(CanvasGraphInternal::Shape const &shape);
132 bool sendText(int zId);
133
134 //
135 // Low level
136 //
137
139 void markSent(int id);
141 void checkUnsent() const;
142
143private:
144 CanvasGraph(CanvasGraph const &orig) = delete;
145 CanvasGraph &operator=(CanvasGraph const &orig) = delete;
146
147protected:
148 //
149 // data
150 //
153
155 std::shared_ptr<CanvasGraphInternal::State> m_state;
156
160 std::shared_ptr<CanvasStyleManager> m_styleManager;
161};
162#endif
163// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Internal: the subdocument of a CanvasGraph.
Definition: CanvasGraph.cxx:373
the main class to read the graphic part of Canvas file
Definition: CanvasGraph.hxx:71
bool getBitmapBW(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj)
tries to read a bitmap stored in the rectangle's data
Definition: CanvasGraph.cxx:1233
bool readShapeData(CanvasGraphInternal::Shape &shape)
try to read the shapes data
Definition: CanvasGraph.cxx:731
bool getBitmap(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj)
tries to read the color bitmap stored in 55's shape: v3.5
Definition: CanvasGraph.cxx:1070
MWAWParserStatePtr m_parserState
the parser state
Definition: CanvasGraph.hxx:152
void checkUnsent() const
look for unsent shapes in debug mode
Definition: CanvasGraph.cxx:1495
CanvasGraph(CanvasGraph const &orig)=delete
bool sendSpecial(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local)
tries to send the special content
Definition: CanvasGraph.cxx:2557
void update(CanvasGraphInternal::Shape const &shape, MWAWGraphicStyle &style) const
updates the style corresponding to a shape
Definition: CanvasGraph.cxx:1517
MWAWInputStreamPtr & getInput()
returns the current input
Definition: CanvasGraph.cxx:472
virtual ~CanvasGraph()
destructor
Definition: CanvasGraph.cxx:458
std::shared_ptr< CanvasGraphInternal::State > m_state
the state
Definition: CanvasGraph.hxx:155
CanvasGraph & operator=(CanvasGraph const &orig)=delete
int version() const
returns the file version
Definition: CanvasGraph.cxx:462
bool getPicture(CanvasGraphInternal::Shape const &shape, MWAWEmbeddedObject &obj)
tries to read a picture stored in the picture's data
Definition: CanvasGraph.cxx:1433
void markSent(int id)
mark the id's shape as read in debug mode
Definition: CanvasGraph.cxx:1477
std::shared_ptr< CanvasStyleManager > m_styleManager
the style manager
Definition: CanvasGraph.hxx:160
CanvasParser * m_mainParser
the main parser;
Definition: CanvasGraph.hxx:158
bool readShape(int n, std::vector< MWAWEntry > const &dataZonesList)
try to read a shape: to do
Definition: CanvasGraph.cxx:589
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:497
bool sendMultiLines(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local)
tries the multiligne's special shape: Palm
Definition: CanvasGraph.cxx:2239
bool sendText(CanvasGraphInternal::Shape const &shape)
tries to send the text of a text's shape
Definition: CanvasGraph.cxx:2779
bool sendDimension(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const &local)
tries the dimension line's special shape: DIMN
Definition: CanvasGraph.cxx:1907
bool readFileBitmap(long length)
tries to read the file bitmap: windows v3.5
Definition: CanvasGraph.cxx:1338
void setInput(MWAWInputStreamPtr &input)
store the actual input
Definition: CanvasGraph.cxx:467
bool send(CanvasGraphInternal::Shape const &shape, CanvasGraphInternal::LocalTransform const *local=nullptr)
tries to send a shape
Definition: CanvasGraph.cxx:1596
bool sendShape(int id)
tries to send a shape with id
Definition: CanvasGraph.cxx:477
the main class to read a Canvas 2 and 3 files
Definition: CanvasParser.hxx:62
the main class to read the style part of Canvas file
Definition: CanvasStyleManager.hxx:67
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:557
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
Internal: the structures of a CanvasGraph.
Definition: CanvasGraph.cxx:66
Internal: the local state of a CanvasGraph.
Definition: CanvasGraph.cxx:285
Internal: the shape of a CanvasGraph.
Definition: CanvasGraph.cxx:68
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467

Generated on Thu Jan 19 2023 00:00:00 for libmwaw by doxygen 1.9.6