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;
49
55{
56public:
57 friend class LotusParser;
59
61 explicit LotusGraph(LotusParser &parser);
65 void cleanState();
68 {
69 m_listener = listen;
70 }
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);
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);
130 shared_ptr<WKSContentListener> m_listener;
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: */
Internal: the subdocument of a LotusGraphc.
Definition LotusGraph.cpp:476
This class parses Microsoft Works graph file.
Definition LotusGraph.h:55
bool readZoneBeginC9(shared_ptr< WPSStream > stream)
try to read the sheet id: 0xc9 (wk4)
Definition LotusGraph.cpp:1253
bool readGraphZone(shared_ptr< WPSStream > stream, int zId)
try to read the graphic zone: 1XXX
Definition LotusGraph.cpp:2011
bool readGraphDataZone(shared_ptr< WPSStream > stream, long endPos)
try to read the graphic data zone: 010d
Definition LotusGraph.cpp:2441
bool hasGraphics(int sheetId) const
return true if the sheet sheetId has some graphic
Definition LotusGraph.cpp:562
bool readZoneBegin(shared_ptr< WPSStream > stream, long endPos)
reads a begin graphic zone: 2328 (wk3mac)
Definition LotusGraph.cpp:583
bool readFrame(shared_ptr< WPSStream > stream)
try to read a graph's frame: 0xcc (wk4)
Definition LotusGraph.cpp:1729
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition LotusGraph.h:67
LotusParser & m_mainParser
the listener (if set)
Definition LotusGraph.h:132
LotusGraph(LotusGraph const &orig)
bool readZoneData(shared_ptr< WPSStream > stream, long endPos, int type)
reads a graphic zone: 2332, 2346, 2350, 2352, 23f0 (wk3mac)
Definition LotusGraph.cpp:615
shared_ptr< LotusGraphInternal::State > m_state
the internal state
Definition LotusGraph.h:136
void sendPicture(LotusGraphInternal::ZoneMac const &zone)
try to send a picture: 123 mac
Definition LotusGraph.cpp:937
void updateState(std::map< int, int > const &zIdToSheetIdMap)
update the state (need to be called before sending data)
Definition LotusGraph.cpp:550
shared_ptr< LotusStyleManager > m_styleManager
the style manager
Definition LotusGraph.h:134
int version() const
return the file version
Definition LotusGraph.cpp:555
LotusGraph & operator=(LotusGraph const &orig)
void cleanState()
clean internal state
Definition LotusGraph.cpp:545
void sendGraphics(int sheetId)
send the graphics corresponding to a sheetId
Definition LotusGraph.cpp:1155
bool readGraphic(shared_ptr< WPSStream > stream)
try to read a graphic: 0xca (wk4)
Definition LotusGraph.cpp:1284
bool readPictureDefinition(shared_ptr< WPSStream > stream, long endPos)
reads a picture definition: 240e (wk3mac)
Definition LotusGraph.cpp:833
~LotusGraph()
destructor
Definition LotusGraph.cpp:541
bool readTextBoxDataD1(shared_ptr< WPSStream > stream)
reads a graphic textbox data: 0xd1 (wk4)
Definition LotusGraph.cpp:1811
shared_ptr< WKSContentListener > m_listener
Definition LotusGraph.h:130
void sendTextBox(shared_ptr< WPSStream > stream, WPSEntry const &entry)
try to send a textbox content's
Definition LotusGraph.cpp:962
void sendZone(LotusGraphInternal::ZonePcList const &zoneList, size_t id, WPSTransformation &transf)
try to send a shape: 123 pc
Definition LotusGraph.cpp:1933
void sendTextBoxWK4(shared_ptr< WPSStream > stream, WPSEntry const &entry, bool isButton)
try to send a textbox content's
Definition LotusGraph.cpp:1843
bool readPictureData(shared_ptr< WPSStream > stream, long endPos)
reads a picture data: 2410 (wk3mac)
Definition LotusGraph.cpp:884
bool readTextBoxData(shared_ptr< WPSStream > stream, long endPos)
reads a graphic textbox data: 23f0 (wk3mac)
Definition LotusGraph.cpp:797
This class parses a WK2..WK4 Lotus spreadsheet.
Definition Lotus.h:67
This class parses the Lotus style.
Definition LotusStyleManager.h:48
basic class to store an entry in a file This contained :
Definition WPSEntry.h:39
a transformation which stored the first row of a 3x3 perspective matrix
Definition libwps_internal.h:1090
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition libwps_internal.h:115
Definition LotusGraph.cpp:52
the graphic zone of a LotusGraph for 123 mac
Definition LotusGraph.cpp:55
a list of ZonePc of a LotusGraph for 123 pc
Definition LotusGraph.cpp:423

Generated on Wed Nov 29 2023 19:00:10 for libwps by doxygen 1.9.8