bump product version to 4.1.6.2
[LibreOffice.git] / include / oox / drawingml / chart / objectformatter.hxx
blob5b2bb727f4fd3aa50d7328731af9e74b0ceba70a
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 #ifndef OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
21 #define OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
23 #include "oox/helper/propertyset.hxx"
24 #include "oox/drawingml/drawingmltypes.hxx"
25 #include "oox/drawingml/chart/modelbase.hxx"
27 namespace com { namespace sun { namespace star {
28 namespace chart2 { class XChartDocument; }
29 } } }
31 namespace oox { namespace core { class XmlFilterBase; } }
33 namespace oox {
34 namespace drawingml {
35 namespace chart {
37 // ============================================================================
39 /** Enumerates different object types for specific automatic formatting behaviour. */
40 enum ObjectType
42 OBJECTTYPE_CHARTSPACE, /// Chart background.
43 OBJECTTYPE_CHARTTITLE, /// Chart title.
44 OBJECTTYPE_LEGEND, /// Legend.
45 OBJECTTYPE_PLOTAREA2D, /// Plot area containing axes and data series in 2D charts.
46 OBJECTTYPE_PLOTAREA3D, /// Plot area containing axes and data series in 3D charts.
47 OBJECTTYPE_WALL, /// Background and side wall in 3D charts.
48 OBJECTTYPE_FLOOR, /// Floor in 3D charts.
49 OBJECTTYPE_AXIS, /// Axis line, labels, tick marks.
50 OBJECTTYPE_AXISTITLE, /// Axis title.
51 OBJECTTYPE_AXISUNIT, /// Axis unit label.
52 OBJECTTYPE_MAJORGRIDLINE, /// Axis major grid line.
53 OBJECTTYPE_MINORGRIDLINE, /// Axis minor grid line.
54 OBJECTTYPE_LINEARSERIES2D, /// Linear series in 2D line/radarline/scatter charts.
55 OBJECTTYPE_FILLEDSERIES2D, /// Filled series in 2D bar/area/radararea/bubble/pie/surface charts.
56 OBJECTTYPE_FILLEDSERIES3D, /// Filled series in 3D charts.
57 OBJECTTYPE_DATALABEL, /// Labels for data points.
58 OBJECTTYPE_TRENDLINE, /// Data series trend line.
59 OBJECTTYPE_TRENDLINELABEL, /// Trend line label.
60 OBJECTTYPE_ERRORBAR, /// Data series error indicator line.
61 OBJECTTYPE_SERLINE, /// Data point connector lines.
62 OBJECTTYPE_LEADERLINE, /// Leader lines between pie slice and data label.
63 OBJECTTYPE_DROPLINE, /// Drop lines between data points and X axis.
64 OBJECTTYPE_HILOLINE, /// High/low lines in line/stock charts.
65 OBJECTTYPE_UPBAR, /// Up-bar in line/stock charts.
66 OBJECTTYPE_DOWNBAR, /// Down-bar in line/stock charts.
67 OBJECTTYPE_DATATABLE /// Data table.
70 // ============================================================================
72 struct ChartSpaceModel;
73 struct ObjectFormatterData;
74 struct PictureOptionsModel;
76 class ObjectFormatter
78 public:
79 explicit ObjectFormatter(
80 const ::oox::core::XmlFilterBase& rFilter,
81 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
82 const ChartSpaceModel& rChartSpace );
83 ~ObjectFormatter();
85 /** Sets the maximum series index used for color cycling/fading. */
86 void setMaxSeriesIndex( sal_Int32 nMaxSeriesIdx );
87 /** Returns the current maximum series index used for color cycling/fading. */
88 sal_Int32 getMaxSeriesIndex() const;
90 /** Sets frame formatting properties to the passed property set. */
91 void convertFrameFormatting(
92 PropertySet& rPropSet,
93 const ModelRef< Shape >& rxShapeProp,
94 ObjectType eObjType,
95 sal_Int32 nSeriesIdx = -1 );
97 /** Sets frame formatting properties to the passed property set. */
98 void convertFrameFormatting(
99 PropertySet& rPropSet,
100 const ModelRef< Shape >& rxShapeProp,
101 const PictureOptionsModel& rPicOptions,
102 ObjectType eObjType,
103 sal_Int32 nSeriesIdx = -1 );
105 /** Sets text formatting properties to the passed property set. */
106 void convertTextFormatting(
107 PropertySet& rPropSet,
108 const ModelRef< TextBody >& rxTextProp,
109 ObjectType eObjType );
111 /** Sets frame/text formatting properties to the passed property set. */
112 void convertFormatting(
113 PropertySet& rPropSet,
114 const ModelRef< Shape >& rxShapeProp,
115 const ModelRef< TextBody >& rxTextProp,
116 ObjectType eObjType );
118 /** Sets text formatting properties to the passed property set. */
119 void convertTextFormatting(
120 PropertySet& rPropSet,
121 const TextCharacterProperties& rTextProps,
122 ObjectType eObjType );
124 /** Sets text rotation properties to the passed property set. */
125 void convertTextRotation(
126 PropertySet& rPropSet,
127 const ModelRef< TextBody >& rxTextProp,
128 bool bSupportsStacked );
130 /** Sets number format properties to the passed property set. */
131 void convertNumberFormat(
132 PropertySet& rPropSet,
133 const NumberFormat& rNumberFormat,
134 bool bPercentFormat = false );
136 /** Sets automatic fill properties to the passed property set. */
137 void convertAutomaticFill(
138 PropertySet& rPropSet,
139 ObjectType eObjType,
140 sal_Int32 nSeriesIdx = -1 );
142 /** Returns true, if the passed shape properties have automatic fill mode. */
143 static bool isAutomaticFill( const ModelRef< Shape >& rxShapeProp );
145 private:
146 ::boost::shared_ptr< ObjectFormatterData > mxData;
149 // ============================================================================
151 } // namespace chart
152 } // namespace drawingml
153 } // namespace oox
155 #endif
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */