Quattro9Graph.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 QUATTRO9_GRAPH_H
23#define QUATTRO9_GRAPH_H
24
25#include <ostream>
26#include <map>
27#include <set>
28#include <vector>
29
30#include <librevenge-stream/librevenge-stream.h>
31
32#include "libwps_internal.h"
33
34#include "WPSDebug.h"
35#include "WKSContentListener.h"
36#include "WPSGraphicStyle.h"
37
39{
40struct Graph;
41struct Shape;
42struct State;
43
44class SubDocument;
45}
46
47class Quattro9Parser;
48
54{
55public:
56 friend class Quattro9Parser;
58
60 explicit Quattro9Graph(Quattro9Parser &parser);
65 {
66 m_listener = listen;
67 }
68
69 void cleanState();
71 void updateState();
72
74 bool getColor(int id, WPSColor &color) const;
76 bool getPattern(int id, WPSGraphicStyle::Pattern &pattern) const;
77protected:
79 int version() const;
81 int subversion() const;
83 void storeObjects(std::map<librevenge::RVNGString, WPSEmbeddedObject> const &nameToObjectMap);
84
86 std::set<int> getListSheets() const;
88 bool sendPageGraphics(int sheetId) const;
90 bool sendShape(Quattro9GraphInternal::Graph const &graph, int sheetId) const;
92 bool sendShape(Quattro9GraphInternal::Shape const &shape, WPSTransformation const &transf) const;
94 bool sendShape(WPSGraphicShape const &shape, WPSGraphicStyle const &style, WPSTransformation const &transf) const;
96 bool sendOLE(Quattro9GraphInternal::Graph const &graph, int sheetId) const;
98 bool sendTextbox(Quattro9GraphInternal::Graph const &graph, int sheetId) const;
99
100 //
101 // low level
102 //
103
105 bool readBeginEnd(std::shared_ptr<WPSStream> stream, int sheetId);
107 bool readBeginEndZone(std::shared_ptr<WPSStream> const &stream);
109 bool readGraphHeader(std::shared_ptr<WPSStream> const &stream);
111 static bool readFrameStyle(std::shared_ptr<WPSStream> const &stream);
113 static bool readFramePattern(std::shared_ptr<WPSStream> const &stream);
115 static bool readFrameHeader(std::shared_ptr<WPSStream> const &stream);
117 bool readOLEName(std::shared_ptr<WPSStream> const &stream);
119 bool readShape(std::shared_ptr<WPSStream> const &stream);
121 bool readShapeRec(std::shared_ptr<WPSStream> const &stream, long endPos, Quattro9GraphInternal::Shape &shape, WPSGraphicStyle const &actStyle);
122
124 bool readTextboxStyle(std::shared_ptr<WPSStream> const &stream);
126 bool readTextboxText(std::shared_ptr<WPSStream> const &stream);
127
128private:
129 Quattro9Graph(Quattro9Graph const &orig) = delete;
130 Quattro9Graph &operator=(Quattro9Graph const &orig) = delete;
131 std::shared_ptr<WKSContentListener> m_listener;
135 std::shared_ptr<Quattro9GraphInternal::State> m_state;
136};
137
138#endif /* QUATTRO9_GRAPH_H */
139/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Internal: the subdocument of a Quattro9GraphInternal.
Definition Quattro9Graph.cpp:484
bool getColor(int id, WPSColor &color) const
returns the color corresponding to an id
Definition Quattro9Graph.cpp:585
bool getPattern(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id between 0 and 24
Definition Quattro9Graph.cpp:589
bool readOLEName(std::shared_ptr< WPSStream > const &stream)
try to read the OLE name zone: 21d1
Definition Quattro9Graph.cpp:1521
void updateState()
update the state (need to be called before sending data)
Definition Quattro9Graph.cpp:562
void cleanState()
clean internal state
Definition Quattro9Graph.cpp:557
bool readShapeRec(std::shared_ptr< WPSStream > const &stream, long endPos, Quattro9GraphInternal::Shape &shape, WPSGraphicStyle const &actStyle)
try to read a shape sub zone: 2221, 23d1
Definition Quattro9Graph.cpp:767
Quattro9Graph(Quattro9Graph const &orig)=delete
bool sendOLE(Quattro9GraphInternal::Graph const &graph, int sheetId) const
send a OLE
Definition Quattro9Graph.cpp:1696
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition Quattro9Graph.h:64
bool sendShape(Quattro9GraphInternal::Graph const &graph, int sheetId) const
send a shape
Definition Quattro9Graph.cpp:1633
static bool readFrameHeader(std::shared_ptr< WPSStream > const &stream)
try to read a frame header zone: 2171
Definition Quattro9Graph.cpp:1255
bool readBeginEndZone(std::shared_ptr< WPSStream > const &stream)
try to read a begin/end zone: 2051
Definition Quattro9Graph.cpp:640
std::shared_ptr< WKSContentListener > m_listener
Definition Quattro9Graph.h:131
int version() const
return the file version
Definition Quattro9Graph.cpp:566
~Quattro9Graph()
destructor
Definition Quattro9Graph.cpp:553
static bool readFramePattern(std::shared_ptr< WPSStream > const &stream)
try to read a frame style zone: 2141
Definition Quattro9Graph.cpp:1299
bool sendTextbox(Quattro9GraphInternal::Graph const &graph, int sheetId) const
send a textbox
Definition Quattro9Graph.cpp:1720
void storeObjects(std::map< librevenge::RVNGString, WPSEmbeddedObject > const &nameToObjectMap)
stores the OLE objets
Definition Quattro9Graph.cpp:580
bool readTextboxText(std::shared_ptr< WPSStream > const &stream)
try to read a textbox text zone: 2372
Definition Quattro9Graph.cpp:1577
std::shared_ptr< Quattro9GraphInternal::State > m_state
the internal state
Definition Quattro9Graph.h:135
friend class Quattro9Parser
Definition Quattro9Graph.h:56
Quattro9Graph & operator=(Quattro9Graph const &orig)=delete
bool readTextboxStyle(std::shared_ptr< WPSStream > const &stream)
try to read a textbox style zone: 2371
Definition Quattro9Graph.cpp:1388
Quattro9Parser & m_mainParser
the listener (if set)
Definition Quattro9Graph.h:133
int subversion() const
return the file sub version
Definition Quattro9Graph.cpp:573
bool readShape(std::shared_ptr< WPSStream > const &stream)
try to read a shape zone: 2221, 23d1
Definition Quattro9Graph.cpp:731
static bool readFrameStyle(std::shared_ptr< WPSStream > const &stream)
try to read a frame style zone: 2131
Definition Quattro9Graph.cpp:1334
bool readBeginEnd(std::shared_ptr< WPSStream > stream, int sheetId)
read the begin/end graph zone: 1401/1402
Definition Quattro9Graph.cpp:605
bool readGraphHeader(std::shared_ptr< WPSStream > const &stream)
try to read a graph header zone: 2051
Definition Quattro9Graph.cpp:682
Quattro9Graph(Quattro9Parser &parser)
constructor
Definition Quattro9Graph.cpp:546
bool sendPageGraphics(int sheetId) const
send the page graphic corresponding to a sheet
Definition Quattro9Graph.cpp:1739
std::set< int > getListSheets() const
return the list of sheet which contains a graph
Definition Quattro9Graph.cpp:594
This class parses Quattro Pro WP spreadsheet: .qpw.
Definition Quattro9.h:91
a structure used to define a picture shape
Definition WPSGraphicShape.h:35
a structure used to define a picture style
Definition WPSGraphicStyle.h:38
a transformation which stored the first row of a 3x3 perspective matrix
Definition libwps_internal.h:1131
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition libwps_internal.h:114
Definition Quattro9Graph.cpp:54
Internal: a graph of a QuattroGraph.
Definition Quattro9Graph.cpp:136
Internal: a shape of a Quattro9Graph.
Definition Quattro9Graph.cpp:57
the state of Quattro9Graph
Definition Quattro9Graph.cpp:182
the class to store a color
Definition libwps_internal.h:281
a basic pattern used in a WPSGraphicStyle:
Definition WPSGraphicStyle.h:89

Generated on for libwps by doxygen 1.17.0