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 struct WPSOLEParserObject;
37 class WPS8Parser;
38 
39 namespace WPS8GraphInternal
40 {
41 struct State;
42 }
43 
54 class WPS8Graph
55 {
56  friend class WPS8Parser;
57 public:
59  explicit WPS8Graph(WPS8Parser &parser);
60 
62  ~WPS8Graph();
63 
66  {
67  m_listener = listen;
68  }
69 
74  void computePositions() const;
75 
77  int numPages() const;
78 
83  bool sendObject(WPSPosition const &pos, int id, bool ole);
84 
86  bool sendIBGF(WPSPosition const &pos, int ibgfId);
87 
95  void sendObjects(int page, int pageToIgnore=-2);
96 
97 protected:
99  int version() const;
100 
104  void sendBorder(int borderId);
105 
107  void storeObjects(std::vector<WPSOLEParserObject> const &objects,
108  std::vector<int> const &ids);
109 
111  bool readStructures(RVNGInputStreamPtr input);
112 
113  // low level
114 
118  bool readPICT(RVNGInputStreamPtr input, WPSEntry const &entry);
119 
124  bool readIBGF(RVNGInputStreamPtr input, WPSEntry const &entry);
125 
127  bool readBDR(RVNGInputStreamPtr input, WPSEntry const &entry);
128 
132  bool readMetaFile(RVNGInputStreamPtr input, long endPos, librevenge::RVNGBinaryData &pict);
133 
136  {
137  return m_asciiFile;
138  }
139 private:
140  WPS8Graph(WPS8Graph const &orig);
141  WPS8Graph &operator=(WPS8Graph const &orig);
142 
143 protected:
146 
149 
151  mutable shared_ptr<WPS8GraphInternal::State> m_state;
152 
155 };
156 
157 #endif
158 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
libwps::DebugFile & ascii()
returns the debug file
Definition: WPS8Graph.h:135
shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:108
shared_ptr< WPS8GraphInternal::State > m_state
the state
Definition: WPS8Graph.h:151
libwps::DebugFile m_asciiFile
the debug file
Definition: WPSParser.h:90
This class parses Works version 2000 through 8.
Definition: WPS8.h:49
WPSParser & operator=(const WPSParser &)
void setListener(WPSContentListenerPtr &listen)
sets the listener
Definition: WPS8Graph.h:65
the main class to read/store pictures in a Pc MS Works document v5-8
Definition: WPS8Graph.h:54
Definition: WPSDebug.h:196
int version() const
Definition: WPSParser.h:56
WPSContentListenerPtr m_listener
the listener
Definition: WPS8Graph.h:145
shared_ptr< WPSContentListener > m_listener
Definition: WPS8.h:157
small struct to store an object
Definition: WPSOLEParser.h:79
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WPS8Graph.h:154
friend class WPS8Graph
Definition: WPS8.h:52
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:88
Internal: the structures of a WPS8Graph.
Definition: WPS8Graph.cpp:46
bool sendObject(Vec2f const &size, int objectId, bool ole)
sends an object as a character with given size (via its WPS8Graph )
Definition: WPS8.cpp:468
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
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:148

Generated on Wed Oct 26 2016 16:54:38 for libwps by doxygen 1.8.12