LibreOffice Module oox (master) 1
objectformatter.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_OBJECTFORMATTER_HXX
21#define INCLUDED_OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
22
26
27namespace com::sun::star {
28 namespace chart2 { class XChartDocument; }
29}
30
31namespace oox::core { class XmlFilterBase; }
32
33namespace oox::drawingml::chart {
34
37{
64};
65
66struct ChartSpaceModel;
67struct ObjectFormatterData;
68struct PictureOptionsModel;
69
71{
72public:
73 explicit ObjectFormatter(
74 const ::oox::core::XmlFilterBase& rFilter,
75 const css::uno::Reference< css::chart2::XChartDocument >& rxChartDoc,
76 const ChartSpaceModel& rChartSpace );
78
80 void setMaxSeriesIndex( sal_Int32 nMaxSeriesIdx );
82 sal_Int32 getMaxSeriesIndex() const;
83
86 PropertySet& rPropSet,
87 const ModelRef< Shape >& rxShapeProp,
88 ObjectType eObjType,
89 sal_Int32 nSeriesIdx = -1 );
90
93 PropertySet& rPropSet,
94 const ModelRef< Shape >& rxShapeProp,
95 const PictureOptionsModel& rPicOptions,
96 ObjectType eObjType,
97 sal_Int32 nSeriesIdx = -1 );
98
101 PropertySet& rPropSet,
102 const ModelRef< TextBody >& rxTextProp,
103 ObjectType eObjType );
104
107 PropertySet& rPropSet,
108 const ModelRef< Shape >& rxShapeProp,
109 const ModelRef< TextBody >& rxTextProp,
110 ObjectType eObjType );
111
114 PropertySet& rPropSet,
115 const TextCharacterProperties& rTextProps,
116 ObjectType eObjType );
117
119 static void convertTextRotation(
120 PropertySet& rPropSet,
121 const ModelRef< TextBody >& rxTextProp,
122 bool bSupportsStacked, sal_Int32 nDefaultRotation = 0);
123
125 static void convertTextWrap(
126 PropertySet& rPropSet,
127 const ModelRef< TextBody >& rxTextProp);
128
131 PropertySet& rPropSet,
132 const NumberFormat& rNumberFormat,
133 bool bAxis,
134 bool bShowPercent = false );
135
138 PropertySet& rPropSet,
139 ObjectType eObjType,
140 sal_Int32 nSeriesIdx );
141
143 static bool isAutomaticFill( const ModelRef< Shape >& rxShapeProp );
144
145private:
146 std::shared_ptr< ObjectFormatterData > mxData;
147};
148
149} // namespace oox::drawingml::chart
150
151#endif
152
153/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A wrapper for a UNO property set.
Definition: propertyset.hxx:58
void convertFrameFormatting(PropertySet &rPropSet, const ModelRef< Shape > &rxShapeProp, ObjectType eObjType, sal_Int32 nSeriesIdx=-1)
Sets frame formatting properties to the passed property set.
sal_Int32 getMaxSeriesIndex() const
Returns the current maximum series index used for color cycling/fading.
void convertAutomaticFill(PropertySet &rPropSet, ObjectType eObjType, sal_Int32 nSeriesIdx)
Sets automatic fill properties to the passed property set.
void convertTextFormatting(PropertySet &rPropSet, const ModelRef< TextBody > &rxTextProp, ObjectType eObjType)
Sets text formatting properties to the passed property set.
std::shared_ptr< ObjectFormatterData > mxData
ObjectFormatter(const ::oox::core::XmlFilterBase &rFilter, const css::uno::Reference< css::chart2::XChartDocument > &rxChartDoc, const ChartSpaceModel &rChartSpace)
void convertFormatting(PropertySet &rPropSet, const ModelRef< Shape > &rxShapeProp, const ModelRef< TextBody > &rxTextProp, ObjectType eObjType)
Sets frame/text formatting properties to the passed property set.
void convertNumberFormat(PropertySet &rPropSet, const NumberFormat &rNumberFormat, bool bAxis, bool bShowPercent=false)
Sets number format properties to the passed property set.
void setMaxSeriesIndex(sal_Int32 nMaxSeriesIdx)
Sets the maximum series index used for color cycling/fading.
static void convertTextWrap(PropertySet &rPropSet, const ModelRef< TextBody > &rxTextProp)
Sets text wrap properties to the passed property set.
static void convertTextRotation(PropertySet &rPropSet, const ModelRef< TextBody > &rxTextProp, bool bSupportsStacked, sal_Int32 nDefaultRotation=0)
Sets text rotation properties to the passed property set.
static bool isAutomaticFill(const ModelRef< Shape > &rxShapeProp)
Returns true, if the passed shape properties have automatic fill mode.
ObjectType
Enumerates different object types for specific automatic formatting behaviour.
@ OBJECTTYPE_PLOTAREA3D
Plot area containing axes and data series in 2D charts.
@ OBJECTTYPE_ERRORBAR
Trend line label.
@ OBJECTTYPE_FILLEDSERIES2D
Linear series in 2D line/radarline/scatter charts.
@ OBJECTTYPE_FLOOR
Background and side wall in 3D charts.
@ OBJECTTYPE_AXIS
Floor in 3D charts.
@ OBJECTTYPE_MINORGRIDLINE
Axis major grid line.
@ OBJECTTYPE_TRENDLINELABEL
Data series trend line.
@ OBJECTTYPE_DATATABLE
Down-bar in line/stock charts.
@ OBJECTTYPE_HILOLINE
Drop lines between data points and X axis.
@ OBJECTTYPE_AXISTITLE
Axis line, labels, tick marks.
@ OBJECTTYPE_FILLEDSERIES3D
Filled series in 2D bar/area/radararea/bubble/pie/surface charts.
@ OBJECTTYPE_DATALABEL
Filled series in 3D charts.
@ OBJECTTYPE_LINEARSERIES2D
Axis minor grid line.
@ OBJECTTYPE_WALL
Plot area containing axes and data series in 3D charts.
@ OBJECTTYPE_LEGEND
Chart title.
@ OBJECTTYPE_CHARTTITLE
Chart background.
@ OBJECTTYPE_UPBAR
High/low lines in line/stock charts.
@ OBJECTTYPE_AXISUNIT
Axis title.
@ OBJECTTYPE_MAJORGRIDLINE
Axis unit label.
@ OBJECTTYPE_LEADERLINE
Data point connector lines.
@ OBJECTTYPE_SERLINE
Data series error indicator line.
@ OBJECTTYPE_DROPLINE
Leader lines between pie slice and data label.
@ OBJECTTYPE_DOWNBAR
Up-bar in line/stock charts.
@ OBJECTTYPE_TRENDLINE
Labels for data points.