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 
54 namespace ClarisWksGraphInternal
55 {
56 struct Group;
57 struct State;
58 struct Style;
59 struct Zone;
60 struct ZoneShape;
61 struct Bitmap;
62 struct ZonePict;
63 
64 class SubDocument;
65 }
66 
67 class ClarisWksDocument;
68 class ClarisWksParser;
69 class MWAWParser;
70 
77 {
79  friend class ClarisWksDocument;
80  friend class ClarisWksParser;
81 
82 public:
86  virtual ~ClarisWksGraph();
87 
89  int version() const;
90 
92  int numPages() const;
93 
95  shared_ptr<ClarisWksStruct::DSET> readGroupZone
96  (ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete);
97 
99  shared_ptr<ClarisWksStruct::DSET> readBitmapZone
100  (ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete);
101 
103  bool getSurfaceColor(ClarisWksGraphInternal::Style const &style, MWAWColor &col) const;
104 protected:
106  void setSlideList(std::vector<int> const &slideList);
108  bool canSendGroupAsGraphic(int number) const;
110  bool sendGroup(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
112  bool canSendBitmapAsGraphic(int number) const;
114  bool sendBitmap(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
115 
117  void flushExtra();
118 
119  // interface with main parser
120 
122  void askToSend(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
123 
124  //
125  // Intermediate level
126  //
127 
135  bool sendGroup(ClarisWksGraphInternal::Group &group, MWAWPosition const &position);
137  bool sendGroup(ClarisWksGraphInternal::Group &group, std::vector<size_t> const &lChild, MWAWGraphicListenerPtr listener);
139  bool sendGroupChild(ClarisWksGraphInternal::Group &group, size_t child, MWAWPosition position);
140  /* read a simple group */
141  shared_ptr<ClarisWksGraphInternal::Zone> readGroupDef(MWAWEntry const &entry);
142 
143  /* read a simple graphic zone */
144  bool readShape(MWAWEntry const &entry,
146 
147  /* read the group data.
148 
149  \note \a beginGroupPos is only used to help debugging */
150  bool readGroupData(ClarisWksGraphInternal::Group &group, long beginGroupPos);
151 
152  /* try to read the polygon data */
153  bool readPolygonData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
154 
156  /* try to read a pict data zone */
157  bool readPictData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
158 
159  /* read a picture */
161 
162  /* read a postcript zone */
164 
165  /* read a ole document zone */
167 
169  /* try to read the qtime data zone */
170  bool readQTimeData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
171 
172  /* read a named picture */
174 
176  /* try to read a bitmap zone */
177  bool readBitmapColorMap(std::vector<MWAWColor> &cMap);
178 
179  /* try to read the bitmap */
181  //
182  // low level
183  //
184 
185  /* read the first zone of a group type */
187 
188  /* read some unknown data in first zone */
189  bool readGroupUnknown(ClarisWksGraphInternal::Group &group, int zoneSz, int id);
190 
193 
196 
199 
200 private:
201  ClarisWksGraph(ClarisWksGraph const &orig);
203 
204 protected:
205  //
206  // data
207  //
210 
213 
215  shared_ptr<ClarisWksGraphInternal::State> m_state;
216 
219 };
220 #endif
221 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:382
Internal: the structures of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:67
int numPages() const
returns the number of pages
Definition: ClarisWksGraph.cxx:667
shared_ptr< ClarisWksGraphInternal::Zone > readGroupDef(MWAWEntry const &entry)
Definition: ClarisWksGraph.cxx:942
Internal: the structure used to store a style of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:109
ClarisWksDocument & m_document
the document
Definition: ClarisWksGraph.hxx:209
virtual ~ClarisWksGraph()
destructor
Definition: ClarisWksGraph.cxx:659
bool getSurfaceColor(ClarisWksGraphInternal::Style const &style, MWAWColor &col) const
return the surface color which corresponds to some ids (if possible)
Definition: ClarisWksGraph.cxx:718
bool sendShape(ClarisWksGraphInternal::ZoneShape &pict, MWAWPosition pos)
sends a basic graphic zone
Definition: ClarisWksGraph.cxx:2672
bool readGroupData(ClarisWksGraphInternal::Group &group, long beginGroupPos)
Definition: ClarisWksGraph.cxx:1198
shared_ptr< ClarisWksGraphInternal::State > m_state
the state
Definition: ClarisWksGraph.hxx:215
the main class to read the graphic part of Claris Works file
Definition: ClarisWksGraph.hxx:76
bool readPICT(ClarisWksGraphInternal::ZonePict &zone)
Definition: ClarisWksGraph.cxx:1774
the class to store a color
Definition: libmwaw_internal.hxx:166
main structure which correspond to a document part
Definition: ClarisWksStruct.hxx:51
bool readGroupHeader(ClarisWksGraphInternal::Group &group)
Definition: ClarisWksGraph.cxx:1461
bool readPS(ClarisWksGraphInternal::ZonePict &zone)
Definition: ClarisWksGraph.cxx:1817
main document information used to create a ClarisWorks file
Definition: ClarisWksDocument.hxx:69
MWAWParser * m_mainParser
the main parser;
Definition: ClarisWksGraph.hxx:218
bool readNamedPict(ClarisWksGraphInternal::ZonePict &zone)
Definition: ClarisWksGraph.cxx:1942
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: ClarisWksGraph.cxx:2883
Internal: small class to store a basic graphic zone of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:240
int version() const
returns the file version
Definition: ClarisWksGraph.cxx:662
bool canSendBitmapAsGraphic(int number) const
check if we can send a group as graphic
Definition: ClarisWksGraph.cxx:2688
the main class to read a Claris Works file
Definition: ClarisWksParser.hxx:67
Internal: the subdocument of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:596
shared_ptr< ClarisWksStruct::DSET > readBitmapZone(ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete)
reads the zone Bitmap DSET
Definition: ClarisWksGraph.cxx:825
bool readOLE(ClarisWksGraphInternal::ZonePict &zone)
Definition: ClarisWksGraph.cxx:1857
bool readQTimeData(shared_ptr< ClarisWksGraphInternal::Zone > zone)
Definition: ClarisWksGraph.cxx:1905
bool readBitmapColorMap(std::vector< MWAWColor > &cMap)
Definition: ClarisWksGraph.cxx:1992
bool readGroupUnknown(ClarisWksGraphInternal::Group &group, int zoneSz, int id)
Definition: ClarisWksGraph.cxx:1545
bool readBitmapData(ClarisWksGraphInternal::Bitmap &zone)
Definition: ClarisWksGraph.cxx:2039
bool readPictData(shared_ptr< ClarisWksGraphInternal::Zone > zone)
Definition: ClarisWksGraph.cxx:1711
bool readPolygonData(shared_ptr< ClarisWksGraphInternal::Zone > zone)
Definition: ClarisWksGraph.cxx:1608
Internal: the structure used to store a PICT or a MOVIE.
Definition: ClarisWksGraph.cxx:285
bool sendGroupChild(ClarisWksGraphInternal::Group &group, size_t child, MWAWPosition position)
send a group child
Definition: ClarisWksGraph.cxx:2564
shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:378
ClarisWksGraph(ClarisWksDocument &document)
constructor
Definition: ClarisWksGraph.cxx:653
Internal: class which stores a group of graphics, ...
Definition: ClarisWksGraph.cxx:497
MWAWParserStatePtr m_parserState
the parser state
Definition: ClarisWksGraph.hxx:212
Internal: structure to store a bitmap of a ClarisWksGraph.
Definition: ClarisWksGraph.cxx:351
shared_ptr< ClarisWksStruct::DSET > readGroupZone(ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete)
reads the zone Group DSET
Definition: ClarisWksGraph.cxx:730
bool readShape(MWAWEntry const &entry, ClarisWksGraphInternal::ZoneShape &zone)
Definition: ClarisWksGraph.cxx:1333
void setSlideList(std::vector< int > const &slideList)
set the slide list ( for presentation )
Definition: ClarisWksGraph.cxx:2900
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:386
bool canSendGroupAsGraphic(int number) const
check if we can send a group as graphic
Definition: ClarisWksGraph.cxx:2262
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:95
bool sendPicture(ClarisWksGraphInternal::ZonePict &pict, MWAWPosition pos)
sends a picture zone
Definition: ClarisWksGraph.cxx:2811
void askToSend(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition())
ask the main parser to send a zone
Definition: ClarisWksGraph.cxx:710
void updateInformation(ClarisWksGraphInternal::Group &group) const
update the group information to choose how to send the group data
Definition: ClarisWksGraph.cxx:2123
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
This class contains a virtual interface to all listener.
Definition: MWAWListener.hxx:49
ClarisWksGraph & operator=(ClarisWksGraph const &orig)
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
void checkNumberAccrossPages(ClarisWksGraphInternal::Group &group) const
check the number of accross page ( for draw document )
Definition: ClarisWksGraph.cxx:2106
bool canSendAsGraphic(ClarisWksGraphInternal::Group &group) const
check if we can send a group as graphic
Definition: ClarisWksGraph.cxx:2291
bool sendGroup(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition())
sends the zone data to the listener (if it exists )
Definition: ClarisWksGraph.cxx:2271
bool sendBitmap(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition())
sends the bitmap data to the listener (if it exists )
Definition: ClarisWksGraph.cxx:2699

Generated on Sun Oct 26 2014 05:56:30 for libmwaw by doxygen 1.8.8