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
shared_ptr< WPS4ContentListener > WPS4ContentListenerPtr
Definition: WPS4Graph.h:42
shared_ptr< WPXInputStream > WPXInputStreamPtr
Definition: libwps_internal.h:74
WPS4Parser & m_mainParser
the main parser
Definition: WPS4Graph.h:130
void sendObjects(int page)
send all the objects of a given page:
Definition: WPS4Graph.cpp:144
Definition: WPSDebug.h:198
libwps::DebugFile & ascii()
returns the debug file
Definition: WPS4Graph.h:117
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
the main class to read/store picture in a Pc MS Works document v1-4
Definition: WPS4Graph.h:62
void computePositions() const
computes the position of all found figures.
Definition: WPS4Graph.cpp:86
void setListener(WPS4ContentListenerPtr &listen)
sets the listener
Definition: WPS4Graph.h:73
WPS4Graph & operator=(WPS4Graph const &orig)
int readObject(WPXInputStreamPtr input, WPSEntry const &entry)
tries to find a picture in the zone pointed by entry
Definition: WPS4Graph.cpp:185
int version() const
returns the file version
Definition: WPS4Graph.cpp:75
~WPS4Graph()
destructor
Definition: WPS4Graph.cpp:70
void sendObject(Vec2f const &size, int id)
sends an object with identificator id as a character with given size
Definition: WPS4Graph.cpp:113
shared_ptr< WPS4GraphInternal::State > m_state
the state
Definition: WPS4Graph.h:133
WPS4Graph(WPS4Parser &parser)
constructor given the main parser of the MN0 zone
Definition: WPS4Graph.cpp:64
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
int numPages() const
returns the number page where we find a picture. In practice, 0/1
Definition: WPS4Graph.cpp:81
void storeObjects(std::vector< WPXBinaryData > const &objects, std::vector< int > const &ids, std::vector< WPSPosition > const &positions)
store a list of object
Definition: WPS4Graph.cpp:94

Generated on Wed Jun 11 2014 02:26:00 for libwps by doxygen 1.8.5