STOFFChart.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/* libstaroffice
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 * Structure to store and construct a chart
36 *
37 */
38
39#ifndef STOFF_CHART
40# define STOFF_CHART
41
42#include <iostream>
43#include <vector>
44#include <map>
45
47
48#include "STOFFEntry.hxx"
49#include "STOFFFont.hxx"
50
51namespace STOFFChartInternal
52{
53class SubDocument;
54}
57{
59public:
61 struct Axis {
65 Axis();
67 ~Axis();
69 void addContentTo(librevenge::RVNGString const &sheetName, int coord, librevenge::RVNGPropertyList &propList) const;
71 void addStyleTo(librevenge::RVNGPropertyList &propList) const;
73 friend std::ostream &operator<<(std::ostream &o, Axis const &axis);
82#if 0
84 STOFFGraphicStyle m_style;
85#endif
86 };
88 struct Legend {
91 {
92 }
94 void addContentTo(librevenge::RVNGPropertyList &propList) const;
96 void addStyleTo(librevenge::RVNGPropertyList &propList) const;
98 friend std::ostream &operator<<(std::ostream &o, Legend const &legend);
100 bool m_show;
109#if 0
111 STOFFGraphicStyle m_style;
112#endif
113 };
115 struct Series {
119 Series();
121 virtual ~Series();
123 void addContentTo(librevenge::RVNGString const &sheetName, librevenge::RVNGPropertyList &propList) const;
125 void addStyleTo(librevenge::RVNGPropertyList &propList) const;
127 static librevenge::RVNGString getSeriesTypeName(Type type);
129 friend std::ostream &operator<<(std::ostream &o, Series const &series);
134#if 0
136 STOFFGraphicStyle m_style;
137#endif
138 };
140 struct TextZone {
145
147 TextZone();
149 ~TextZone();
151 void addContentTo(librevenge::RVNGString const &sheetName, librevenge::RVNGPropertyList &propList) const;
153 void addStyleTo(librevenge::RVNGPropertyList &propList) const;
155 friend std::ostream &operator<<(std::ostream &o, TextZone const &zone);
168#if 0
170 STOFFGraphicStyle m_style;
171#endif
172 };
173
175 STOFFChart(librevenge::RVNGString const &sheetName, STOFFVec2f const &dim=STOFFVec2f());
177 virtual ~STOFFChart();
179 void sendChart(STOFFSpreadsheetListenerPtr &listener, librevenge::RVNGSpreadsheetInterface *interface);
181 virtual void sendContent(TextZone const &zone, STOFFListenerPtr &listener)=0;
182
184 void setDataType(Series::Type type, bool dataStacked)
185 {
186 m_type=type;
187 m_dataStacked=dataStacked;
188 }
189
192 {
193 return m_dim;
194 }
196 void setDimension(STOFFVec2f const &dim)
197 {
198 m_dim=dim;
199 }
201 void add(int coord, Axis const &axis);
203 Axis const &getAxis(int coord) const;
204
206 void set(Legend const &legend)
207 {
208 m_legend=legend;
209 }
211 Legend const &getLegend() const
212 {
213 return m_legend;
214 }
215
217 void add(Series const &series);
219 std::vector<Series> const &getSeries() const
220 {
221 return m_seriesList;
222 }
223
225 void add(TextZone const &textZone);
227 bool getTextZone(TextZone::Type type, TextZone &textZone);
228
229protected:
232
233protected:
235 librevenge::RVNGString m_sheetName;
247 std::vector<Series> m_seriesList;
249 std::map<TextZone::Type, TextZone> m_textZoneMap;
250private:
251 STOFFChart(STOFFChart const &orig);
253};
254
255#endif
256// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Internal: the subdocument of a STOFFChart.
Definition STOFFChart.cxx:61
a class used to store a chart associated to a spreadsheet ....
Definition STOFFChart.hxx:57
bool getTextZone(TextZone::Type type, TextZone &textZone)
returns a textzone content(if set)
Definition STOFFChart.cxx:150
bool m_dataStacked
a flag to know if the data are stacked or not
Definition STOFFChart.hxx:241
STOFFVec2f m_dim
the chart dimension in point
Definition STOFFChart.hxx:237
std::map< TextZone::Type, TextZone > m_textZoneMap
a map text zone type to text zone
Definition STOFFChart.hxx:249
std::vector< Series > m_seriesList
the list of series
Definition STOFFChart.hxx:247
virtual ~STOFFChart()
the destructor
Definition STOFFChart.cxx:123
virtual void sendContent(TextZone const &zone, STOFFListenerPtr &listener)=0
send the zone content (called when the zone is of text type)
Series::Type m_type
the chart type (if no series)
Definition STOFFChart.hxx:239
Axis m_axis[4]
the x,y,z axis and a bad axis
Definition STOFFChart.hxx:243
void sendChart(STOFFSpreadsheetListenerPtr &listener, librevenge::RVNGSpreadsheetInterface *interface)
send the chart to the listener
Definition STOFFChart.cxx:172
Legend m_legend
the legend
Definition STOFFChart.hxx:245
Legend const & getLegend() const
return the legend
Definition STOFFChart.hxx:211
void setDimension(STOFFVec2f const &dim)
return the chart dimension
Definition STOFFChart.hxx:196
void sendTextZoneContent(TextZone::Type type, STOFFListenerPtr &listener)
sends a textzone content
Definition STOFFChart.cxx:158
Axis const & getAxis(int coord) const
return an axis (corresponding to a coord)
Definition STOFFChart.cxx:136
STOFFChart & operator=(STOFFChart const &orig)
void add(int coord, Axis const &axis)
adds an axis (corresponding to a coord)
Definition STOFFChart.cxx:127
void setDataType(Series::Type type, bool dataStacked)
sets the chart type
Definition STOFFChart.hxx:184
std::vector< Series > const & getSeries() const
return the list of series
Definition STOFFChart.hxx:219
STOFFVec2f const & getDimension() const
return the chart dimension
Definition STOFFChart.hxx:191
librevenge::RVNGString m_sheetName
the sheet name
Definition STOFFChart.hxx:235
void set(Legend const &legend)
set the legend
Definition STOFFChart.hxx:206
STOFFChart(STOFFChart const &orig)
basic class to store an entry in a file This contained :
Definition STOFFEntry.hxx:47
Class to store font.
Definition STOFFFont.hxx:44
Class to store a graphic style.
Definition STOFFGraphicStyle.hxx:45
shared_ptr< STOFFListener > STOFFListenerPtr
a smart pointer of STOFFListener
Definition libstaroffice_internal.hxx:476
STOFFVec2< float > STOFFVec2f
STOFFVec2 of float.
Definition libstaroffice_internal.hxx:752
shared_ptr< STOFFSpreadsheetListener > STOFFSpreadsheetListenerPtr
a smart pointer of STOFFSpreadsheetListener
Definition libstaroffice_internal.hxx:482
Internal: the structures of a STOFFChart.
Definition STOFFChart.cxx:57
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition libstaroffice_internal.cxx:51
a axis in a chart
Definition STOFFChart.hxx:61
Type m_type
the sequence type
Definition STOFFChart.hxx:75
Axis()
constructor
Definition STOFFChart.cxx:329
void addStyleTo(librevenge::RVNGPropertyList &propList) const
add style to the propList
Definition STOFFChart.cxx:366
STOFFBox2i m_labelRange
the label range if defined
Definition STOFFChart.hxx:81
~Axis()
destructor
Definition STOFFChart.cxx:334
Type
the axis content
Definition STOFFChart.hxx:63
@ A_None
Definition STOFFChart.hxx:63
@ A_Numeric
Definition STOFFChart.hxx:63
@ A_Sequence_Skip_Empty
Definition STOFFChart.hxx:63
@ A_Sequence
Definition STOFFChart.hxx:63
@ A_Logarithmic
Definition STOFFChart.hxx:63
void addContentTo(librevenge::RVNGString const &sheetName, int coord, librevenge::RVNGPropertyList &propList) const
add content to the propList
Definition STOFFChart.cxx:338
bool m_showGrid
show or not the grid
Definition STOFFChart.hxx:77
friend std::ostream & operator<<(std::ostream &o, Axis const &axis)
operator<<
Definition STOFFChart.cxx:375
bool m_showLabel
show or not the label
Definition STOFFChart.hxx:79
a legend in a chart
Definition STOFFChart.hxx:88
int m_relativePosition
the automatic position libstoff::LeftBit|...
Definition STOFFChart.hxx:104
friend std::ostream & operator<<(std::ostream &o, Legend const &legend)
operator<<
Definition STOFFChart.cxx:434
Legend()
constructor
Definition STOFFChart.hxx:90
bool m_show
show or not the legend
Definition STOFFChart.hxx:100
STOFFVec2f m_position
the position in points
Definition STOFFChart.hxx:106
STOFFFont m_font
the font
Definition STOFFChart.hxx:108
void addContentTo(librevenge::RVNGPropertyList &propList) const
add content to the propList
Definition STOFFChart.cxx:408
void addStyleTo(librevenge::RVNGPropertyList &propList) const
add style to the propList
Definition STOFFChart.cxx:428
bool m_autoPosition
automatic position
Definition STOFFChart.hxx:102
a series in a chart
Definition STOFFChart.hxx:115
STOFFBox2i m_range
the data range
Definition STOFFChart.hxx:133
Series()
constructor
Definition STOFFChart.cxx:462
Type
the series type
Definition STOFFChart.hxx:117
@ S_Scatter
Definition STOFFChart.hxx:117
@ S_Pie
Definition STOFFChart.hxx:117
@ S_Line
Definition STOFFChart.hxx:117
@ S_Column
Definition STOFFChart.hxx:117
@ S_Bar
Definition STOFFChart.hxx:117
@ S_Stock
Definition STOFFChart.hxx:117
@ S_Area
Definition STOFFChart.hxx:117
void addContentTo(librevenge::RVNGString const &sheetName, librevenge::RVNGPropertyList &propList) const
add content to the propList
Definition STOFFChart.cxx:493
static librevenge::RVNGString getSeriesTypeName(Type type)
returns a string corresponding to a series type
Definition STOFFChart.cxx:470
virtual ~Series()
destructor
Definition STOFFChart.cxx:466
friend std::ostream & operator<<(std::ostream &o, Series const &series)
operator<<
Definition STOFFChart.cxx:518
Type m_type
the type
Definition STOFFChart.hxx:131
void addStyleTo(librevenge::RVNGPropertyList &propList) const
add style to the propList
Definition STOFFChart.cxx:514
a text zone a chart
Definition STOFFChart.hxx:140
ContentType
the text content type
Definition STOFFChart.hxx:144
@ C_Cell
Definition STOFFChart.hxx:144
@ C_Text
Definition STOFFChart.hxx:144
void addStyleTo(librevenge::RVNGPropertyList &propList) const
add to the propList
Definition STOFFChart.cxx:597
ContentType m_contentType
the content type
Definition STOFFChart.hxx:159
STOFFEntry m_textEntry
the text entry
Definition STOFFChart.hxx:165
TextZone()
constructor
Definition STOFFChart.cxx:554
STOFFVec2f m_position
the position in the zone
Definition STOFFChart.hxx:161
STOFFFont m_font
the zone format
Definition STOFFChart.hxx:167
~TextZone()
destructor
Definition STOFFChart.cxx:560
Type m_type
the zone type
Definition STOFFChart.hxx:157
STOFFVec2i m_cell
the cell position ( for title and subtitle )
Definition STOFFChart.hxx:163
Type
the text type
Definition STOFFChart.hxx:142
@ T_SubTitle
Definition STOFFChart.hxx:142
@ T_AxisZ
Definition STOFFChart.hxx:142
@ T_AxisX
Definition STOFFChart.hxx:142
@ T_Title
Definition STOFFChart.hxx:142
@ T_AxisY
Definition STOFFChart.hxx:142
void addContentTo(librevenge::RVNGString const &sheetName, librevenge::RVNGPropertyList &propList) const
add content to the propList
Definition STOFFChart.cxx:564
friend std::ostream & operator<<(std::ostream &o, TextZone const &zone)
operator<<
Definition STOFFChart.cxx:602

Generated on Wed Nov 29 2023 18:59:40 for libstaroffice by doxygen 1.9.8