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