WPS8Graph.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Major Contributor(s):
10  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11  * Copyright (C) 2006, 2007 Andrew Ziem
12  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15  *
16  * For minor contributions see the git repository.
17  *
18  * Alternatively, the contents of this file may be used under the terms
19  * of the GNU Lesser General Public License Version 2.1 or later
20  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21  * applicable instead of those above.
22  *
23  * For further information visit http://libwps.sourceforge.net
24  */
25 
26 #ifndef WPS8_GRAPH
27 # define WPS8_GRAPH
28 
29 #include <list>
30 #include <vector>
31 
32 #include "libwps_internal.h"
33 
34 #include "WPSDebug.h"
35 
36 class WPXBinaryData;
37 
38 class WPSEntry;
39 class WPS8Parser;
40 class WPSPosition;
41 
43 typedef shared_ptr<WPS8ContentListener> WPS8ContentListenerPtr;
44 
45 namespace WPS8GraphInternal
46 {
47 struct State;
48 }
49 
60 class WPS8Graph
61 {
62  friend class WPS8Parser;
63 public:
65  WPS8Graph(WPS8Parser &parser);
66 
68  ~WPS8Graph();
69 
72  {
73  m_listener = listen;
74  }
75 
80  void computePositions() const;
81 
83  int numPages() const;
84 
89  bool sendObject(WPSPosition const &pos, int id, bool ole);
90 
92  bool sendIBGF(WPSPosition const &pos, int ibgfId);
93 
101  void sendObjects(int page, int pageToIgnore=-2);
102 
103 protected:
105  int version() const;
106 
110  void sendBorder(int borderId);
111 
113  void storeObjects(std::vector<WPXBinaryData> const &objects,
114  std::vector<int> const &ids,
115  std::vector<WPSPosition> const &positions);
116 
118  bool readStructures(WPXInputStreamPtr input);
119 
120  // low level
121 
125  bool readPICT(WPXInputStreamPtr input, WPSEntry const &entry);
126 
131  bool readIBGF(WPXInputStreamPtr input, WPSEntry const &entry);
132 
134  bool readBDR(WPXInputStreamPtr input, WPSEntry const &entry);
135 
139  bool readMetaFile(WPXInputStreamPtr input, long endPos, WPXBinaryData &pict);
140 
143  {
144  return m_asciiFile;
145  }
146 private:
147  WPS8Graph(WPS8Graph const &orig);
148  WPS8Graph &operator=(WPS8Graph const &orig);
149 
150 protected:
153 
156 
158  mutable shared_ptr<WPS8GraphInternal::State> m_state;
159 
162 };
163 
164 #endif
165 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
libwps::DebugFile & ascii()
returns the debug file
Definition: WPS8Graph.h:142
shared_ptr< WPS8GraphInternal::State > m_state
the state
Definition: WPS8Graph.h:158
libwps::DebugFile m_asciiFile
the debug file
Definition: WPSParser.h:97
This class parses Works version 2000 through 8.
Definition: WPS8.h:53
WPSParser & operator=(const WPSParser &)
shared_ptr< WPXInputStream > WPXInputStreamPtr
Definition: libwps_internal.h:74
the main class to read/store pictures in a Pc MS Works document v5-8
Definition: WPS8Graph.h:60
Definition: WPSDebug.h:198
int version() const
Definition: WPSParser.h:62
Definition: WPSContentListener.h:168
shared_ptr< WPS8ContentListener > m_listener
Definition: WPS8.h:161
WPS8ContentListenerPtr m_listener
the listener
Definition: WPS8Graph.h:152
shared_ptr< WPS8ContentListener > WPS8ContentListenerPtr
Definition: WPS8Graph.h:43
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WPS8Graph.h:161
friend class WPS8Graph
Definition: WPS8.h:56
Internal: the structures of a WPS8Graph.
Definition: WPS8Graph.cpp:43
void setListener(WPS8ContentListenerPtr &listen)
sets the listener
Definition: WPS8Graph.h:71
bool sendObject(Vec2f const &size, int objectId, bool ole)
sends an object as a character with given size (via its WPS8Graph )
Definition: WPS8.cpp:442
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:37
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: WPSPosition.h:39
WPS8Parser & m_mainParser
the main parser
Definition: WPS8Graph.h:155

Generated on Sat Oct 20 2018 10:26:41 for libwps by doxygen 1.8.13