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 <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#include "WPSGraphicStyle.h"
36
37 namespace Quattro9GraphInternal
38{
39 struct Graph;
40 struct Shape;
41 struct State;
42
43 class SubDocument;
44}
45
46 class Quattro9Parser;
47
52 class Quattro9Graph
53{
54 public:
55 friend class Quattro9Parser;
56 friend class Quattro9GraphInternal::SubDocument;
57
59 explicit Quattro9Graph(Quattro9Parser &parser);
61 ~Quattro9Graph();
63 void setListener(WKSContentListenerPtr &listen)
64 {
65 m_listener = listen;
66 }
67
68 void cleanState();
70 void updateState();
71
73 bool getColor(int id, WPSColor &color) const;
75 bool getPattern(int id, WPSGraphicStyle::Pattern &pattern) const;
76 protected:
78 int version() const;
80 void storeObjects(std::map<librevenge::RVNGString,WPSEmbeddedObject> const &nameToObjectMap);
81
83 bool sendPageGraphics(int sheetId) const;
85 bool sendShape(Quattro9GraphInternal::Graph const &graph, int sheetId) const;
87 bool sendShape(Quattro9GraphInternal::Shape const &shape, WPSTransformation const &transf) const;
89 bool sendShape(WPSGraphicShape const &shape, WPSGraphicStyle const &style, WPSTransformation const &transf) const;
91 bool sendOLE(Quattro9GraphInternal::Graph const &graph, int sheetId) const;
93 bool sendTextbox(Quattro9GraphInternal::Graph const &graph, int sheetId) const;
94
95 //
96 // low level
97 //
98
100 bool readBeginEnd(std::shared_ptr<WPSStream> stream, int sheetId);
102 bool readBeginEndZone(std::shared_ptr<WPSStream> const &stream);
104 bool readGraphHeader(std::shared_ptr<WPSStream> const &stream);
106 static bool readFrameStyle(std::shared_ptr<WPSStream> const &stream);
108 static bool readFramePattern(std::shared_ptr<WPSStream> const &stream);
110 static bool readFrameHeader(std::shared_ptr<WPSStream> const &stream);
112 bool readOLEName(std::shared_ptr<WPSStream> const &stream);
114 bool readShape(std::shared_ptr<WPSStream> const &stream);
116 bool readShapeRec(std::shared_ptr<WPSStream> const &stream, long endPos, Quattro9GraphInternal::Shape &shape, WPSGraphicStyle const &actStyle);
117
119 bool readTextboxStyle(std::shared_ptr<WPSStream> const &stream);
121 bool readTextboxText(std::shared_ptr<WPSStream> const &stream);
122
123 private:
124 Quattro9Graph(Quattro9Graph const &orig) = delete;
125 Quattro9Graph &operator=(Quattro9Graph const &orig) = delete;
126 std::shared_ptr<WKSContentListener> m_listener;
128 Quattro9Parser &m_mainParser;
130 std::shared_ptr<Quattro9GraphInternal::State> m_state;
131};
132
133#endif /* QUATTRO9_GRAPH_H */
134/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKSContentListener.h
WPSDebug.h
WPSGraphicStyle.h
Quattro9GraphInternal::SubDocument
Internal: the subdocument of a Quattro9GraphInternal.
Definition Quattro9Graph.cpp:473
Quattro9Graph::getColor
bool getColor(int id, WPSColor &color) const
returns the color corresponding to an id
Definition Quattro9Graph.cpp:567
Quattro9Graph::getPattern
bool getPattern(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id between 0 and 24
Definition Quattro9Graph.cpp:571
Quattro9Graph::readOLEName
bool readOLEName(std::shared_ptr< WPSStream > const &stream)
try to read the OLE name zone: 21d1
Definition Quattro9Graph.cpp:1498
Quattro9Graph::updateState
void updateState()
update the state (need to be called before sending data)
Definition Quattro9Graph.cpp:551
Quattro9Graph::cleanState
void cleanState()
clean internal state
Definition Quattro9Graph.cpp:546
Quattro9Graph::readShapeRec
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:744
Quattro9Graph::Quattro9Graph
Quattro9Graph(Quattro9Graph const &orig)=delete
Quattro9Graph::sendOLE
bool sendOLE(Quattro9GraphInternal::Graph const &graph, int sheetId) const
send a OLE
Definition Quattro9Graph.cpp:1673
Quattro9Graph::setListener
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition Quattro9Graph.h:63
Quattro9Graph::sendShape
bool sendShape(Quattro9GraphInternal::Graph const &graph, int sheetId) const
send a shape
Definition Quattro9Graph.cpp:1610
Quattro9Graph::readFrameHeader
static bool readFrameHeader(std::shared_ptr< WPSStream > const &stream)
try to read a frame header zone: 2171
Definition Quattro9Graph.cpp:1232
Quattro9Graph::readBeginEndZone
bool readBeginEndZone(std::shared_ptr< WPSStream > const &stream)
try to read a begin/end zone: 2051
Definition Quattro9Graph.cpp:617
Quattro9Graph::m_listener
std::shared_ptr< WKSContentListener > m_listener
Definition Quattro9Graph.h:126
Quattro9Graph::version
int version() const
return the file version
Definition Quattro9Graph.cpp:555
Quattro9Graph::~Quattro9Graph
~Quattro9Graph()
destructor
Definition Quattro9Graph.cpp:542
Quattro9Graph::readFramePattern
static bool readFramePattern(std::shared_ptr< WPSStream > const &stream)
try to read a frame style zone: 2141
Definition Quattro9Graph.cpp:1276
Quattro9Graph::sendTextbox
bool sendTextbox(Quattro9GraphInternal::Graph const &graph, int sheetId) const
send a textbox
Definition Quattro9Graph.cpp:1697
Quattro9Graph::storeObjects
void storeObjects(std::map< librevenge::RVNGString, WPSEmbeddedObject > const &nameToObjectMap)
stores the OLE objets
Definition Quattro9Graph.cpp:562
Quattro9Graph::readTextboxText
bool readTextboxText(std::shared_ptr< WPSStream > const &stream)
try to read a textbox text zone: 2372
Definition Quattro9Graph.cpp:1554
Quattro9Graph::m_state
std::shared_ptr< Quattro9GraphInternal::State > m_state
the internal state
Definition Quattro9Graph.h:130
Quattro9Graph::Quattro9Parser
friend class Quattro9Parser
Definition Quattro9Graph.h:55
Quattro9Graph::operator=
Quattro9Graph & operator=(Quattro9Graph const &orig)=delete
Quattro9Graph::readTextboxStyle
bool readTextboxStyle(std::shared_ptr< WPSStream > const &stream)
try to read a textbox style zone: 2371
Definition Quattro9Graph.cpp:1365
Quattro9Graph::m_mainParser
Quattro9Parser & m_mainParser
the listener (if set)
Definition Quattro9Graph.h:128
Quattro9Graph::readShape
bool readShape(std::shared_ptr< WPSStream > const &stream)
try to read a shape zone: 2221, 23d1
Definition Quattro9Graph.cpp:708
Quattro9Graph::readFrameStyle
static bool readFrameStyle(std::shared_ptr< WPSStream > const &stream)
try to read a frame style zone: 2131
Definition Quattro9Graph.cpp:1311
Quattro9Graph::readBeginEnd
bool readBeginEnd(std::shared_ptr< WPSStream > stream, int sheetId)
read the begin/end graph zone: 1401/1402
Definition Quattro9Graph.cpp:582
Quattro9Graph::readGraphHeader
bool readGraphHeader(std::shared_ptr< WPSStream > const &stream)
try to read a graph header zone: 2051
Definition Quattro9Graph.cpp:659
Quattro9Graph::Quattro9Graph
Quattro9Graph(Quattro9Parser &parser)
constructor
Definition Quattro9Graph.cpp:535
Quattro9Graph::sendPageGraphics
bool sendPageGraphics(int sheetId) const
send the page graphic corresponding to a sheet
Definition Quattro9Graph.cpp:1716
Quattro9Parser
This class parses Quattro Pro WP spreadsheet: .qpw.
Definition Quattro9.h:91
WPSGraphicShape
a structure used to define a picture shape
Definition WPSGraphicShape.h:35
WPSGraphicStyle
a structure used to define a picture style
Definition WPSGraphicStyle.h:38
WPSTransformation
a transformation which stored the first row of a 3x3 perspective matrix
Definition libwps_internal.h:1131
libwps_internal.h
WKSContentListenerPtr
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition libwps_internal.h:114
Quattro9GraphInternal
Definition Quattro9Graph.cpp:53
Quattro9GraphInternal::Graph
Internal: a graph of a QuattroGraph.
Definition Quattro9Graph.cpp:135
Quattro9GraphInternal::Shape
Internal: a shape of a Quattro9Graph.
Definition Quattro9Graph.cpp:56
Quattro9GraphInternal::State
the state of Quattro9Graph
Definition Quattro9Graph.cpp:181
WPSColor
the class to store a color
Definition libwps_internal.h:281
WPSGraphicStyle::Pattern
a basic pattern used in a WPSGraphicStyle:
Definition WPSGraphicStyle.h:89