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 
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 
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 
118  {
119  return m_asciiFile;
120  }
121 
122 private:
123  WPS4Graph(WPS4Graph const &orig);
124  WPS4Graph &operator=(WPS4Graph const &orig);
125 protected:
128 
131 
133  mutable shared_ptr<WPS4GraphInternal::State> m_state;
134 
137 };
138 
139 #endif
140 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
141 
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WPS4Graph.h:136
libwps::DebugFile m_asciiFile
the debug file
Definition: WPSParser.h:97
shared_ptr< WPS4ContentListener > WPS4ContentListenerPtr
Definition: WPS4Graph.h:42
WPSParser & operator=(const WPSParser &)
shared_ptr< WPXInputStream > WPXInputStreamPtr
Definition: libwps_internal.h:74
WPS4Parser & m_mainParser
the main parser
Definition: WPS4Graph.h:130
Definition: WPSDebug.h:198
int readObject(WPXInputStreamPtr input, WPSEntry const &entry)
tries to read a picture ( via its WPS4Graph )
Definition: WPS4.cpp:302
libwps::DebugFile & ascii()
returns the debug file
Definition: WPS4Graph.h:117
int version() const
Definition: WPSParser.h:62
This class parses Works version 2 through 4.
Definition: WPS4.h:52
WPS4ContentListenerPtr m_listener
the listener
Definition: WPS4Graph.h:127
Definition: WPSContentListener.h:168
shared_ptr< WPS4ContentListener > m_listener
Definition: WPS4.h:144
the main class to read/store picture in a Pc MS Works document v1-4
Definition: WPS4Graph.h:62
void setListener(WPS4ContentListenerPtr &listen)
sets the listener
Definition: WPS4Graph.h:73
Internal: the structures of a WPS4Graph.
Definition: WPS4Graph.cpp:41
shared_ptr< WPS4GraphInternal::State > m_state
the state
Definition: WPS4Graph.h:133
friend class WPS4Graph
Definition: WPS4.h:55
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
void sendObject(Vec2f const &size, int id)
sends an object with given id ( via its WPS4Graph )
Definition: WPS4.cpp:310

Generated on Fri Oct 19 2018 22:44:32 for libwps by doxygen 1.8.13