WPS8Graph.h Source File documentation

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 <map>
30 #include <vector>
31
32 #include "libwps_internal.h"
33
34 #include "WPSDebug.h"
35
36 class WPS8Parser;
37
38 namespace WPS8GraphInternal
39 {
40 struct State;
41 }
42
53 class WPS8Graph
54 {
55 friend class WPS8Parser;
56 public:
58 explicit WPS8Graph(WPS8Parser &parser);
59
61 ~WPS8Graph();
62
64 void setListener(WPSContentListenerPtr &listen)
65 {
66 m_listener = listen;
67 }
68
73 void computePositions() const;
74
76 int numPages() const;
77
82 bool sendObject(WPSPosition const &pos, int id, bool ole);
83
85 bool sendIBGF(WPSPosition const &pos, int ibgfId);
86
94 void sendObjects(int page, int pageToIgnore=-2);
95
96 protected:
98 int version() const;
99
103 void sendBorder(int borderId);
104
106 void storeObjects(std::map<int,WPSEmbeddedObject> const &objectsMap);
107
109 bool readStructures(RVNGInputStreamPtr const &input);
110
111 // low level
112
116 bool readPICT(RVNGInputStreamPtr const &input, WPSEntry const &entry);
117
122 bool readIBGF(RVNGInputStreamPtr const &input, WPSEntry const &entry);
123
125 bool readBDR(RVNGInputStreamPtr const &input, WPSEntry const &entry);
126
128 libwps::DebugFile &ascii()
129 {
130 return m_asciiFile;
131 }
132 private:
133 WPS8Graph(WPS8Graph const &orig) = delete;
134 WPS8Graph &operator=(WPS8Graph const &orig) = delete;
135
136 protected:
138 WPSContentListenerPtr m_listener;
139
141 WPS8Parser &m_mainParser;
142
144 mutable std::shared_ptr<WPS8GraphInternal::State> m_state;
145
147 libwps::DebugFile &m_asciiFile;
148 };
149
150 #endif
151 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPS8Graph::ascii
libwps::DebugFile & ascii()
returns the debug file
Definition: WPS8Graph.h:128
WPSParser::m_asciiFile
libwps::DebugFile m_asciiFile
the debug file
Definition: WPSParser.h:90
WPS8Parser
This class parses Works version 2000 through 8.
Definition: WPS8.h:49
WPS8Graph::setListener
void setListener(WPSContentListenerPtr &listen)
sets the listener
Definition: WPS8Graph.h:64
WPS8Graph
the main class to read/store pictures in a Pc MS Works document v5-8
Definition: WPS8Graph.h:53
libwps::DebugFile
Definition: WPSDebug.h:207
WPSParser::version
int version() const
Definition: WPSParser.h:56
WPS8Graph::m_listener
WPSContentListenerPtr m_listener
the listener
Definition: WPS8Graph.h:138
libwps_internal.h
WPS8Graph::m_state
std::shared_ptr< WPS8GraphInternal::State > m_state
the state
Definition: WPS8Graph.h:144
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WPS8Graph::m_asciiFile
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WPS8Graph.h:147
WPS8Parser::WPS8Graph
friend class WPS8Graph
Definition: WPS8.h:52
WPSContentListenerPtr
std::shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:107
WPSParser::operator=
WPSParser & operator=(const WPSParser &)=delete
WPS8GraphInternal
Internal: the structures of a WPS8Graph.
Definition: WPS8Graph.cpp:48
WPS8Parser::m_listener
std::shared_ptr< WPSContentListener > m_listener
Definition: WPS8.h:159
WPS8Parser::sendObject
bool sendObject(Vec2f const &size, int objectId, bool ole)
sends an object as a character with given size (via its WPS8Graph )
Definition: WPS8.cpp:485
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
WPSPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: WPSPosition.h:39
WPSDebug.h
WPS8Graph::m_mainParser
WPS8Parser & m_mainParser
the main parser
Definition: WPS8Graph.h:141