ClarisWksGraph.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 Claris Works text document ( graphic part )
36 *
37 */
38#ifndef CLARIS_WKS_GRAPH
39# define CLARIS_WKS_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 "MWAWInputStream.hxx"
50#include "MWAWPosition.hxx"
51
52#include "ClarisWksStruct.hxx"
53
55{
56struct Group;
57struct State;
58struct Style;
59struct Zone;
60struct Chart;
61struct ZoneShape;
62struct Bitmap;
63struct ZonePict;
64
65class SubDocument;
66}
67
69class ClarisWksParser;
70class MWAWParser;
71
78{
80 friend class ClarisWksDocument;
81 friend class ClarisWksParser;
82
83public:
85 explicit ClarisWksGraph(ClarisWksDocument &document);
87 virtual ~ClarisWksGraph();
88
90 int version() const;
91
93 int numPages() const;
94
96 bool getPageDimension(MWAWVec2f &dim) const;
97
99 void computePositions() const;
100
102 void findMasterPage() const;
103
105 shared_ptr<ClarisWksStruct::DSET> readGroupZone
106 (ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete);
107
109 shared_ptr<ClarisWksStruct::DSET> readBitmapZone
110 (ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete);
111
113 bool getSurfaceColor(ClarisWksGraphInternal::Style const &style, MWAWColor &col) const;
114protected:
116 bool canSendGroupAsGraphic(int number) const;
118 bool sendPageGraphics(int groupId);
120 bool sendMaster(int pg);
122 bool sendGroup(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
124 bool canSendBitmapAsGraphic(int number) const;
126 bool sendBitmap(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
127
129 void flushExtra();
130
131 // interface with main parser
132
134 void askToSend(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
135
136 //
137 // Intermediate level
138 //
139
145 bool sendGroup(ClarisWksGraphInternal::Group &group, MWAWPosition const &position);
147 bool sendGroupChild(std::vector<shared_ptr<ClarisWksGraphInternal::Zone> > const &lChild, MWAWListenerPtr listener, MWAWVec2f const &leftTop);
149 bool sendGroupChild(shared_ptr<ClarisWksGraphInternal::Zone> zone, MWAWPosition position);
152 /* read a simple group */
153 shared_ptr<ClarisWksGraphInternal::Zone> readGroupDef(MWAWEntry const &entry);
154 /* read the group data.
155
156 \note \a beginGroupPos is only used to help debugging */
157 bool readGroupData(ClarisWksGraphInternal::Group &group, long beginGroupPos);
158
159 /* read a simple graphic zone */
160 bool readShape(MWAWEntry const &entry,
162
163 /* try to read the chart data */
164 bool readChartData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
165
166 /* try to read a pict data zone */
167 bool readPictData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
168
169 /* try to read the polygon data */
170 bool readPolygonData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
171
172 /* read a picture */
174
175 /* read a postcript zone */
177
178 /* read a ole document zone */
180
182 /* try to read the qtime data zone */
183 bool readQTimeData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
184
185 /* read a named picture */
187
189 /* try to read a bitmap zone */
190 bool readBitmapColorMap(std::vector<MWAWColor> &cMap);
191
192 /* try to read the bitmap */
194 //
195 // low level
196 //
197
198 /* read the first zone of a group type */
200
201 /* read some unknown data in first zone */
202 bool readGroupUnknown(ClarisWksGraphInternal::Group &group, int zoneSz, int id);
203
206
209
212
213private:
216
217protected:
218 //
219 // data
220 //
223
226
228 shared_ptr<ClarisWksGraphInternal::State> m_state;
229
232};
233#endif
234// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
main document information used to create a ClarisWorks file
Definition: ClarisWksDocument.hxx:74
Internal: the subdocument of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:736
the main class to read the graphic part of Claris Works file
Definition: ClarisWksGraph.hxx:78
bool sendPageGraphics(int groupId)
sends the page element
Definition: ClarisWksGraph.cxx:3248
shared_ptr< ClarisWksStruct::DSET > readGroupZone(ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete)
reads the zone Group DSET
Definition: ClarisWksGraph.cxx:864
bool readGroupUnknown(ClarisWksGraphInternal::Group &group, int zoneSz, int id)
Definition: ClarisWksGraph.cxx:1862
bool readGroupHeader(ClarisWksGraphInternal::Group &group)
Definition: ClarisWksGraph.cxx:1750
bool sendPicture(ClarisWksGraphInternal::ZonePict &pict, MWAWPosition pos)
sends a picture zone
Definition: ClarisWksGraph.cxx:3114
MWAWParser * m_mainParser
the main parser;
Definition: ClarisWksGraph.hxx:231
void computePositions() const
compute the pages position
Definition: ClarisWksGraph.cxx:809
bool canSendBitmapAsGraphic(int number) const
check if we can send a group as graphic
Definition: ClarisWksGraph.cxx:2989
bool readShape(MWAWEntry const &entry, ClarisWksGraphInternal::ZoneShape &zone)
Definition: ClarisWksGraph.cxx:1609
bool readPS(ClarisWksGraphInternal::ZonePict &zone)
Definition: ClarisWksGraph.cxx:2188
bool readPictData(shared_ptr< ClarisWksGraphInternal::Zone > zone)
Definition: ClarisWksGraph.cxx:2090
int numPages() const
returns the number of pages
Definition: ClarisWksGraph.cxx:821
bool sendBitmap(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition())
sends the bitmap data to the listener (if it exists )
Definition: ClarisWksGraph.cxx:3002
void updateGroup(ClarisWksGraphInternal::Group &group) const
update the group information to choose how to send the group data
Definition: ClarisWksGraph.cxx:2476
bool readPolygonData(shared_ptr< ClarisWksGraphInternal::Zone > zone)
Definition: ClarisWksGraph.cxx:1925
bool readPICT(ClarisWksGraphInternal::ZonePict &zone)
Definition: ClarisWksGraph.cxx:2153
ClarisWksGraph & operator=(ClarisWksGraph const &orig)
shared_ptr< ClarisWksStruct::DSET > readBitmapZone(ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete)
reads the zone Bitmap DSET
Definition: ClarisWksGraph.cxx:962
bool sendMaster(int pg)
sends the master zone (ie. the background zone in a graphic document)
Definition: ClarisWksGraph.cxx:3220
bool sendPageChild(ClarisWksGraphInternal::Group &group)
send the child element corresponding to some page
Definition: ClarisWksGraph.cxx:2602
bool sendGroupChild(std::vector< shared_ptr< ClarisWksGraphInternal::Zone > > const &lChild, MWAWListenerPtr listener, MWAWVec2f const &leftTop)
send a child group as graphic or as presentation
Definition: ClarisWksGraph.cxx:2540
bool readBitmapColorMap(std::vector< MWAWColor > &cMap)
Definition: ClarisWksGraph.cxx:2362
void findMasterPage() const
find the master zone to the content zones in a graphic document
Definition: ClarisWksGraph.cxx:1082
bool readQTimeData(shared_ptr< ClarisWksGraphInternal::Zone > zone)
Definition: ClarisWksGraph.cxx:2276
bool sendGroup(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition())
sends the zone data to the listener (if it exists )
Definition: ClarisWksGraph.cxx:3261
shared_ptr< ClarisWksGraphInternal::Zone > readGroupDef(MWAWEntry const &entry)
Definition: ClarisWksGraph.cxx:1127
ClarisWksGraph(ClarisWksGraph const &orig)
bool getPageDimension(MWAWVec2f &dim) const
returns the page dimension if known (in point)
Definition: ClarisWksGraph.cxx:838
bool readGroupData(ClarisWksGraphInternal::Group &group, long beginGroupPos)
Definition: ClarisWksGraph.cxx:1415
ClarisWksGraph(ClarisWksDocument &document)
constructor
Definition: ClarisWksGraph.cxx:795
void askToSend(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition())
ask the main parser to send a zone
Definition: ClarisWksGraph.cxx:844
bool getSurfaceColor(ClarisWksGraphInternal::Style const &style, MWAWColor &col) const
return the surface color which corresponds to some ids (if possible)
Definition: ClarisWksGraph.cxx:852
ClarisWksDocument & m_document
the document
Definition: ClarisWksGraph.hxx:222
virtual ~ClarisWksGraph()
destructor
Definition: ClarisWksGraph.cxx:801
int version() const
returns the file version
Definition: ClarisWksGraph.cxx:804
bool sendShape(ClarisWksGraphInternal::ZoneShape &pict, MWAWPosition pos)
sends a basic graphic zone
Definition: ClarisWksGraph.cxx:2973
bool readOLE(ClarisWksGraphInternal::ZonePict &zone)
Definition: ClarisWksGraph.cxx:2228
shared_ptr< ClarisWksGraphInternal::State > m_state
the state
Definition: ClarisWksGraph.hxx:228
bool readNamedPict(ClarisWksGraphInternal::ZonePict &zone)
Definition: ClarisWksGraph.cxx:2312
bool readBitmapData(ClarisWksGraphInternal::Bitmap &zone)
Definition: ClarisWksGraph.cxx:2409
bool canSendAsGraphic(ClarisWksGraphInternal::Group &group) const
check if we can send a group as graphic
Definition: ClarisWksGraph.cxx:3200
MWAWParserStatePtr m_parserState
the parser state
Definition: ClarisWksGraph.hxx:225
bool canSendGroupAsGraphic(int number) const
check if we can send a group as graphic
Definition: ClarisWksGraph.cxx:3191
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: ClarisWksGraph.cxx:3282
bool readChartData(shared_ptr< ClarisWksGraphInternal::Zone > zone)
Definition: ClarisWksGraph.cxx:2028
the main class to read a Claris Works file
Definition: ClarisWksParser.hxx:68
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
This class contains a virtual interface to all listener.
Definition: MWAWListener.hxx:50
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:100
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:505
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:509
Internal: the structures of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:69
Internal: structure to store a bitmap of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:399
Internal: class which stores a group of graphics, ...
Definition: ClarisWksGraph.cxx:652
Internal: the structure used to store a style of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:110
Internal: the structure used to store a PICT or a MOVIE.
Definition: ClarisWksGraph.cxx:324
Internal: small class to store a basic graphic zone of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:273
main structure which correspond to a document part
Definition: ClarisWksStruct.hxx:58
the class to store a color
Definition: libmwaw_internal.hxx:182

Generated on Wed Jan 19 2022 22:23:12 for libmwaw by doxygen 1.9.3