LibreOffice Module oox (master)  1
typegroupconverter.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_OOX_DRAWINGML_CHART_TYPEGROUPCONVERTER_HXX
21 #define INCLUDED_OOX_DRAWINGML_CHART_TYPEGROUPCONVERTER_HXX
22 
24 
25 namespace com::sun::star {
26  namespace chart2 { class XChartType; }
27  namespace chart2 { class XCoordinateSystem; }
28  namespace chart2 { class XDataSeries; }
29  namespace chart2 { class XDiagram; }
30  namespace chart2::data { class XLabeledDataSequence; }
31 }
32 
33 namespace oox::drawingml::chart {
34 
36 enum TypeId
37 {
52 };
53 
56 {
63 };
64 
67 {
71 };
72 
75 {
78  const char* mpcServiceName;
80  sal_Int32 mnDefLabelPos;
88 };
89 
90 const TypeGroupInfo& GetTypeGroupInfo( TypeId eType );
91 
92 struct UpDownBarsModel;
93 
94 class UpDownBarsConverter final : public ConverterBase< UpDownBarsModel >
95 {
96 public:
97  explicit UpDownBarsConverter( const ConverterRoot& rParent, UpDownBarsModel& rModel );
98  virtual ~UpDownBarsConverter() override;
99 
101  void convertFromModel(
102  const css::uno::Reference< css::chart2::XChartType >& rxChartType );
103 };
104 
105 struct TypeGroupModel;
106 struct View3DModel;
107 
108 class TypeGroupConverter final : public ConverterBase< TypeGroupModel >
109 {
110 public:
111  explicit TypeGroupConverter( const ConverterRoot& rParent, TypeGroupModel& rModel );
112  virtual ~TypeGroupConverter() override;
113 
115  const TypeGroupInfo& getTypeInfo() const { return maTypeInfo; }
116 
118  bool isStacked() const;
120  bool isPercent() const;
122  bool is3dChart() const { return mb3dChart;}
124  bool isWall3dChart() const;
126  bool isDeep3dChart() const;
127 
129  bool isSeriesFrameFormat() const;
132 
134  OUString getSingleSeriesTitle() const;
135 
137  css::uno::Reference< css::chart2::XCoordinateSystem >
140  css::uno::Reference< css::chart2::data::XLabeledDataSequence >
142 
144  void convertFromModel(
145  const css::uno::Reference< css::chart2::XDiagram >& rxDiagram,
146  const css::uno::Reference< css::chart2::XCoordinateSystem >& rxCoordSystem,
147  sal_Int32 nAxesSetIdx, bool bSupportsVaryColorsByPoint );
148 
150  void convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize,
151  const ModelRef< Shape >& xShapeProps ) const;
153  void convertLineSmooth( PropertySet& rPropSet, bool bOoxSmooth ) const;
155  void convertBarGeometry( PropertySet& rPropSet, sal_Int32 nOoxShape ) const;
157  void convertPieRotation( PropertySet& rPropSet, sal_Int32 nOoxAngle ) const;
159  void convertPieExplosion( PropertySet& rPropSet, sal_Int32 nOoxExplosion ) const;
160 
161 private:
163  void insertDataSeries(
164  const css::uno::Reference< css::chart2::XChartType >& rxChartType,
165  const css::uno::Reference< css::chart2::XDataSeries >& rxSeries,
166  sal_Int32 nAxesSetIdx );
167 
168 private:
170  bool mb3dChart;
171 };
172 
173 } // namespace oox::drawingml::chart
174 
175 #endif
176 
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::chart2::XCoordinateSystem > createCoordinateSystem()
Creates a coordinate system according to the contained chart type.
void convertPieRotation(PropertySet &rPropSet, sal_Int32 nOoxAngle) const
Sets the passed OOXML pie rotation at the passed property set.
const char * mpcServiceName
Category this chart type belongs to.
bool is3dChart() const
Returns true, if the chart is three-dimensional.
bool isStacked() const
Returns true, if the series in this chart type group are stacked on each other (no percentage)...
bool mbPolarCoordSystem
Default data label position (API constant).
bool mbPictureOptions
True = data points can be stacked on each other.
TypeCategory meTypeCategory
Unique chart type identifier.
void insertDataSeries(const css::uno::Reference< css::chart2::XChartType > &rxChartType, const css::uno::Reference< css::chart2::XDataSeries > &rxSeries, sal_Int32 nAxesSetIdx)
Inserts the passed series into the chart type.
Base class of all converter classes.
css::uno::Reference< css::chart2::data::XLabeledDataSequence > createCategorySequence()
Creates a labeled data sequence object for axis categories.
bool mbSeriesIsFrame2d
True = polar, false = cartesian.
bool mbSupportsStacking
True = X axis and Y axis are swapped.
ObjectType getSeriesObjectType() const
Returns the object type for a series depending on the chart type.
bool isWall3dChart() const
Returns true, if chart type supports wall and floor format in 3D mode.
exports com.sun.star. chart2
void convertFromModel(const css::uno::Reference< css::chart2::XChartType > &rxChartType)
Converts the OOXML up/down bars.
ObjectType
Enumerates different object types for specific automatic formatting behaviour.
bool isDeep3dChart() const
Returns true, if the series in this chart type group are ordered on the Z axis.
TypeGroupConverter(const ConverterRoot &rParent, TypeGroupModel &rModel)
bool mb3dChart
Extended type info for contained chart type model.
bool mbSwappedAxesSet
True = X axis contains categories.
void convertFromModel(const css::uno::Reference< css::chart2::XDiagram > &rxDiagram, const css::uno::Reference< css::chart2::XCoordinateSystem > &rxCoordSystem, sal_Int32 nAxesSetIdx, bool bSupportsVaryColorsByPoint)
Converts the OOXML type group model into a chart2 coordinate system.
TypeId
Enumerates different chart types.
Contains info for a chart type related to the OpenOffice.org chart module.
VarPointMode meVarPointMode
Service name of the type.
const TypeGroupInfo & GetTypeGroupInfo(TypeId eType)
Bar charts (horizontal or vertical).
TypeCategory
Enumerates different categories of similar chart types.
Pie-to-pie or pie-to-bar chart.
void convertMarker(PropertySet &rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize, const ModelRef< Shape > &xShapeProps) const
Sets the passed OOXML marker style at the passed property set.
void convertLineSmooth(PropertySet &rPropSet, bool bOoxSmooth) const
Sets the passed OOXML line smoothing at the passed property set.
A wrapper for a UNO property set.
Definition: propertyset.hxx:57
sal_Int32 mnDefLabelPos
Mode for varying point colors.
UpDownBarsConverter(const ConverterRoot &rParent, UpDownBarsModel &rModel)
bool isPercent() const
Returns true, if the series in this chart type group are stacked on each other as percentage...
Line charts (line, area, stock charts).
Radar charts (linear or filled).
void convertBarGeometry(PropertySet &rPropSet, sal_Int32 nOoxShape) const
Sets the passed OOXML bar 3D geometry at the passed property set.
bool mbSingleSeriesVis
True = 2D type series with area formatting.
bool isSeriesFrameFormat() const
Returns true, if this chart type supports area formatting for its series.
bool mbCategoryAxis
True = only first series visible (e.g. pie charts).
Only supported, if type group contains only one series.
VarPointMode
Enumerates modes for varying point colors in a series.
void convertPieExplosion(PropertySet &rPropSet, sal_Int32 nOoxExplosion) const
Sets the passed OOXML pie explosion at the passed property set.
OUString getSingleSeriesTitle() const
Returns series title, if the chart type group contains only one single series.
const TypeGroupInfo & getTypeInfo() const
Returns the type info struct that describes this chart type group.