WingzGraph.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 /*
35 * Parser to Claris Resolve/Wingz document ( graphic part )
36 *
37 */
38 #ifndef WINGZ_GRAPH
39 # define WINGZ_GRAPH
40
41 #include <string>
42 #include <vector>
43
44 #include <librevenge/librevenge.h>
45
46 #include "libmwaw_internal.hxx"
47
48 #include "MWAWDebug.hxx"
49 #include "MWAWGraphicStyle.hxx"
50 #include "MWAWInputStream.hxx"
51
52 namespace WingzGraphInternal
53 {
54 struct Graphic;
55 struct State;
56 class SubDocument;
57 }
58
59 class WingzParser;
60
66 class WingzGraph
67 {
68 friend class WingzParser;
69 friend class WingzGraphInternal::SubDocument;
70
71 public:
73 explicit WingzGraph(WingzParser &parser);
75 virtual ~WingzGraph();
76
78 int version() const;
79
80 protected:
82 bool sendPageGraphics();
83
84 //
85 // Intermediate level
86 //
87
89 bool readGraphic();
91 bool readEndGroup();
93 bool readTextZone(std::shared_ptr<WingzGraphInternal::Graphic> graphic);
94
96 bool readChartData(std::shared_ptr<WingzGraphInternal::Graphic> graphic);
98 bool readPattern(MWAWGraphicStyle::Pattern &pattern, int &patId);
100 bool readColor(MWAWColor &color, int &patId);
101
102 //
103 // send data
104 //
105
107 bool sendGraphic(WingzGraphInternal::Graphic const &graphic, MWAWPosition const &pos);
109 bool sendShape(WingzGraphInternal::Graphic const &graphic, MWAWPosition const &pos);
111 bool sendPicture(WingzGraphInternal::Graphic const &graphic, MWAWPosition const &pos);
113 bool sendText(WingzGraphInternal::Graphic const &graphic);
114 private:
115 WingzGraph(WingzGraph const &orig) = delete;
116 WingzGraph &operator=(WingzGraph const &orig) = delete;
117
118 protected:
119 //
120 // data
121 //
123 MWAWParserStatePtr m_parserState;
124
126 std::shared_ptr<WingzGraphInternal::State> m_state;
127
129 WingzParser *m_mainParser;
130 };
131 #endif
132 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWGraphicStyle.hxx
MWAWInputStream.hxx
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
WingzGraphInternal::SubDocument
Internal: the subdocument of a WingzGraph.
Definition: WingzGraph.cxx:204
WingzGraph
the main class to read the graphic part of a Claris Resolve/Wingz file
Definition: WingzGraph.hxx:67
WingzGraph::sendGraphic
bool sendGraphic(WingzGraphInternal::Graphic const &graphic, MWAWPosition const &pos)
try to send a generic graphic
Definition: WingzGraph.cxx:1444
WingzGraph::m_state
std::shared_ptr< WingzGraphInternal::State > m_state
the state
Definition: WingzGraph.hxx:126
WingzGraph::m_mainParser
WingzParser * m_mainParser
the main parser;
Definition: WingzGraph.hxx:129
WingzGraph::readGraphic
bool readGraphic()
read a graphic zone: 0xe
Definition: WingzGraph.cxx:281
WingzGraph::~WingzGraph
virtual ~WingzGraph()
destructor
Definition: WingzGraph.cxx:264
WingzGraph::readPattern
bool readPattern(MWAWGraphicStyle::Pattern &pattern, int &patId)
read a pattern
Definition: WingzGraph.cxx:999
WingzGraph::sendShape
bool sendShape(WingzGraphInternal::Graphic const &graphic, MWAWPosition const &pos)
try to send a shape graphic
Definition: WingzGraph.cxx:1525
WingzGraph::readTextZone
bool readTextZone(std::shared_ptr< WingzGraphInternal::Graphic > graphic)
read a text zone or a button zone ( some graphic zone)
Definition: WingzGraph.cxx:635
WingzGraph::readColor
bool readColor(MWAWColor &color, int &patId)
read a color: front color, patId, background color
Definition: WingzGraph.cxx:1025
WingzGraph::operator=
WingzGraph & operator=(WingzGraph const &orig)=delete
WingzGraph::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: WingzGraph.hxx:123
WingzGraph::sendPageGraphics
bool sendPageGraphics()
try to send the page graphic
Definition: WingzGraph.cxx:1693
WingzGraph::readEndGroup
bool readEndGroup()
read a end group zone: 0xf
Definition: WingzGraph.cxx:596
WingzGraph::sendText
bool sendText(WingzGraphInternal::Graphic const &graphic)
try to send the content of a textbox/button
Definition: WingzGraph.cxx:1644
WingzGraph::WingzGraph
WingzGraph(WingzGraph const &orig)=delete
WingzGraph::sendPicture
bool sendPicture(WingzGraphInternal::Graphic const &graphic, MWAWPosition const &pos)
try to send a picture graphic
Definition: WingzGraph.cxx:1503
WingzGraph::version
int version() const
returns the file version
Definition: WingzGraph.cxx:267
WingzGraph::WingzGraph
WingzGraph(WingzParser &parser)
constructor
Definition: WingzGraph.cxx:257
WingzGraph::readChartData
bool readChartData(std::shared_ptr< WingzGraphInternal::Graphic > graphic)
read a chart
Definition: WingzGraph.cxx:1037
WingzParser
the main class to read a Claris Resolve or a Wingz document
Definition: WingzParser.hxx:63
libmwaw_internal.hxx
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:557
WingzGraphInternal
Internal: the structures of a WingzGraph.
Definition: WingzGraph.cxx:59
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MWAWGraphicStyle::Pattern
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:348
WingzGraphInternal::Graphic
Internal a Graphic of a WingzGraph.
Definition: WingzGraph.cxx:61