1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef OOX_DRAWINGML_CHART_PLOTAREACONVERTER_HXX
25 #define OOX_DRAWINGML_CHART_PLOTAREACONVERTER_HXX
26 
27 #include "oox/drawingml/chart/converterbase.hxx"
28 
29 namespace com { namespace sun { namespace star {
30     namespace chart2 { class XDiagram; }
31 } } }
32 
33 namespace oox {
34 namespace drawingml {
35 namespace chart {
36 
37 // ============================================================================
38 
39 struct View3DModel;
40 class TypeGroupConverter;
41 
42 class View3DConverter : public ConverterBase< View3DModel >
43 {
44 public:
45     explicit            View3DConverter( const ConverterRoot& rParent, View3DModel& rModel );
46     virtual             ~View3DConverter();
47 
48     /** Converts the OOXML plot area model to a chart2 diagram. */
49     void                convertFromModel(
50                             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& rxDiagram,
51                             TypeGroupConverter& rTypeGroup );
52 };
53 
54 // ============================================================================
55 
56 struct WallFloorModel;
57 
58 class WallFloorConverter : public ConverterBase< WallFloorModel >
59 {
60 public:
61     explicit            WallFloorConverter( const ConverterRoot& rParent, WallFloorModel& rModel );
62     virtual             ~WallFloorConverter();
63 
64     /** Converts the OOXML wall/floor model to a chart2 diagram. */
65     void                convertFromModel(
66                             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& rxDiagram,
67                             ObjectType eObjType );
68 };
69 
70 // ============================================================================
71 
72 struct PlotAreaModel;
73 
74 class PlotAreaConverter : public ConverterBase< PlotAreaModel >
75 {
76 public:
77     explicit            PlotAreaConverter( const ConverterRoot& rParent, PlotAreaModel& rModel );
78     virtual             ~PlotAreaConverter();
79 
80     /** Converts the OOXML plot area model to a chart2 diagram. */
81     void                convertFromModel( View3DModel& rView3DModel );
82     /** Converts the manual plot area position and size, if set. */
83     void                convertPositionFromModel();
84 
85     /** Returns the automatic chart title if the chart contains only one series. */
getAutomaticTitle() const86     inline const ::rtl::OUString& getAutomaticTitle() const { return maAutoTitle; }
87     /** Returns true, if the chart is three-dimensional. */
is3dChart() const88     inline bool         is3dChart() const { return mb3dChart; }
89     /** Returns true, if chart type supports wall and floor format in 3D mode. */
isWall3dChart() const90     inline bool         isWall3dChart() const { return mbWall3dChart; }
91 
92 private:
93     ::rtl::OUString     maAutoTitle;
94     bool                mb3dChart;
95     bool                mbWall3dChart;
96     bool                mbPieChart;
97 };
98 
99 // ============================================================================
100 
101 } // namespace chart
102 } // namespace drawingml
103 } // namespace oox
104 
105 #endif
106