LotusGraph.h Source File documentation

LotusGraph.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) 2006, 2007 Andrew Ziem
11 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
12 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
13 *
14 * For minor contributions see the git repository.
15 *
16 * Alternatively, the contents of this file may be used under the terms
17 * of the GNU Lesser General Public License Version 2.1 or later
18 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19 * applicable instead of those above.
20 */
21
22#ifndef LOTUS_GRAPH_H
23#define LOTUS_GRAPH_H
24
25#include <ostream>
26#include <map>
27#include <vector>
28
29#include <librevenge-stream/librevenge-stream.h>
30
31#include "libwps_internal.h"
32
33#include "WPSDebug.h"
34#include "WKSContentListener.h"
35
36namespace LotusGraphInternal
37{
38struct ZoneMac; // 123 mac
39struct ZonePc; // 123 pc
40struct ZonePcList; // 123 pc
41struct ZoneWK4; // lotus 4
42struct State;
43
44class SubDocument;
45}
46
47class LotusParser;
48class LotusStyleManager;
49
54 class LotusGraph
55{
56public:
57 friend class LotusParser;
58 friend class LotusGraphInternal::SubDocument;
59
61 explicit LotusGraph(LotusParser &parser);
63 ~LotusGraph();
65 void cleanState();
67 void setListener(WKSContentListenerPtr &listen)
68 {
69 m_listener = listen;
70 }
71
72 void updateState(std::map<int,int> const &zIdToSheetIdMap);
73protected:
75 int version() const;
76
78 bool hasGraphics(int sheetId) const;
80 void sendGraphics(int sheetId);
82 void sendZone(LotusGraphInternal::ZonePcList const &zoneList, size_t id, WPSTransformation &transf);
84 void sendPicture(LotusGraphInternal::ZoneMac const &zone);
86 void sendTextBox(shared_ptr<WPSStream> stream, WPSEntry const &entry);
88 void sendTextBoxWK4(shared_ptr<WPSStream> stream, WPSEntry const &entry, bool isButton);
89
90 //
91 // low level
92 //
93
94 // ////////////////////// zone //////////////////////////////
95
96 // zone 1b
97
99 bool readZoneBegin(shared_ptr<WPSStream> stream, long endPos);
101 bool readZoneData(shared_ptr<WPSStream> stream, long endPos, int type);
103 bool readTextBoxData(shared_ptr<WPSStream> stream, long endPos);
105 bool readPictureDefinition(shared_ptr<WPSStream> stream, long endPos);
107 bool readPictureData(shared_ptr<WPSStream> stream, long endPos);
108
109 // fmt
110
112 bool readZoneBeginC9(shared_ptr<WPSStream> stream);
114 bool readGraphic(shared_ptr<WPSStream> stream);
116 bool readFrame(shared_ptr<WPSStream> stream);
118 bool readTextBoxDataD1(shared_ptr<WPSStream> stream);
119
120 // 123 zone 3XX
121
123 bool readGraphZone(shared_ptr<WPSStream> stream, int zId);
125 bool readGraphDataZone(shared_ptr<WPSStream> stream, long endPos);
126
127private:
128 LotusGraph(LotusGraph const &orig);
129 LotusGraph &operator=(LotusGraph const &orig);
130 shared_ptr<WKSContentListener> m_listener;
132 LotusParser &m_mainParser;
134 shared_ptr<LotusStyleManager> m_styleManager;
136 shared_ptr<LotusGraphInternal::State> m_state;
137};
138
139#endif /* LOTUS_GRAPH_H */
140/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKSContentListener.h
WPSDebug.h
LotusGraphInternal::SubDocument
Internal: the subdocument of a LotusGraphc.
Definition LotusGraph.cpp:476
LotusGraph::readZoneBeginC9
bool readZoneBeginC9(shared_ptr< WPSStream > stream)
try to read the sheet id: 0xc9 (wk4)
Definition LotusGraph.cpp:1253
LotusGraph::readGraphZone
bool readGraphZone(shared_ptr< WPSStream > stream, int zId)
try to read the graphic zone: 1XXX
Definition LotusGraph.cpp:2011
LotusGraph::readGraphDataZone
bool readGraphDataZone(shared_ptr< WPSStream > stream, long endPos)
try to read the graphic data zone: 010d
Definition LotusGraph.cpp:2441
LotusGraph::hasGraphics
bool hasGraphics(int sheetId) const
return true if the sheet sheetId has some graphic
Definition LotusGraph.cpp:562
LotusGraph::readZoneBegin
bool readZoneBegin(shared_ptr< WPSStream > stream, long endPos)
reads a begin graphic zone: 2328 (wk3mac)
Definition LotusGraph.cpp:583
LotusGraph::readFrame
bool readFrame(shared_ptr< WPSStream > stream)
try to read a graph's frame: 0xcc (wk4)
Definition LotusGraph.cpp:1729
LotusGraph::setListener
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition LotusGraph.h:67
LotusGraph::m_mainParser
LotusParser & m_mainParser
the listener (if set)
Definition LotusGraph.h:132
LotusGraph::LotusGraph
LotusGraph(LotusGraph const &orig)
LotusGraph::readZoneData
bool readZoneData(shared_ptr< WPSStream > stream, long endPos, int type)
reads a graphic zone: 2332, 2346, 2350, 2352, 23f0 (wk3mac)
Definition LotusGraph.cpp:615
LotusGraph::m_state
shared_ptr< LotusGraphInternal::State > m_state
the internal state
Definition LotusGraph.h:136
LotusGraph::sendPicture
void sendPicture(LotusGraphInternal::ZoneMac const &zone)
try to send a picture: 123 mac
Definition LotusGraph.cpp:937
LotusGraph::updateState
void updateState(std::map< int, int > const &zIdToSheetIdMap)
update the state (need to be called before sending data)
Definition LotusGraph.cpp:550
LotusGraph::m_styleManager
shared_ptr< LotusStyleManager > m_styleManager
the style manager
Definition LotusGraph.h:134
LotusGraph::LotusParser
friend class LotusParser
Definition LotusGraph.h:57
LotusGraph::version
int version() const
return the file version
Definition LotusGraph.cpp:555
LotusGraph::operator=
LotusGraph & operator=(LotusGraph const &orig)
LotusGraph::cleanState
void cleanState()
clean internal state
Definition LotusGraph.cpp:545
LotusGraph::sendGraphics
void sendGraphics(int sheetId)
send the graphics corresponding to a sheetId
Definition LotusGraph.cpp:1155
LotusGraph::readGraphic
bool readGraphic(shared_ptr< WPSStream > stream)
try to read a graphic: 0xca (wk4)
Definition LotusGraph.cpp:1284
LotusGraph::readPictureDefinition
bool readPictureDefinition(shared_ptr< WPSStream > stream, long endPos)
reads a picture definition: 240e (wk3mac)
Definition LotusGraph.cpp:833
LotusGraph::~LotusGraph
~LotusGraph()
destructor
Definition LotusGraph.cpp:541
LotusGraph::readTextBoxDataD1
bool readTextBoxDataD1(shared_ptr< WPSStream > stream)
reads a graphic textbox data: 0xd1 (wk4)
Definition LotusGraph.cpp:1811
LotusGraph::m_listener
shared_ptr< WKSContentListener > m_listener
Definition LotusGraph.h:130
LotusGraph::sendTextBox
void sendTextBox(shared_ptr< WPSStream > stream, WPSEntry const &entry)
try to send a textbox content's
Definition LotusGraph.cpp:962
LotusGraph::sendZone
void sendZone(LotusGraphInternal::ZonePcList const &zoneList, size_t id, WPSTransformation &transf)
try to send a shape: 123 pc
Definition LotusGraph.cpp:1933
LotusGraph::sendTextBoxWK4
void sendTextBoxWK4(shared_ptr< WPSStream > stream, WPSEntry const &entry, bool isButton)
try to send a textbox content's
Definition LotusGraph.cpp:1843
LotusGraph::readPictureData
bool readPictureData(shared_ptr< WPSStream > stream, long endPos)
reads a picture data: 2410 (wk3mac)
Definition LotusGraph.cpp:884
LotusGraph::readTextBoxData
bool readTextBoxData(shared_ptr< WPSStream > stream, long endPos)
reads a graphic textbox data: 23f0 (wk3mac)
Definition LotusGraph.cpp:797
LotusGraph::LotusGraph
LotusGraph(LotusParser &parser)
constructor
Definition LotusGraph.cpp:535
LotusParser
This class parses a WK2..WK4 Lotus spreadsheet.
Definition Lotus.h:67
LotusStyleManager
This class parses the Lotus style.
Definition LotusStyleManager.h:48
WPSEntry
basic class to store an entry in a file This contained :
Definition WPSEntry.h:39
WPSTransformation
a transformation which stored the first row of a 3x3 perspective matrix
Definition libwps_internal.h:1090
libwps_internal.h
WKSContentListenerPtr
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition libwps_internal.h:115
LotusGraphInternal
Definition LotusGraph.cpp:52
LotusGraphInternal::State
the state of LotusGraph
Definition LotusGraph.cpp:446
LotusGraphInternal::ZoneMac
the graphic zone of a LotusGraph for 123 mac
Definition LotusGraph.cpp:55
LotusGraphInternal::ZonePcList
a list of ZonePc of a LotusGraph for 123 pc
Definition LotusGraph.cpp:423
LotusGraphInternal::ZonePc
the graphic zone of a LotusGraph for 123 pc
Definition LotusGraph.cpp:235
LotusGraphInternal::ZoneWK4
the graphic zone of a LotusGraph : wk4
Definition LotusGraph.cpp:197