bump product version to 4.1.6.2
[LibreOffice.git] / oox / source / drawingml / chart / plotareacontext.cxx
blob4b2288da1d870ba508111a31ed2bfa76fa438602
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "oox/drawingml/chart/plotareacontext.hxx"
22 #include "oox/drawingml/shapepropertiescontext.hxx"
23 #include "oox/drawingml/chart/axiscontext.hxx"
24 #include "oox/drawingml/chart/plotareamodel.hxx"
25 #include "oox/drawingml/chart/seriescontext.hxx"
26 #include "oox/drawingml/chart/titlecontext.hxx"
27 #include "oox/drawingml/chart/typegroupcontext.hxx"
29 namespace oox {
30 namespace drawingml {
31 namespace chart {
33 // ============================================================================
35 using ::oox::core::ContextHandler2Helper;
36 using ::oox::core::ContextHandlerRef;
38 // ============================================================================
40 View3DContext::View3DContext( ContextHandler2Helper& rParent, View3DModel& rModel ) :
41 ContextBase< View3DModel >( rParent, rModel )
45 View3DContext::~View3DContext()
49 ContextHandlerRef View3DContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
51 switch( getCurrentElement() )
53 case C_TOKEN( view3D ):
54 switch( nElement )
56 case C_TOKEN( depthPercent ):
57 mrModel.mnDepthPercent = rAttribs.getInteger( XML_val, 100 );
58 return 0;
59 case C_TOKEN( hPercent ):
60 mrModel.monHeightPercent = rAttribs.getInteger( XML_val, 100 );
61 return 0;
62 case C_TOKEN( perspective ):
63 mrModel.mnPerspective = rAttribs.getInteger( XML_val, 30 );
64 return 0;
65 case C_TOKEN( rAngAx ):
66 // default is 'false', not 'true' as specified
67 mrModel.mbRightAngled = rAttribs.getBool( XML_val, false );
68 return 0;
69 case C_TOKEN( rotX ):
70 // default value dependent on chart type
71 mrModel.monRotationX = rAttribs.getInteger( XML_val );
72 return 0;
73 case C_TOKEN( rotY ):
74 // default value dependent on chart type
75 mrModel.monRotationY = rAttribs.getInteger( XML_val );
76 return 0;
78 break;
80 return 0;
83 // ============================================================================
85 WallFloorContext::WallFloorContext( ContextHandler2Helper& rParent, WallFloorModel& rModel ) :
86 ContextBase< WallFloorModel >( rParent, rModel )
90 WallFloorContext::~WallFloorContext()
94 ContextHandlerRef WallFloorContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
96 switch( getCurrentElement() )
98 case C_TOKEN( backWall ):
99 case C_TOKEN( floor ):
100 case C_TOKEN( sideWall ):
101 switch( nElement )
103 case C_TOKEN( pictureOptions ):
104 return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
105 case C_TOKEN( spPr ):
106 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
108 break;
110 return 0;
113 // ============================================================================
115 PlotAreaContext::PlotAreaContext( ContextHandler2Helper& rParent, PlotAreaModel& rModel ) :
116 ContextBase< PlotAreaModel >( rParent, rModel )
120 PlotAreaContext::~PlotAreaContext()
124 ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
126 switch( getCurrentElement() )
128 case C_TOKEN( plotArea ):
129 switch( nElement )
131 case C_TOKEN( area3DChart ):
132 case C_TOKEN( areaChart ):
133 return new AreaTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
134 case C_TOKEN( bar3DChart ):
135 case C_TOKEN( barChart ):
136 return new BarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
137 case C_TOKEN( bubbleChart ):
138 return new BubbleTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
139 case C_TOKEN( line3DChart ):
140 case C_TOKEN( lineChart ):
141 case C_TOKEN( stockChart ):
142 return new LineTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
143 case C_TOKEN( doughnutChart ):
144 case C_TOKEN( ofPieChart ):
145 case C_TOKEN( pie3DChart ):
146 case C_TOKEN( pieChart ):
147 return new PieTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
148 case C_TOKEN( radarChart ):
149 return new RadarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
150 case C_TOKEN( scatterChart ):
151 return new ScatterTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
152 case C_TOKEN( surface3DChart ):
153 case C_TOKEN( surfaceChart ):
154 return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
156 case C_TOKEN( catAx ):
157 return new CatAxisContext( *this, mrModel.maAxes.create( nElement ) );
158 case C_TOKEN( dateAx ):
159 return new DateAxisContext( *this, mrModel.maAxes.create( nElement ) );
160 case C_TOKEN( serAx ):
161 return new SerAxisContext( *this, mrModel.maAxes.create( nElement ) );
162 case C_TOKEN( valAx ):
163 return new ValAxisContext( *this, mrModel.maAxes.create( nElement ) );
165 case C_TOKEN( layout ):
166 return new LayoutContext( *this, mrModel.mxLayout.create() );
167 case C_TOKEN( spPr ):
168 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
170 break;
172 return 0;
175 // ============================================================================
177 } // namespace chart
178 } // namespace drawingml
179 } // namespace oox
181 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */