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
37class WPS8Parser;
38
39namespace WPS8GraphInternal
40{
41struct State;
42}
43
55{
56 friend class WPS8Parser;
57public:
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
97protected:
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
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 }
139private:
140 WPS8Graph(WPS8Graph const &orig);
142
143protected:
146
149
151 mutable shared_ptr<WPS8GraphInternal::State> m_state;
152
155};
156
157#endif
158/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
the main class to read/store pictures in a Pc MS Works document v5-8
Definition: WPS8Graph.h:55
WPS8Parser & m_mainParser
the main parser
Definition: WPS8Graph.h:148
bool sendIBGF(WPSPosition const &pos, int ibgfId)
sends data corresponding to a ibgf entry on a given pos position
Definition: WPS8Graph.cpp:245
bool readIBGF(RVNGInputStreamPtr input, WPSEntry const &entry)
reads a IBGF zone: an entry to a background picture
Definition: WPS8Graph.cpp:458
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WPS8Graph.h:154
WPS8Graph & operator=(WPS8Graph const &orig)
int version() const
returns the file version
Definition: WPS8Graph.cpp:124
bool readStructures(RVNGInputStreamPtr input)
finds all entries which correspond to some pictures, parses them and stores data
Definition: WPS8Graph.cpp:167
bool readBDR(RVNGInputStreamPtr input, WPSEntry const &entry)
parsed BDR/WBDR zone: a complex border formed with 8 pictures
Definition: WPS8Graph.cpp:520
WPS8Graph(WPS8Graph const &orig)
libwps::DebugFile & ascii()
returns the debug file
Definition: WPS8Graph.h:135
void sendObjects(int page, int pageToIgnore=-2)
send all the objects of a given page:
Definition: WPS8Graph.cpp:263
void setListener(WPSContentListenerPtr &listen)
sets the listener
Definition: WPS8Graph.h:65
bool readMetaFile(RVNGInputStreamPtr input, long endPos, librevenge::RVNGBinaryData &pict)
reads METAFILE/CODE
Definition: WPS8Graph.cpp:684
~WPS8Graph()
destructor
Definition: WPS8Graph.cpp:118
shared_ptr< WPS8GraphInternal::State > m_state
the state
Definition: WPS8Graph.h:151
void computePositions() const
computes the final position of all found figures.
Definition: WPS8Graph.cpp:139
WPSContentListenerPtr m_listener
the listener
Definition: WPS8Graph.h:145
int numPages() const
returns the number page where we find a picture. In practice, 0/1
Definition: WPS8Graph.cpp:131
void storeObjects(std::vector< WPSOLEParserObject > const &objects, std::vector< int > const &ids)
adds a list of objects with given ids in the ole lists
Definition: WPS8Graph.cpp:144
bool sendObject(WPSPosition const &pos, int id, bool ole)
sends an object
Definition: WPS8Graph.cpp:208
bool readPICT(RVNGInputStreamPtr input, WPSEntry const &entry)
reads a PICT/MEF4 entry : reads uncompressed picture of sx*sy of rgb
Definition: WPS8Graph.cpp:382
void sendBorder(int borderId)
sends the border frames.
Definition: WPS8Graph.cpp:338
This class parses Works version 2000 through 8.
Definition: WPS8.h:50
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:39
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: WPSPosition.h:40
Definition: WPSDebug.h:197
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:88
shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:108
Internal: the structures of a WPS8Graph.
Definition: WPS8Graph.cpp:47
small struct to store an object
Definition: WPSOLEParser.h:80

Generated on Fri Sep 30 2022 11:47:43 for libwps by doxygen 1.9.5