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
36 namespace LotusGraphInternal
37 {
38 struct ZoneMac; // 123 mac
39 struct ZonePc; // 123 pc
40 struct ZonePcList; // 123 pc
41 struct ZoneWK4; // lotus 4
42 struct State;
43
44 class SubDocument;
45 }
46
47 class LotusParser;
48 class LotusStyleManager;
49
54 class LotusGraph
55 {
56 public:
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 }
72 void updateState(std::map<int,int> const &zIdToSheetIdMap);
73 protected:
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
127 private:
128 LotusGraph(LotusGraph const &orig);
129 LotusGraph &operator=(LotusGraph const &orig);
130 shared_ptr<WKSContentListener> m_listener;
131 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: */
LotusGraph::m_listener
shared_ptr< WKSContentListener > m_listener
Definition: LotusGraph.h:130
LotusGraphInternal::SubDocument
Internal: the subdocument of a LotusGraphc.
Definition: LotusGraph.cpp:475
LotusGraphInternal::ZoneMac
the graphic zone of a LotusGraph for 123 mac
Definition: LotusGraph.cpp:54
WKSSubDocument::operator=
WKSSubDocument & operator=(const WKSSubDocument &)
LotusGraph::setListener
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: LotusGraph.h:67
WKSContentListener.h
LotusGraph::m_styleManager
shared_ptr< LotusStyleManager > m_styleManager
the style manager
Definition: LotusGraph.h:134
LotusGraph
This class parses Microsoft Works graph file.
Definition: LotusGraph.h:54
LotusParser
This class parses a WK2..WK4 Lotus spreadsheet.
Definition: Lotus.h:66
LotusGraphInternal::ZonePcList
a list of ZonePc of a LotusGraph for 123 pc
Definition: LotusGraph.cpp:422
libwps_internal.h
WKSSubDocument::parser
WKSParser * parser() const
returns the parser
Definition: WKSSubDocument.h:44
WKSContentListenerPtr
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:115
LotusStyleManager
This class parses the Lotus style.
Definition: LotusStyleManager.h:47
LotusGraph::m_state
shared_ptr< LotusGraphInternal::State > m_state
the internal state
Definition: LotusGraph.h:136
WPSTransformation
a transformation which stored the first row of a 3x3 perspective matrix
Definition: libwps_internal.h:1089
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
LotusGraphInternal
Definition: LotusGraph.cpp:51
WPSDebug.h