1*e3508121SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*e3508121SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*e3508121SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*e3508121SAndrew Rist  * distributed with this work for additional information
6*e3508121SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*e3508121SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*e3508121SAndrew Rist  * "License"); you may not use this file except in compliance
9*e3508121SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e3508121SAndrew Rist  *
11*e3508121SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e3508121SAndrew Rist  *
13*e3508121SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*e3508121SAndrew Rist  * software distributed under the License is distributed on an
15*e3508121SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e3508121SAndrew Rist  * KIND, either express or implied.  See the License for the
17*e3508121SAndrew Rist  * specific language governing permissions and limitations
18*e3508121SAndrew Rist  * under the License.
19*e3508121SAndrew Rist  *
20*e3508121SAndrew Rist  *************************************************************/
21*e3508121SAndrew Rist 
22*e3508121SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef OOX_DRAWINGML_CHART_SERIESMODEL_HXX
25cdf0e10cSrcweir #define OOX_DRAWINGML_CHART_SERIESMODEL_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "oox/drawingml/chart/datasourcemodel.hxx"
28cdf0e10cSrcweir #include "oox/drawingml/chart/titlemodel.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace oox {
31cdf0e10cSrcweir namespace drawingml {
32cdf0e10cSrcweir namespace chart {
33cdf0e10cSrcweir 
34cdf0e10cSrcweir // ============================================================================
35cdf0e10cSrcweir 
36cdf0e10cSrcweir struct DataLabelModelBase
37cdf0e10cSrcweir {
38cdf0e10cSrcweir     typedef ModelRef< Shape >       ShapeRef;
39cdf0e10cSrcweir     typedef ModelRef< TextBody >    TextBodyRef;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     ShapeRef            mxShapeProp;        /// Data label frame formatting.
42cdf0e10cSrcweir     TextBodyRef         mxTextProp;         /// Data label text formatting.
43cdf0e10cSrcweir     NumberFormat        maNumberFormat;     /// Number format for numeric data labels.
44cdf0e10cSrcweir     OptValue< ::rtl::OUString > moaSeparator;/// Separator between label components.
45cdf0e10cSrcweir     OptValue< sal_Int32 > monLabelPos;      /// Data label position.
46cdf0e10cSrcweir     OptValue< bool >    mobShowBubbleSize;  /// True = show size of bubbles in bubble charts.
47cdf0e10cSrcweir     OptValue< bool >    mobShowCatName;     /// True = show category name of data points.
48cdf0e10cSrcweir     OptValue< bool >    mobShowLegendKey;   /// True = show legend key of data series.
49cdf0e10cSrcweir     OptValue< bool >    mobShowPercent;     /// True = show percentual value in pie/doughnut charts.
50cdf0e10cSrcweir     OptValue< bool >    mobShowSerName;     /// True = show series name.
51cdf0e10cSrcweir     OptValue< bool >    mobShowVal;         /// True = show data point value.
52cdf0e10cSrcweir     bool                mbDeleted;          /// True = data label(s) deleted.
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     explicit            DataLabelModelBase();
55cdf0e10cSrcweir                         ~DataLabelModelBase();
56cdf0e10cSrcweir };
57cdf0e10cSrcweir 
58cdf0e10cSrcweir // ============================================================================
59cdf0e10cSrcweir 
60cdf0e10cSrcweir struct DataLabelModel : public DataLabelModelBase
61cdf0e10cSrcweir {
62cdf0e10cSrcweir     typedef ModelRef< LayoutModel > LayoutRef;
63cdf0e10cSrcweir     typedef ModelRef< TextModel >   TextRef;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     LayoutRef           mxLayout;           /// Layout/position of the data point label frame.
66cdf0e10cSrcweir     TextRef             mxText;             /// Manual or linked text for this data point label.
67cdf0e10cSrcweir     sal_Int32           mnIndex;            /// Data point index for this data label.
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     explicit            DataLabelModel();
70cdf0e10cSrcweir                         ~DataLabelModel();
71cdf0e10cSrcweir };
72cdf0e10cSrcweir 
73cdf0e10cSrcweir // ============================================================================
74cdf0e10cSrcweir 
75cdf0e10cSrcweir struct DataLabelsModel : public DataLabelModelBase
76cdf0e10cSrcweir {
77cdf0e10cSrcweir     typedef ModelVector< DataLabelModel >   DataLabelVector;
78cdf0e10cSrcweir     typedef ModelRef< Shape >               ShapeRef;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     DataLabelVector     maPointLabels;      /// Settings for individual data point labels.
81cdf0e10cSrcweir     ShapeRef            mxLeaderLines;      /// Formatting of connector lines between data points and labels.
82cdf0e10cSrcweir     bool                mbShowLeaderLines;  /// True = show connector lines between data points and labels.
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     explicit            DataLabelsModel();
85cdf0e10cSrcweir                         ~DataLabelsModel();
86cdf0e10cSrcweir };
87cdf0e10cSrcweir 
88cdf0e10cSrcweir // ============================================================================
89cdf0e10cSrcweir 
90cdf0e10cSrcweir struct PictureOptionsModel
91cdf0e10cSrcweir {
92cdf0e10cSrcweir     double              mfStackUnit;        /// Bitmap stacking unit.
93cdf0e10cSrcweir     sal_Int32           mnPictureFormat;    /// Bitmap mode (stretch/tile).
94cdf0e10cSrcweir     bool                mbApplyToFront;     /// True = draw picture at front/back side of 3D data points.
95cdf0e10cSrcweir     bool                mbApplyToSides;     /// True = draw picture at left/right side of 3D data points.
96cdf0e10cSrcweir     bool                mbApplyToEnd;       /// True = draw picture at top/bottom side of 3D data points.
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     explicit            PictureOptionsModel();
99cdf0e10cSrcweir                         ~PictureOptionsModel();
100cdf0e10cSrcweir };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir // ============================================================================
103cdf0e10cSrcweir 
104cdf0e10cSrcweir struct ErrorBarModel
105cdf0e10cSrcweir {
106cdf0e10cSrcweir     enum SourceType
107cdf0e10cSrcweir     {
108cdf0e10cSrcweir         PLUS,               /// Plus error bar values.
109cdf0e10cSrcweir         MINUS               /// Minus error bar values.
110cdf0e10cSrcweir     };
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     typedef ModelMap< SourceType, DataSourceModel > DataSourceMap;
113cdf0e10cSrcweir     typedef ModelRef< Shape >                       ShapeRef;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     DataSourceMap       maSources;          /// Source ranges for manual error bar values.
116cdf0e10cSrcweir     ShapeRef            mxShapeProp;        /// Error line formatting.
117cdf0e10cSrcweir     double              mfValue;            /// Fixed value for several error bar types.
118cdf0e10cSrcweir     sal_Int32           mnDirection;        /// Direction of the error bars (x/y).
119cdf0e10cSrcweir     sal_Int32           mnTypeId;           /// Type of the error bars (plus/minus/both).
120cdf0e10cSrcweir     sal_Int32           mnValueType;        /// Type of the values.
121cdf0e10cSrcweir     bool                mbNoEndCap;         /// True = no end cap at error bar lines.
122cdf0e10cSrcweir 
123cdf0e10cSrcweir     explicit            ErrorBarModel();
124cdf0e10cSrcweir                         ~ErrorBarModel();
125cdf0e10cSrcweir };
126cdf0e10cSrcweir 
127cdf0e10cSrcweir // ============================================================================
128cdf0e10cSrcweir 
129cdf0e10cSrcweir struct TrendlineLabelModel
130cdf0e10cSrcweir {
131cdf0e10cSrcweir     typedef ModelRef< Shape >       ShapeRef;
132cdf0e10cSrcweir     typedef ModelRef< TextBody >    TextBodyRef;
133cdf0e10cSrcweir     typedef ModelRef< LayoutModel > LayoutRef;
134cdf0e10cSrcweir     typedef ModelRef< TextModel >   TextRef;
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     ShapeRef            mxShapeProp;        /// Label frame formatting.
137cdf0e10cSrcweir     TextBodyRef         mxTextProp;         /// Label text formatting.
138cdf0e10cSrcweir     LayoutRef           mxLayout;           /// Layout/position of the frame.
139cdf0e10cSrcweir     TextRef             mxText;             /// Text source of the label.
140cdf0e10cSrcweir     NumberFormat        maNumberFormat;     /// Number format for coefficients.
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     explicit            TrendlineLabelModel();
143cdf0e10cSrcweir                         ~TrendlineLabelModel();
144cdf0e10cSrcweir };
145cdf0e10cSrcweir 
146cdf0e10cSrcweir // ============================================================================
147cdf0e10cSrcweir 
148cdf0e10cSrcweir struct TrendlineModel
149cdf0e10cSrcweir {
150cdf0e10cSrcweir     typedef ModelRef< Shape >               ShapeRef;
151cdf0e10cSrcweir     typedef ModelRef< TrendlineLabelModel > TrendlineLabelRef;
152cdf0e10cSrcweir 
153cdf0e10cSrcweir     ShapeRef            mxShapeProp;        /// Trendline formatting.
154cdf0e10cSrcweir     TrendlineLabelRef   mxLabel;            /// Trendline label text object.
155cdf0e10cSrcweir     ::rtl::OUString     maName;             /// User-defined name of the trendline.
156cdf0e10cSrcweir     OptValue< double >  mfBackward;         /// Size of trendline before first data point.
157cdf0e10cSrcweir     OptValue< double >  mfForward;          /// Size of trendline behind last data point.
158cdf0e10cSrcweir     OptValue< double >  mfIntercept;        /// Crossing point with Y axis.
159cdf0e10cSrcweir     sal_Int32           mnOrder;            /// Polynomial order in range [2, 6].
160cdf0e10cSrcweir     sal_Int32           mnPeriod;           /// Moving average period in range [2, 255].
161cdf0e10cSrcweir     sal_Int32           mnTypeId;           /// Type of the trendline.
162cdf0e10cSrcweir     bool                mbDispEquation;     /// True = show equation of the trendline.
163cdf0e10cSrcweir     bool                mbDispRSquared;     /// True = show R-squared of the trendline.
164cdf0e10cSrcweir 
165cdf0e10cSrcweir     explicit            TrendlineModel();
166cdf0e10cSrcweir                         ~TrendlineModel();
167cdf0e10cSrcweir };
168cdf0e10cSrcweir 
169cdf0e10cSrcweir // ============================================================================
170cdf0e10cSrcweir 
171cdf0e10cSrcweir struct DataPointModel
172cdf0e10cSrcweir {
173cdf0e10cSrcweir     typedef ModelRef< Shape >               ShapeRef;
174cdf0e10cSrcweir     typedef ModelRef< PictureOptionsModel > PictureOptionsRef;
175cdf0e10cSrcweir 
176cdf0e10cSrcweir     ShapeRef            mxShapeProp;        /// Data point formatting.
177cdf0e10cSrcweir     PictureOptionsRef   mxPicOptions;       /// Fill bitmap settings.
178cdf0e10cSrcweir     ShapeRef            mxMarkerProp;       /// Data point marker formatting.
179cdf0e10cSrcweir     OptValue< sal_Int32 > monExplosion;     /// Pie slice moved from pie center.
180cdf0e10cSrcweir     OptValue< sal_Int32 > monMarkerSize;    /// Size of the series line marker (2...72).
181cdf0e10cSrcweir     OptValue< sal_Int32 > monMarkerSymbol;  /// Series line marker symbol.
182cdf0e10cSrcweir     OptValue< bool >    mobBubble3d;        /// True = show bubbles with 3D shade.
183cdf0e10cSrcweir     sal_Int32           mnIndex;            /// Unique data point index.
184cdf0e10cSrcweir     bool                mbInvertNeg;        /// True = invert negative data points (not derived from series!).
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     explicit            DataPointModel();
187cdf0e10cSrcweir                         ~DataPointModel();
188cdf0e10cSrcweir };
189cdf0e10cSrcweir 
190cdf0e10cSrcweir // ============================================================================
191cdf0e10cSrcweir 
192cdf0e10cSrcweir struct SeriesModel
193cdf0e10cSrcweir {
194cdf0e10cSrcweir     enum SourceType
195cdf0e10cSrcweir     {
196cdf0e10cSrcweir         CATEGORIES,         /// Data point categories.
197cdf0e10cSrcweir         VALUES,             /// Data point values.
198cdf0e10cSrcweir         POINTS              /// Data point size (e.g. bubble size in bubble charts).
199cdf0e10cSrcweir     };
200cdf0e10cSrcweir 
201cdf0e10cSrcweir     typedef ModelMap< SourceType, DataSourceModel > DataSourceMap;
202cdf0e10cSrcweir     typedef ModelVector< ErrorBarModel >            ErrorBarVector;
203cdf0e10cSrcweir     typedef ModelVector< TrendlineModel >           TrendlineVector;
204cdf0e10cSrcweir     typedef ModelVector< DataPointModel >           DataPointVector;
205cdf0e10cSrcweir     typedef ModelRef< Shape >                       ShapeRef;
206cdf0e10cSrcweir     typedef ModelRef< PictureOptionsModel >         PictureOptionsRef;
207cdf0e10cSrcweir     typedef ModelRef< TextModel >                   TextRef;
208cdf0e10cSrcweir     typedef ModelRef< DataLabelsModel >             DataLabelsRef;
209cdf0e10cSrcweir 
210cdf0e10cSrcweir     DataSourceMap       maSources;          /// Series source ranges.
211cdf0e10cSrcweir     ErrorBarVector      maErrorBars;        /// All error bars of this series.
212cdf0e10cSrcweir     TrendlineVector     maTrendlines;       /// All trendlines of this series.
213cdf0e10cSrcweir     DataPointVector     maPoints;           /// Explicit formatted data points.
214cdf0e10cSrcweir     ShapeRef            mxShapeProp;        /// Series formatting.
215cdf0e10cSrcweir     PictureOptionsRef   mxPicOptions;       /// Fill bitmap settings.
216cdf0e10cSrcweir     ShapeRef            mxMarkerProp;       /// Data point marker formatting.
217cdf0e10cSrcweir     TextRef             mxText;             /// Series title source.
218cdf0e10cSrcweir     DataLabelsRef       mxLabels;           /// Data point label settings for all points.
219cdf0e10cSrcweir     OptValue< sal_Int32 > monShape;         /// 3D bar shape type.
220cdf0e10cSrcweir     sal_Int32           mnExplosion;        /// Pie slice moved from pie center.
221cdf0e10cSrcweir     sal_Int32           mnIndex;            /// Series index used for automatic formatting.
222cdf0e10cSrcweir     sal_Int32           mnMarkerSize;       /// Size of the series line marker (2...72).
223cdf0e10cSrcweir     sal_Int32           mnMarkerSymbol;     /// Series line marker symbol.
224cdf0e10cSrcweir     sal_Int32           mnOrder;            /// Series order.
225cdf0e10cSrcweir     bool                mbBubble3d;         /// True = show bubbles with 3D shade.
226cdf0e10cSrcweir     bool                mbInvertNeg;        /// True = invert negative data points.
227cdf0e10cSrcweir     bool                mbSmooth;           /// True = smooth series line.
228cdf0e10cSrcweir 
229cdf0e10cSrcweir     explicit            SeriesModel();
230cdf0e10cSrcweir                         ~SeriesModel();
231cdf0e10cSrcweir };
232cdf0e10cSrcweir 
233cdf0e10cSrcweir // ============================================================================
234cdf0e10cSrcweir 
235cdf0e10cSrcweir } // namespace chart
236cdf0e10cSrcweir } // namespace drawingml
237cdf0e10cSrcweir } // namespace oox
238cdf0e10cSrcweir 
239cdf0e10cSrcweir #endif
240