QuattroGraph.h Source File documentation

QuattroGraph.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 QUATTRO_GRAPH_H
23 #define QUATTRO_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 QuattroGraphInternal
37 {
38 struct Dialog;
39 struct Graph;
40 struct State;
41
42 class SubDocument;
43 }
44
45 class QuattroParser;
46 class QuattroStyleManager;
47
52 class QuattroGraph
53 {
54 public:
55 friend class QuattroParser;
56 friend class QuattroGraphInternal::SubDocument;
57
59 explicit QuattroGraph(QuattroParser &parser);
61 ~QuattroGraph();
63 void setListener(WKSContentListenerPtr &listen)
64 {
65 m_listener = listen;
66 }
68 void cleanState();
70 void updateState();
71
72 protected:
74 int version() const;
75
77 void storeObjects(std::map<librevenge::RVNGString,WPSEmbeddedObject> const &nameToObjectMap);
79 std::vector<Vec2i> getGraphicCellsInSheet(int sheetId) const;
81 bool sendGraphics(int sheetId, Vec2i const &cell) const;
83 bool sendGraphic(QuattroGraphInternal::Graph const &graph) const;
84
85 //
86 // low level
87 //
88
89 // ////////////////////// zone //////////////////////////////
90
92 bool readBeginEnd(std::shared_ptr<WPSStream> stream, int sheetId);
94 bool readFrameOLE(std::shared_ptr<WPSStream> stream);
96 bool readImage(std::shared_ptr<WPSStream> stream);
98 bool readBitmap(std::shared_ptr<WPSStream> stream);
100 bool readChart(std::shared_ptr<WPSStream> stream);
102 bool readFrame(std::shared_ptr<WPSStream> stream);
104 bool readButton(std::shared_ptr<WPSStream> stream);
106 bool readOLEData(std::shared_ptr<WPSStream> stream);
107
109 bool readHeader(QuattroGraphInternal::Graph &header, std::shared_ptr<WPSStream> stream, long endPos);
110
111 // ////////////////////// dialog zone //////////////////////////////
112
114 bool readDialog(std::shared_ptr<WPSStream> stream);
116 bool readDialogUnknown(std::shared_ptr<WPSStream> stream);
117
119 bool readHeader(QuattroGraphInternal::Dialog &header, std::shared_ptr<WPSStream> stream, long endPos);
120
121 private:
122 QuattroGraph(QuattroGraph const &orig) = delete;
123 QuattroGraph &operator=(QuattroGraph const &orig) = delete;
124 std::shared_ptr<WKSContentListener> m_listener;
125 QuattroParser &m_mainParser;
128 std::shared_ptr<QuattroGraphInternal::State> m_state;
129 };
130
131 #endif /* QUATTRO_GRAPH_H */
132 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKSSubDocument::operator=
WKSSubDocument & operator=(const WKSSubDocument &)=delete
WKSContentListener.h
QuattroGraph::setListener
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: QuattroGraph.h:63
QuattroGraphInternal::Graph
a graph
Definition: QuattroGraph.cpp:99
libwps_internal.h
QuattroGraphInternal::Dialog
a dialog header
Definition: QuattroGraph.cpp:55
WKSSubDocument::parser
WKSParser * parser() const
returns the parser
Definition: WKSSubDocument.h:44
QuattroGraph::m_state
std::shared_ptr< QuattroGraphInternal::State > m_state
the internal state
Definition: QuattroGraph.h:128
QuattroParser
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition: Quattro.h:51
QuattroGraph
This class parses QuattroPro graph file.
Definition: QuattroGraph.h:52
WKSContentListenerPtr
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:114
Vec2< int >
QuattroGraph::m_listener
std::shared_ptr< WKSContentListener > m_listener
Definition: QuattroGraph.h:124
QuattroGraphInternal::SubDocument
Internal: the subdocument of a LotusGraphc.
Definition: QuattroGraph.cpp:219
WPSDebug.h
QuattroGraphInternal
Definition: QuattroGraph.cpp:52