- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WPS4Graph.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 WPS4_GRAPH
27 # define WPS4_GRAPH
28
29 #include <vector>
30
31 #include "libwps_internal.h"
32
33 #include "WPSDebug.h"
34
35 class WPXBinaryData;
36
37 class WPSEntry;
38 class WPS4Parser;
39 class WPSPosition;
40
41 typedef class WPSContentListener WPS4ContentListener;
42 typedef shared_ptr<WPS4ContentListener> WPS4ContentListenerPtr;
43
44 namespace WPS4GraphInternal
45 {
46 struct State;
47 }
48
50 //
51 // class to parse the object
52 //
54
62 class WPS4Graph
63 {
64 friend class WPS4Parser;
65 public:
67 WPS4Graph(WPS4Parser &parser);
68
70 ~WPS4Graph();
71
73 void setListener(WPS4ContentListenerPtr &listen)
74 {
75 m_listener = listen;
76 }
77
84 void computePositions() const;
85
87 int numPages() const;
88
89 protected:
91 int version() const;
92
94 void storeObjects(std::vector<WPXBinaryData> const &objects,
95 std::vector<int> const &ids,
96 std::vector<WPSPosition> const &positions);
97
103 int readObject(WPXInputStreamPtr input, WPSEntry const &entry);
104
106 void sendObject(Vec2f const &size, int id);
107
114 void sendObjects(int page);
115
117 libwps::DebugFile &ascii()
118 {
119 return m_asciiFile;
120 }
121
122 private:
123 WPS4Graph(WPS4Graph const &orig);
124 WPS4Graph &operator=(WPS4Graph const &orig);
125 protected:
127 WPS4ContentListenerPtr m_listener;
128
130 WPS4Parser &m_mainParser;
131
133 mutable shared_ptr<WPS4GraphInternal::State> m_state;
134
136 libwps::DebugFile &m_asciiFile;
137 };
138
139 #endif
140 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
141