Line data Source code
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_SC_SOURCE_FILTER_INC_XLCHART_HXX
21 : #define INCLUDED_SC_SOURCE_FILTER_INC_XLCHART_HXX
22 :
23 : // disable/enable support for varied point colors property
24 : #define EXC_CHART2_VARYCOLORSBY_PROP 0
25 : // disable/enable restriction to hair lines in 3D bar charts (#i83151#)
26 : #define EXC_CHART2_3DBAR_HAIRLINES_ONLY 1
27 :
28 : #include <map>
29 : #include <tools/gen.hxx>
30 : #include "fapihelper.hxx"
31 : #include <boost/shared_ptr.hpp>
32 :
33 : namespace com { namespace sun { namespace star {
34 : namespace container { class XNameContainer; }
35 : namespace lang { class XMultiServiceFactory; }
36 : namespace chart { class XChartDocument; }
37 : namespace chart2 { class XChartDocument; }
38 : namespace drawing { class XShape; }
39 : } } }
40 :
41 : class XclRoot;
42 :
43 : // Property names =============================================================
44 :
45 : // service names
46 : #define SERVICE_DRAWING_BITMAPTABLE "com.sun.star.drawing.BitmapTable"
47 : #define SERVICE_DRAWING_DASHTABLE "com.sun.star.drawing.DashTable"
48 : #define SERVICE_DRAWING_GRADIENTTABLE "com.sun.star.drawing.GradientTable"
49 : #define SERVICE_DRAWING_HATCHTABLE "com.sun.star.drawing.HatchTable"
50 :
51 : #define SERVICE_CHART2_AXIS "com.sun.star.chart2.Axis"
52 : #define SERVICE_CHART2_DATAPROVIDER "com.sun.star.chart2.data.DataProvider"
53 : #define SERVICE_CHART2_DATASERIES "com.sun.star.chart2.DataSeries"
54 : #define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram"
55 : #define SERVICE_CHART2_ERRORBAR "com.sun.star.chart2.ErrorBar"
56 : #define SERVICE_CHART2_LEGEND "com.sun.star.chart2.Legend"
57 : #define SERVICE_CHART2_TITLE "com.sun.star.chart2.Title"
58 :
59 : // property names
60 : #define EXC_CHPROP_ADDITIONALSHAPES "AdditionalShapes"
61 : #define EXC_CHPROP_ANCHORPOSITION "AnchorPosition"
62 : #define EXC_CHPROP_ARRANGEORDER "ArrangeOrder"
63 : #define EXC_CHPROP_ATTAXISINDEX "AttachedAxisIndex"
64 : #define EXC_CHPROP_ATTRIBDATAPOINTS "AttributedDataPoints"
65 : #define EXC_CHPROP_BLACKDAY "BlackDay"
66 : #define EXC_CHPROP_COLOR "Color"
67 : #define EXC_CHPROP_CONNECTBARS "ConnectBars"
68 : #define EXC_CHPROP_CROSSOVERPOSITION "CrossoverPosition"
69 : #define EXC_CHPROP_CROSSOVERVALUE "CrossoverValue"
70 : #define EXC_CHPROP_CURVESTYLE "CurveStyle"
71 : #define EXC_CHPROP_CURVENAME "CurveName"
72 : #define EXC_CHPROP_D3DCAMERAGEOMETRY "D3DCameraGeometry"
73 : #define EXC_CHPROP_D3DSCENEAMBIENTCOLOR "D3DSceneAmbientColor"
74 : #define EXC_CHPROP_D3DSCENELIGHTON1 "D3DSceneLightOn1"
75 : #define EXC_CHPROP_D3DSCENELIGHTCOLOR2 "D3DSceneLightColor2"
76 : #define EXC_CHPROP_D3DSCENELIGHTDIR2 "D3DSceneLightDirection2"
77 : #define EXC_CHPROP_D3DSCENELIGHTON2 "D3DSceneLightOn2"
78 : #define EXC_CHPROP_D3DSCENEPERSPECTIVE "D3DScenePerspective"
79 : #define EXC_CHPROP_D3DSCENESHADEMODE "D3DSceneShadeMode"
80 : #define EXC_CHPROP_D3DTRANSFORMMATRIX "D3DTransformMatrix"
81 : #define EXC_CHPROP_DISPLAYLABELS "DisplayLabels"
82 : #define EXC_CHPROP_ERRORBARSTYLE "ErrorBarStyle"
83 : #define EXC_CHPROP_ERRORBARX "ErrorBarX"
84 : #define EXC_CHPROP_ERRORBARY "ErrorBarY"
85 : #define EXC_CHPROP_EXPANSION "Expansion"
86 : #define EXC_CHPROP_EXPTIMEINCREMENT "ExplicitTimeIncrement"
87 : #define EXC_CHPROP_EXTRAPOLATE_FORWARD "ExtrapolateForward"
88 : #define EXC_CHPROP_EXTRAPOLATE_BACKWARD "ExtrapolateBackward"
89 : #define EXC_CHPROP_FILLBITMAPMODE "FillBitmapMode"
90 : #define EXC_CHPROP_FILLSTYLE "FillStyle"
91 : #define EXC_CHPROP_FORCE_INTERCEPT "ForceIntercept"
92 : #define EXC_CHPROP_GAPWIDTHSEQ "GapwidthSequence"
93 : #define EXC_CHPROP_GEOMETRY3D "Geometry3D"
94 : #define EXC_CHPROP_HASMAINTITLE "HasMainTitle"
95 : #define EXC_CHPROP_INCLUDEHIDDENCELLS "IncludeHiddenCells"
96 : #define EXC_CHPROP_INTERCEPT_VALUE "InterceptValue"
97 : #define EXC_CHPROP_JAPANESE "Japanese"
98 : #define EXC_CHPROP_LABEL "Label"
99 : #define EXC_CHPROP_LABELPLACEMENT "LabelPlacement"
100 : #define EXC_CHPROP_LABELPOSITION "LabelPosition"
101 : #define EXC_CHPROP_LABELSEPARATOR "LabelSeparator"
102 : #define EXC_CHPROP_MAJORTICKS "MajorTickmarks"
103 : #define EXC_CHPROP_MARKPOSITION "MarkPosition"
104 : #define EXC_CHPROP_MINORTICKS "MinorTickmarks"
105 : #define EXC_CHPROP_MISSINGVALUETREATMENT "MissingValueTreatment"
106 : #define EXC_CHPROP_MOVING_AVERAGE_PERIOD "MovingAveragePeriod"
107 : #define EXC_CHPROP_NEGATIVEERROR "NegativeError"
108 : #define EXC_CHPROP_NUMBERFORMAT "NumberFormat"
109 : #define EXC_CHPROP_OFFSET "Offset"
110 : #define EXC_CHPROP_OVERLAPSEQ "OverlapSequence"
111 : #define EXC_CHPROP_PERCENTAGENUMFMT "PercentageNumberFormat"
112 : #define EXC_CHPROP_PERCENTDIAGONAL "PercentDiagonal"
113 : #define EXC_CHPROP_PERSPECTIVE "Perspective"
114 : #define EXC_CHPROP_POSITIVEERROR "PositiveError"
115 : #define EXC_CHPROP_POLYNOMIAL_DEGREE "PolynomialDegree"
116 : #define EXC_CHPROP_RELATIVEPOSITION "RelativePosition"
117 : #define EXC_CHPROP_RELATIVESIZE "RelativeSize"
118 : #define EXC_CHPROP_RIGHTANGLEDAXES "RightAngledAxes"
119 : #define EXC_CHPROP_ROLE "Role"
120 : #define EXC_CHPROP_ROTATIONHORIZONTAL "RotationHorizontal"
121 : #define EXC_CHPROP_ROTATIONVERTICAL "RotationVertical"
122 : #define EXC_CHPROP_3DRELATIVEHEIGHT "3DRelativeHeight"
123 : #define EXC_CHPROP_SHOW "Show"
124 : #define EXC_CHPROP_SHOWCORRELATION "ShowCorrelationCoefficient"
125 : #define EXC_CHPROP_SHOWEQUATION "ShowEquation"
126 : #define EXC_CHPROP_SHOWFIRST "ShowFirst"
127 : #define EXC_CHPROP_SHOWHIGHLOW "ShowHighLow"
128 : #define EXC_CHPROP_SHOWNEGATIVEERROR "ShowNegativeError"
129 : #define EXC_CHPROP_SHOWPOSITIVEERROR "ShowPositiveError"
130 : #define EXC_CHPROP_STACKCHARACTERS "StackCharacters"
131 : #define EXC_CHPROP_STACKINGDIR "StackingDirection"
132 : #define EXC_CHPROP_STARTINGANGLE "StartingAngle"
133 : #define EXC_CHPROP_SWAPXANDYAXIS "SwapXAndYAxis"
134 : #define EXC_CHPROP_SYMBOL "Symbol"
135 : #define EXC_CHPROP_TEXTBREAK "TextBreak"
136 : #define EXC_CHPROP_TEXTOVERLAP "TextOverlap"
137 : #define EXC_CHPROP_TEXTROTATION "TextRotation"
138 : #define EXC_CHPROP_USERINGS "UseRings"
139 : #define EXC_CHPROP_VARYCOLORSBY "VaryColorsByPoint"
140 : #define EXC_CHPROP_WEIGHT "Weight"
141 : #define EXC_CHPROP_WHITEDAY "WhiteDay"
142 :
143 : // data series roles
144 : #define EXC_CHPROP_ROLE_CATEG "categories"
145 : #define EXC_CHPROP_ROLE_ERRORBARS_NEGX "error-bars-x-negative"
146 : #define EXC_CHPROP_ROLE_ERRORBARS_NEGY "error-bars-y-negative"
147 : #define EXC_CHPROP_ROLE_ERRORBARS_POSX "error-bars-x-positive"
148 : #define EXC_CHPROP_ROLE_ERRORBARS_POSY "error-bars-y-positive"
149 : #define EXC_CHPROP_ROLE_LABEL "label"
150 : #define EXC_CHPROP_ROLE_XVALUES "values-x"
151 : #define EXC_CHPROP_ROLE_YVALUES "values-y"
152 : #define EXC_CHPROP_ROLE_OPENVALUES "values-first"
153 : #define EXC_CHPROP_ROLE_CLOSEVALUES "values-last"
154 : #define EXC_CHPROP_ROLE_LOWVALUES "values-min"
155 : #define EXC_CHPROP_ROLE_HIGHVALUES "values-max"
156 : #define EXC_CHPROP_ROLE_SIZEVALUES "values-size"
157 :
158 : // Constants and Enumerations =================================================
159 :
160 : const sal_Size EXC_CHART_PROGRESS_SIZE = 10;
161 : const sal_uInt16 EXC_CHART_AUTOROTATION = 0xFFFF; /// Automatic rotation, e.g. axis labels (internal use only).
162 :
163 : const sal_Int32 EXC_CHART_AXIS_NONE = -1; /// For internal use only.
164 : const sal_Int32 EXC_CHART_AXIS_X = 0; /// API X axis index.
165 : const sal_Int32 EXC_CHART_AXIS_Y = 1; /// API Y axis index.
166 : const sal_Int32 EXC_CHART_AXIS_Z = 2; /// API Z axis index.
167 : const sal_Int32 EXC_CHART_AXESSET_NONE = -1; /// For internal use only.
168 : const sal_Int32 EXC_CHART_AXESSET_PRIMARY = 0; /// API primary axes set index.
169 : const sal_Int32 EXC_CHART_AXESSET_SECONDARY = 1; /// API secondary axes set index.
170 :
171 : const sal_Int32 EXC_CHART_TOTALUNITS = 4000; /// Most chart objects are positioned in 1/4000 of chart area.
172 : const sal_Int32 EXC_CHART_PLOTAREAUNITS = 1000; /// For objects that are positioned in 1/1000 of plot area.
173 :
174 : // (0x0850) CHFRINFO ----------------------------------------------------------
175 :
176 : const sal_uInt16 EXC_ID_CHFRINFO = 0x0850;
177 :
178 : const sal_uInt8 EXC_CHFRINFO_EXCEL2000 = 9;
179 : const sal_uInt8 EXC_CHFRINFO_EXCELXP2003 = 10;
180 : const sal_uInt8 EXC_CHFRINFO_EXCEL2007 = 11;
181 :
182 : // (0x0852, 0x0853) CHFRBLOCKBEGIN, CHFRBLOCKEND ------------------------------
183 :
184 : const sal_uInt16 EXC_ID_CHFRBLOCKBEGIN = 0x0852;
185 : const sal_uInt16 EXC_ID_CHFRBLOCKEND = 0x0853;
186 :
187 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_AXESSET = 0;
188 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_TEXT = 2;
189 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_AXIS = 4;
190 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_TYPEGROUP = 5;
191 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_DATATABLE = 6;
192 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_FRAME = 7;
193 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_LEGEND = 9;
194 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_LEGENDEX = 10;
195 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_SERIES = 12;
196 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_CHART = 13;
197 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_DATAFORMAT = 14;
198 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_DROPBAR = 15;
199 : const sal_uInt16 EXC_CHFRBLOCK_TYPE_UNKNOWN = 0xFFFF; /// For internal use only.
200 :
201 : const sal_uInt16 EXC_CHFRBLOCK_TEXT_TITLE = 0;
202 : const sal_uInt16 EXC_CHFRBLOCK_TEXT_DEFTEXT = 2;
203 : const sal_uInt16 EXC_CHFRBLOCK_TEXT_AXISTITLE = 4;
204 : const sal_uInt16 EXC_CHFRBLOCK_TEXT_DATALABEL = 5;
205 :
206 : const sal_uInt16 EXC_CHFRBLOCK_FRAME_STANDARD = 0;
207 : const sal_uInt16 EXC_CHFRBLOCK_FRAME_PLOTFRAME = 1;
208 : const sal_uInt16 EXC_CHFRBLOCK_FRAME_BACKGROUND = 2;
209 :
210 : // (0x086B) CHFRLABELPROPS ----------------------------------------------------
211 :
212 : const sal_uInt16 EXC_ID_CHFRLABELPROPS = 0x086B;
213 :
214 : const sal_uInt16 EXC_CHFRLABELPROPS_SHOWSERIES = 0x0001;
215 : const sal_uInt16 EXC_CHFRLABELPROPS_SHOWCATEG = 0x0002;
216 : const sal_uInt16 EXC_CHFRLABELPROPS_SHOWVALUE = 0x0004;
217 : const sal_uInt16 EXC_CHFRLABELPROPS_SHOWPERCENT = 0x0008;
218 : const sal_uInt16 EXC_CHFRLABELPROPS_SHOWBUBBLE = 0x0010;
219 :
220 : // (0x1001) CHUNITS -----------------------------------------------------------
221 :
222 : const sal_uInt16 EXC_ID_CHUNITS = 0x1001;
223 :
224 : const sal_uInt16 EXC_CHUNITS_TWIPS = 0;
225 : const sal_uInt16 EXC_CHUNITS_PIXELS = 1;
226 :
227 : // (0x1002) CHCHART -----------------------------------------------------------
228 :
229 : const sal_uInt16 EXC_ID_CHCHART = 0x1002;
230 :
231 : // (0x1003) CHSERIES ----------------------------------------------------------
232 :
233 : const sal_uInt16 EXC_ID_CHSERIES = 0x1003;
234 :
235 : const sal_uInt16 EXC_CHSERIES_DATE = 0;
236 : const sal_uInt16 EXC_CHSERIES_NUMERIC = 1;
237 : const sal_uInt16 EXC_CHSERIES_SEQUENCE = 2;
238 : const sal_uInt16 EXC_CHSERIES_TEXT = 3;
239 :
240 : const sal_uInt16 EXC_CHSERIES_MAXSERIES = 255; /// Maximum valid series index.
241 : const sal_uInt16 EXC_CHSERIES_INVALID = 0xFFFF; /// Invalid series index (for internal use).
242 :
243 : // (0x1006) CHDATAFORMAT ------------------------------------------------------
244 :
245 : const sal_uInt16 EXC_ID_CHDATAFORMAT = 0x1006;
246 :
247 : const sal_uInt16 EXC_CHDATAFORMAT_MAXPOINTCOUNT = 32000; /// Maximum number of data points.
248 : const sal_uInt16 EXC_CHDATAFORMAT_DEFAULT = 0xFFFD; /// As format index: global default for an axes set.
249 : const sal_uInt16 EXC_CHDATAFORMAT_UNKNOWN = 0xFFFE; /// As point index: unknown format, don't use.
250 : const sal_uInt16 EXC_CHDATAFORMAT_ALLPOINTS = 0xFFFF; /// As point index: default for a series.
251 :
252 : const sal_uInt16 EXC_CHDATAFORMAT_OLDCOLORS = 0x0001;
253 :
254 : // (0x1007) CHLINEFORMAT ------------------------------------------------------
255 :
256 : const sal_uInt16 EXC_ID_CHLINEFORMAT = 0x1007;
257 :
258 : const sal_uInt16 EXC_CHLINEFORMAT_SOLID = 0;
259 : const sal_uInt16 EXC_CHLINEFORMAT_DASH = 1;
260 : const sal_uInt16 EXC_CHLINEFORMAT_DOT = 2;
261 : const sal_uInt16 EXC_CHLINEFORMAT_DASHDOT = 3;
262 : const sal_uInt16 EXC_CHLINEFORMAT_DASHDOTDOT = 4;
263 : const sal_uInt16 EXC_CHLINEFORMAT_NONE = 5;
264 : const sal_uInt16 EXC_CHLINEFORMAT_DARKTRANS = 6;
265 : const sal_uInt16 EXC_CHLINEFORMAT_MEDTRANS = 7;
266 : const sal_uInt16 EXC_CHLINEFORMAT_LIGHTTRANS = 8;
267 :
268 : const sal_Int16 EXC_CHLINEFORMAT_HAIR = -1;
269 : const sal_Int16 EXC_CHLINEFORMAT_SINGLE = 0;
270 : const sal_Int16 EXC_CHLINEFORMAT_DOUBLE = 1;
271 : const sal_Int16 EXC_CHLINEFORMAT_TRIPLE = 2;
272 :
273 : const sal_uInt16 EXC_CHLINEFORMAT_AUTO = 0x0001;
274 : const sal_uInt16 EXC_CHLINEFORMAT_SHOWAXIS = 0x0004;
275 :
276 : // (0x1009) CHMARKERFORMAT ----------------------------------------------------
277 :
278 : const sal_uInt16 EXC_ID_CHMARKERFORMAT = 0x1009;
279 :
280 : const sal_uInt16 EXC_CHMARKERFORMAT_NOSYMBOL = 0;
281 : const sal_uInt16 EXC_CHMARKERFORMAT_SQUARE = 1;
282 : const sal_uInt16 EXC_CHMARKERFORMAT_DIAMOND = 2;
283 : const sal_uInt16 EXC_CHMARKERFORMAT_TRIANGLE = 3;
284 : const sal_uInt16 EXC_CHMARKERFORMAT_CROSS = 4;
285 : const sal_uInt16 EXC_CHMARKERFORMAT_STAR = 5;
286 : const sal_uInt16 EXC_CHMARKERFORMAT_DOWJ = 6;
287 : const sal_uInt16 EXC_CHMARKERFORMAT_STDDEV = 7;
288 : const sal_uInt16 EXC_CHMARKERFORMAT_CIRCLE = 8;
289 : const sal_uInt16 EXC_CHMARKERFORMAT_PLUS = 9;
290 :
291 : const sal_uInt32 EXC_CHMARKERFORMAT_HAIRSIZE = 60; /// Automatic symbol size for hair lines.
292 : const sal_uInt32 EXC_CHMARKERFORMAT_SINGLESIZE = 100; /// Automatic symbol size for single lines.
293 : const sal_uInt32 EXC_CHMARKERFORMAT_DOUBLESIZE = 140; /// Automatic symbol size for double lines.
294 : const sal_uInt32 EXC_CHMARKERFORMAT_TRIPLESIZE = 180; /// Automatic symbol size for triple lines.
295 :
296 : const sal_uInt16 EXC_CHMARKERFORMAT_AUTO = 0x0001;
297 : const sal_uInt16 EXC_CHMARKERFORMAT_NOFILL = 0x0010;
298 : const sal_uInt16 EXC_CHMARKERFORMAT_NOLINE = 0x0020;
299 :
300 : // (0x100A) CHAREAFORMAT ------------------------------------------------------
301 :
302 : const sal_uInt16 EXC_ID_CHAREAFORMAT = 0x100A;
303 :
304 : const sal_uInt16 EXC_CHAREAFORMAT_AUTO = 0x0001;
305 : const sal_uInt16 EXC_CHAREAFORMAT_INVERTNEG = 0x0002;
306 :
307 : // (0x100B) CHPIEFORMAT -------------------------------------------------------
308 :
309 : const sal_uInt16 EXC_ID_CHPIEFORMAT = 0x100B;
310 :
311 : // (0x100C) CHATTACHEDLABEL ---------------------------------------------------
312 :
313 : const sal_uInt16 EXC_ID_CHATTACHEDLABEL = 0x100C;
314 :
315 : const sal_uInt16 EXC_CHATTLABEL_SHOWVALUE = 0x0001;
316 : const sal_uInt16 EXC_CHATTLABEL_SHOWPERCENT = 0x0002;
317 : const sal_uInt16 EXC_CHATTLABEL_SHOWCATEGPERC = 0x0004;
318 : const sal_uInt16 EXC_CHATTLABEL_SMOOTHED = 0x0008; /// Smoothed line.
319 : const sal_uInt16 EXC_CHATTLABEL_SHOWCATEG = 0x0010;
320 : const sal_uInt16 EXC_CHATTLABEL_SHOWBUBBLE = 0x0020;
321 :
322 : // (0x100D) CHSTRING ----------------------------------------------------------
323 :
324 : const sal_uInt16 EXC_ID_CHSTRING = 0x100D;
325 :
326 : // (0x1014) CHTYPEGROUP -------------------------------------------------------
327 :
328 : const sal_uInt16 EXC_ID_CHTYPEGROUP = 0x1014;
329 :
330 : const sal_uInt16 EXC_CHTYPEGROUP_VARIEDCOLORS = 0x0001; /// Varied colors for points.
331 :
332 : // (0x1015) CHLEGEND ----------------------------------------------------------
333 :
334 : const sal_uInt16 EXC_ID_CHLEGEND = 0x1015;
335 :
336 : const sal_uInt8 EXC_CHLEGEND_BOTTOM = 0;
337 : const sal_uInt8 EXC_CHLEGEND_CORNER = 1;
338 : const sal_uInt8 EXC_CHLEGEND_TOP = 2;
339 : const sal_uInt8 EXC_CHLEGEND_RIGHT = 3;
340 : const sal_uInt8 EXC_CHLEGEND_LEFT = 4;
341 : const sal_uInt8 EXC_CHLEGEND_NOTDOCKED = 7;
342 :
343 : const sal_uInt8 EXC_CHLEGEND_CLOSE = 0;
344 : const sal_uInt8 EXC_CHLEGEND_MEDIUM = 1;
345 : const sal_uInt8 EXC_CHLEGEND_OPEN = 2;
346 :
347 : const sal_uInt16 EXC_CHLEGEND_DOCKED = 0x0001;
348 : const sal_uInt16 EXC_CHLEGEND_AUTOSERIES = 0x0002;
349 : const sal_uInt16 EXC_CHLEGEND_AUTOPOSX = 0x0004;
350 : const sal_uInt16 EXC_CHLEGEND_AUTOPOSY = 0x0008;
351 : const sal_uInt16 EXC_CHLEGEND_STACKED = 0x0010;
352 : const sal_uInt16 EXC_CHLEGEND_DATATABLE = 0x0020;
353 :
354 : // (0x1017) CHBAR, CHCOLUMN ---------------------------------------------------
355 :
356 : const sal_uInt16 EXC_ID_CHBAR = 0x1017;
357 :
358 : const sal_uInt16 EXC_CHBAR_HORIZONTAL = 0x0001;
359 : const sal_uInt16 EXC_CHBAR_STACKED = 0x0002;
360 : const sal_uInt16 EXC_CHBAR_PERCENT = 0x0004;
361 : const sal_uInt16 EXC_CHBAR_SHADOW = 0x0008;
362 :
363 : // (0x1018, 0x101A) CHLINE, CHAREA --------------------------------------------
364 :
365 : const sal_uInt16 EXC_ID_CHLINE = 0x1018;
366 : const sal_uInt16 EXC_ID_CHAREA = 0x101A;
367 :
368 : const sal_uInt16 EXC_CHLINE_STACKED = 0x0001;
369 : const sal_uInt16 EXC_CHLINE_PERCENT = 0x0002;
370 : const sal_uInt16 EXC_CHLINE_SHADOW = 0x0004;
371 :
372 : // (0x1019) CHPIE -------------------------------------------------------------
373 :
374 : const sal_uInt16 EXC_ID_CHPIE = 0x1019;
375 :
376 : const sal_uInt16 EXC_CHPIE_SHADOW = 0x0001;
377 : const sal_uInt16 EXC_CHPIE_LINES = 0x0002;
378 :
379 : // (0x101B) CHSCATTER ---------------------------------------------------------
380 :
381 : const sal_uInt16 EXC_ID_CHSCATTER = 0x101B;
382 :
383 : const sal_uInt16 EXC_CHSCATTER_AREA = 1; /// Bubble area refers to value.
384 : const sal_uInt16 EXC_CHSCATTER_WIDTH = 2; /// Bubble width refers to value.
385 :
386 : const sal_uInt16 EXC_CHSCATTER_BUBBLES = 0x0001;
387 : const sal_uInt16 EXC_CHSCATTER_SHOWNEG = 0x0002;
388 : const sal_uInt16 EXC_CHSCATTER_SHADOW = 0x0004;
389 :
390 : // (0x001C) CHCHARTLINE -------------------------------------------------------
391 :
392 : const sal_uInt16 EXC_ID_CHCHARTLINE = 0x101C;
393 :
394 : const sal_uInt16 EXC_CHCHARTLINE_DROP = 0; /// Drop lines.
395 : const sal_uInt16 EXC_CHCHARTLINE_HILO = 1; /// Hi-lo lines.
396 : const sal_uInt16 EXC_CHCHARTLINE_CONNECT = 2; /// Connector lines in stacked bar charts.
397 :
398 : // (0x101D) CHAXIS ------------------------------------------------------------
399 :
400 : const sal_uInt16 EXC_ID_CHAXIS = 0x101D;
401 :
402 : const sal_uInt16 EXC_CHAXIS_X = 0;
403 : const sal_uInt16 EXC_CHAXIS_Y = 1;
404 : const sal_uInt16 EXC_CHAXIS_Z = 2;
405 : const sal_uInt16 EXC_CHAXIS_NONE = 0xFFFF; /// For internal use only.
406 :
407 : // (0x101E) CHTICK ------------------------------------------------------------
408 :
409 : const sal_uInt16 EXC_ID_CHTICK = 0x101E;
410 :
411 : const sal_uInt8 EXC_CHTICK_INSIDE = 0x01;
412 : const sal_uInt8 EXC_CHTICK_OUTSIDE = 0x02;
413 :
414 : const sal_uInt8 EXC_CHTICK_NOLABEL = 0;
415 : const sal_uInt8 EXC_CHTICK_LOW = 1; /// Below diagram/right of diagram.
416 : const sal_uInt8 EXC_CHTICK_HIGH = 2; /// Above diagram/left of diagram.
417 : const sal_uInt8 EXC_CHTICK_NEXT = 3; /// Next to axis.
418 :
419 : const sal_uInt8 EXC_CHTICK_TRANSPARENT = 1;
420 : const sal_uInt8 EXC_CHTICK_OPAQUE = 2;
421 :
422 : const sal_uInt16 EXC_CHTICK_AUTOCOLOR = 0x0001;
423 : const sal_uInt16 EXC_CHTICK_AUTOFILL = 0x0002;
424 : const sal_uInt16 EXC_CHTICK_AUTOROT = 0x0020;
425 :
426 : // (0x101F) CHVALUERANGE ------------------------------------------------------
427 :
428 : const sal_uInt16 EXC_ID_CHVALUERANGE = 0x101F;
429 :
430 : const sal_uInt16 EXC_CHVALUERANGE_AUTOMIN = 0x0001;
431 : const sal_uInt16 EXC_CHVALUERANGE_AUTOMAX = 0x0002;
432 : const sal_uInt16 EXC_CHVALUERANGE_AUTOMAJOR = 0x0004;
433 : const sal_uInt16 EXC_CHVALUERANGE_AUTOMINOR = 0x0008;
434 : const sal_uInt16 EXC_CHVALUERANGE_AUTOCROSS = 0x0010;
435 : const sal_uInt16 EXC_CHVALUERANGE_LOGSCALE = 0x0020;
436 : const sal_uInt16 EXC_CHVALUERANGE_REVERSE = 0x0040; /// Axis direction reversed.
437 : const sal_uInt16 EXC_CHVALUERANGE_MAXCROSS = 0x0080; /// Other axis crosses at own maximum.
438 : const sal_uInt16 EXC_CHVALUERANGE_BIT8 = 0x0100; /// This bit is always set in BIFF5+.
439 :
440 : // (0x1020) CHLABELRANGE -----------------------------------------------------
441 :
442 : const sal_uInt16 EXC_ID_CHLABELRANGE = 0x1020;
443 :
444 : const sal_uInt16 EXC_CHLABELRANGE_BETWEEN = 0x0001; /// Axis between categories.
445 : const sal_uInt16 EXC_CHLABELRANGE_MAXCROSS = 0x0002; /// Other axis crosses at own maximum.
446 : const sal_uInt16 EXC_CHLABELRANGE_REVERSE = 0x0004; /// Axis direction reversed.
447 :
448 : // (0x1021) CHAXISLINE --------------------------------------------------------
449 :
450 : const sal_uInt16 EXC_ID_CHAXISLINE = 0x1021;
451 :
452 : const sal_uInt16 EXC_CHAXISLINE_AXISLINE = 0; /// Axis line itself.
453 : const sal_uInt16 EXC_CHAXISLINE_MAJORGRID = 1; /// Major grid line.
454 : const sal_uInt16 EXC_CHAXISLINE_MINORGRID = 2; /// Minor grid line.
455 : const sal_uInt16 EXC_CHAXISLINE_WALLS = 3; /// Walls (X, Z axis), floor (Y axis).
456 :
457 : // (0x1024) CHDEFAULTTEXT -----------------------------------------------------
458 :
459 : const sal_uInt16 EXC_ID_CHDEFAULTTEXT = 0x1024;
460 :
461 : const sal_uInt16 EXC_CHDEFTEXT_TEXTLABEL = 0; /// Default for text data labels (not used?).
462 : const sal_uInt16 EXC_CHDEFTEXT_NUMLABEL = 1; /// Default for numeric data labels (not used?).
463 : const sal_uInt16 EXC_CHDEFTEXT_GLOBAL = 2; /// Default text for all chart objects.
464 : const sal_uInt16 EXC_CHDEFTEXT_AXESSET = 3; /// Default text for axes and data points (BIFF8 only).
465 : const sal_uInt16 EXC_CHDEFTEXT_NONE = 0xFFFF; /// No default text available.
466 :
467 : // (0x1025) CHTEXT ------------------------------------------------------------
468 :
469 : const sal_uInt16 EXC_ID_CHTEXT = 0x1025;
470 :
471 : const sal_uInt8 EXC_CHTEXT_ALIGN_TOPLEFT = 1; /// Horizontal: left, vertical: top.
472 : const sal_uInt8 EXC_CHTEXT_ALIGN_CENTER = 2;
473 : const sal_uInt8 EXC_CHTEXT_ALIGN_BOTTOMRIGHT = 3; /// Horizontal: right, vertical: bottom.
474 : const sal_uInt8 EXC_CHTEXT_ALIGN_JUSTIFY = 4;
475 : const sal_uInt8 EXC_CHTEXT_ALIGN_DISTRIBUTE = 5;
476 :
477 : const sal_uInt16 EXC_CHTEXT_TRANSPARENT = 1;
478 : const sal_uInt16 EXC_CHTEXT_OPAQUE = 2;
479 :
480 : const sal_uInt16 EXC_CHTEXT_AUTOCOLOR = 0x0001; /// Automatic text color.
481 : const sal_uInt16 EXC_CHTEXT_SHOWSYMBOL = 0x0002; /// Legend symbol for data point caption.
482 : const sal_uInt16 EXC_CHTEXT_SHOWVALUE = 0x0004; /// Data point caption is the value.
483 : const sal_uInt16 EXC_CHTEXT_VERTICAL = 0x0008;
484 : const sal_uInt16 EXC_CHTEXT_AUTOTEXT = 0x0010; /// Label text generated from chart data.
485 : const sal_uInt16 EXC_CHTEXT_AUTOGEN = 0x0020; /// Text object is inserted automatically.
486 : const sal_uInt16 EXC_CHTEXT_DELETED = 0x0040; /// Text object is removed.
487 : const sal_uInt16 EXC_CHTEXT_AUTOFILL = 0x0080; /// Automatic text background mode (transparent/opaque).
488 : const sal_uInt16 EXC_CHTEXT_SHOWCATEGPERC = 0x0800; /// Data point caption is category and percent.
489 : const sal_uInt16 EXC_CHTEXT_SHOWPERCENT = 0x1000; /// Data point caption as percent.
490 : const sal_uInt16 EXC_CHTEXT_SHOWBUBBLE = 0x2000; /// Show bubble size.
491 : const sal_uInt16 EXC_CHTEXT_SHOWCATEG = 0x4000; /// Data point caption is category name.
492 :
493 : const sal_uInt16 EXC_CHTEXT_POS_DEFAULT = 0;
494 : const sal_uInt16 EXC_CHTEXT_POS_OUTSIDE = 1;
495 : const sal_uInt16 EXC_CHTEXT_POS_INSIDE = 2;
496 : const sal_uInt16 EXC_CHTEXT_POS_CENTER = 3;
497 : const sal_uInt16 EXC_CHTEXT_POS_AXIS = 4;
498 : const sal_uInt16 EXC_CHTEXT_POS_ABOVE = 5;
499 : const sal_uInt16 EXC_CHTEXT_POS_BELOW = 6;
500 : const sal_uInt16 EXC_CHTEXT_POS_LEFT = 7;
501 : const sal_uInt16 EXC_CHTEXT_POS_RIGHT = 8;
502 : const sal_uInt16 EXC_CHTEXT_POS_AUTO = 9;
503 : const sal_uInt16 EXC_CHTEXT_POS_MOVED = 10;
504 :
505 : // (0x1026) CHFONT ------------------------------------------------------------
506 :
507 : const sal_uInt16 EXC_ID_CHFONT = 0x1026;
508 :
509 : // (0x1027) CHOBJECTLINK ------------------------------------------------------
510 :
511 : const sal_uInt16 EXC_ID_CHOBJECTLINK = 0x1027;
512 :
513 : // link targets
514 : const sal_uInt16 EXC_CHOBJLINK_NONE = 0; /// No link target.
515 : const sal_uInt16 EXC_CHOBJLINK_TITLE = 1; /// Chart title.
516 : const sal_uInt16 EXC_CHOBJLINK_YAXIS = 2; /// Value axis (Y axis).
517 : const sal_uInt16 EXC_CHOBJLINK_XAXIS = 3; /// Category axis (X axis).
518 : const sal_uInt16 EXC_CHOBJLINK_DATA = 4; /// Data series/point.
519 : const sal_uInt16 EXC_CHOBJLINK_ZAXIS = 7; /// Series axis (Z axis).
520 : const sal_uInt16 EXC_CHOBJLINK_AXISUNIT = 12; /// Unit name for axis labels.
521 :
522 : // (0x1032) CHFRAME -----------------------------------------------------------
523 :
524 : const sal_uInt16 EXC_ID_CHFRAME = 0x1032;
525 :
526 : const sal_uInt16 EXC_CHFRAME_STANDARD = 0;
527 : const sal_uInt16 EXC_CHFRAME_SHADOW = 4;
528 :
529 : const sal_uInt16 EXC_CHFRAME_AUTOSIZE = 0x0001;
530 : const sal_uInt16 EXC_CHFRAME_AUTOPOS = 0x0002;
531 :
532 : // (0x1033, 0x1034) CHBEGIN, CHEND --------------------------------------------
533 :
534 : const sal_uInt16 EXC_ID_CHBEGIN = 0x1033;
535 : const sal_uInt16 EXC_ID_CHEND = 0x1034;
536 :
537 : // (0x1035) CHPLOTFRAME -------------------------------------------------------
538 :
539 : const sal_uInt16 EXC_ID_CHPLOTFRAME = 0x1035;
540 :
541 : // (0x103A) CHCHART3D ---------------------------------------------------------
542 :
543 : const sal_uInt16 EXC_ID_CHCHART3D = 0x103A;
544 :
545 : const sal_uInt16 EXC_CHCHART3D_REAL3D = 0x0001; /// true = real 3d perspective.
546 : const sal_uInt16 EXC_CHCHART3D_CLUSTER = 0x0002; /// false = Z axis, true = clustered/stacked.
547 : const sal_uInt16 EXC_CHCHART3D_AUTOHEIGHT = 0x0004; /// true = automatic height to width ratio.
548 : const sal_uInt16 EXC_CHCHART3D_HASWALLS = 0x0010; /// true = 3d chart has walls/floor.
549 : const sal_uInt16 EXC_CHCHART3D_2DWALLS = 0x0020; /// true = 2d wall/gridlines, no floor.
550 :
551 : // (0x103C) CHPICFORMAT -------------------------------------------------------
552 :
553 : const sal_uInt16 EXC_ID_CHPICFORMAT = 0x103C;
554 :
555 : const sal_uInt16 EXC_CHPICFORMAT_NONE = 0; /// For internal use only.
556 : const sal_uInt16 EXC_CHPICFORMAT_STRETCH = 1; /// Bitmap stretched to area.
557 : const sal_uInt16 EXC_CHPICFORMAT_STACK = 2; /// Bitmap stacked.
558 : const sal_uInt16 EXC_CHPICFORMAT_SCALE = 3; /// Bitmap scaled to axis scale.
559 :
560 : const sal_uInt16 EXC_CHPICFORMAT_TOPBOTTOM = 0x0200;
561 : const sal_uInt16 EXC_CHPICFORMAT_FRONTBACK = 0x0400;
562 : const sal_uInt16 EXC_CHPICFORMAT_LEFTRIGHT = 0x0800;
563 :
564 : // (0x103D) CHDROPBAR ---------------------------------------------------------
565 :
566 : const sal_uInt16 EXC_ID_CHDROPBAR = 0x103D;
567 :
568 : const sal_uInt16 EXC_CHDROPBAR_UP = 0;
569 : const sal_uInt16 EXC_CHDROPBAR_DOWN = 1;
570 : const sal_uInt16 EXC_CHDROPBAR_NONE = 0xFFFF;
571 :
572 : // (0x103E, 0x1040) CHRADARLINE, CHRADARAREA ----------------------------------
573 :
574 : const sal_uInt16 EXC_ID_CHRADARLINE = 0x103E;
575 : const sal_uInt16 EXC_ID_CHRADARAREA = 0x1040;
576 :
577 : const sal_uInt16 EXC_CHRADAR_AXISLABELS = 0x0001;
578 : const sal_uInt16 EXC_CHRADAR_SHADOW = 0x0002;
579 :
580 : // (0x103F) CHSURFACE ---------------------------------------------------------
581 :
582 : const sal_uInt16 EXC_ID_CHSURFACE = 0x103F;
583 :
584 : const sal_uInt16 EXC_CHSURFACE_FILLED = 0x0001;
585 : const sal_uInt16 EXC_CHSURFACE_SHADING = 0x0002;
586 :
587 : // (0x1041) CHAXESSET ---------------------------------------------------------
588 :
589 : const sal_uInt16 EXC_ID_CHAXESSET = 0x1041;
590 :
591 : const sal_uInt16 EXC_CHAXESSET_PRIMARY = 0;
592 : const sal_uInt16 EXC_CHAXESSET_SECONDARY = 1;
593 : const sal_uInt16 EXC_CHAXESSET_NONE = 0xFFFF; /// For internal use.
594 :
595 : // (0x1044) CHPROPERTIES ------------------------------------------------------
596 :
597 : const sal_uInt16 EXC_ID_CHPROPERTIES = 0x1044;
598 :
599 : const sal_uInt16 EXC_CHPROPS_MANSERIES = 0x0001; /// Manual series allocation.
600 : const sal_uInt16 EXC_CHPROPS_SHOWVISIBLEONLY = 0x0002; /// Show visible cells only.
601 : const sal_uInt16 EXC_CHPROPS_NORESIZE = 0x0004; /// Do not resize chart with window.
602 : const sal_uInt16 EXC_CHPROPS_MANPLOTAREA = 0x0008; /// Manual plot area mode.
603 : const sal_uInt16 EXC_CHPROPS_USEMANPLOTAREA = 0x0010; /// Manual plot area layout in CHFRAMEPOS record.
604 :
605 : const sal_uInt8 EXC_CHPROPS_EMPTY_SKIP = 0; /// Skip empty values.
606 : const sal_uInt8 EXC_CHPROPS_EMPTY_ZERO = 1; /// Plot empty values as zero.
607 : const sal_uInt8 EXC_CHPROPS_EMPTY_INTERPOLATE = 2; /// Interpolate empty values.
608 :
609 : // (0x1045) CHSERGROUP --------------------------------------------------------
610 :
611 : const sal_uInt16 EXC_ID_CHSERGROUP = 0x1045;
612 :
613 : const sal_uInt16 EXC_CHSERGROUP_NONE = 0xFFFF; /// For internal use: no chart type group.
614 :
615 : // (0x1048, 0x0858) CHPIVOTREF ------------------------------------------------
616 :
617 : const sal_uInt16 EXC_ID5_CHPIVOTREF = 0x1048;
618 : const sal_uInt16 EXC_ID8_CHPIVOTREF = 0x0858;
619 :
620 : // (0x104A) CHSERPARENT -------------------------------------------------------
621 :
622 : const sal_uInt16 EXC_ID_CHSERPARENT = 0x104A;
623 :
624 : // (0x104B) CHSERTRENDLINE ----------------------------------------------------
625 :
626 : const sal_uInt16 EXC_ID_CHSERTRENDLINE = 0x104B;
627 :
628 : const sal_uInt8 EXC_CHSERTREND_POLYNOMIAL = 0; /// If order is 1, trend line is linear.
629 : const sal_uInt8 EXC_CHSERTREND_EXPONENTIAL = 1;
630 : const sal_uInt8 EXC_CHSERTREND_LOGARITHMIC = 2;
631 : const sal_uInt8 EXC_CHSERTREND_POWER = 3;
632 : const sal_uInt8 EXC_CHSERTREND_MOVING_AVG = 4;
633 :
634 : // (0x104E) CHFORMAT ----------------------------------------------------------
635 :
636 : const sal_uInt16 EXC_ID_CHFORMAT = 0x104E;
637 :
638 : // (0x104F) CHFRAMEPOS --------------------------------------------------------
639 :
640 : const sal_uInt16 EXC_ID_CHFRAMEPOS = 0x104F;
641 :
642 : const sal_uInt16 EXC_CHFRAMEPOS_POINTS = 0;
643 : const sal_uInt16 EXC_CHFRAMEPOS_ABSSIZE_POINTS = 1;
644 : const sal_uInt16 EXC_CHFRAMEPOS_PARENT = 2;
645 : const sal_uInt16 EXC_CHFRAMEPOS_DEFOFFSET_PLOT = 3;
646 : const sal_uInt16 EXC_CHFRAMEPOS_CHARTSIZE = 5;
647 :
648 : // (0x1050) CHFORMATRUNS ------------------------------------------------------
649 :
650 : const sal_uInt16 EXC_ID_CHFORMATRUNS = 0x1050;
651 :
652 : // (0x1051) CHSOURCELINK ------------------------------------------------------
653 :
654 : const sal_uInt16 EXC_ID_CHSOURCELINK = 0x1051;
655 :
656 : const sal_uInt8 EXC_CHSRCLINK_TITLE = 0;
657 : const sal_uInt8 EXC_CHSRCLINK_VALUES = 1;
658 : const sal_uInt8 EXC_CHSRCLINK_CATEGORY = 2;
659 : const sal_uInt8 EXC_CHSRCLINK_BUBBLES = 3;
660 :
661 : const sal_uInt8 EXC_CHSRCLINK_DEFAULT = 0;
662 : const sal_uInt8 EXC_CHSRCLINK_DIRECTLY = 1;
663 : const sal_uInt8 EXC_CHSRCLINK_WORKSHEET = 2;
664 :
665 : const sal_uInt16 EXC_CHSRCLINK_NUMFMT = 0x0001;
666 :
667 : // (0x105B) CHSERERRORBAR -----------------------------------------------------
668 :
669 : const sal_uInt16 EXC_ID_CHSERERRORBAR = 0x105B;
670 :
671 : const sal_uInt8 EXC_CHSERERR_NONE = 0; /// For internal use only.
672 : const sal_uInt8 EXC_CHSERERR_XPLUS = 1;
673 : const sal_uInt8 EXC_CHSERERR_XMINUS = 2;
674 : const sal_uInt8 EXC_CHSERERR_YPLUS = 3;
675 : const sal_uInt8 EXC_CHSERERR_YMINUS = 4;
676 :
677 : const sal_uInt8 EXC_CHSERERR_PERCENT = 1;
678 : const sal_uInt8 EXC_CHSERERR_FIXED = 2;
679 : const sal_uInt8 EXC_CHSERERR_STDDEV = 3;
680 : const sal_uInt8 EXC_CHSERERR_CUSTOM = 4;
681 : const sal_uInt8 EXC_CHSERERR_STDERR = 5;
682 :
683 : const sal_uInt8 EXC_CHSERERR_END_BLANK = 0; /// Line end: blank.
684 : const sal_uInt8 EXC_CHSERERR_END_TSHAPE = 1; /// Line end: t-shape.
685 :
686 : // (0x105D) CHSERIESFORMAT ----------------------------------------------------
687 :
688 : const sal_uInt16 EXC_ID_CHSERIESFORMAT = 0x105D;
689 :
690 : const sal_uInt16 EXC_CHSERIESFORMAT_SMOOTHED = 0x0001;
691 : const sal_uInt16 EXC_CHSERIESFORMAT_BUBBLE3D = 0x0002;
692 : const sal_uInt16 EXC_CHSERIESFORMAT_SHADOW = 0x0004;
693 :
694 : // (0x105F) CH3DDATAFORMAT ----------------------------------------------------
695 :
696 : const sal_uInt16 EXC_ID_CH3DDATAFORMAT = 0x105F;
697 :
698 : const sal_uInt8 EXC_CH3DDATAFORMAT_RECT = 0; /// Rectangular base.
699 : const sal_uInt8 EXC_CH3DDATAFORMAT_CIRC = 1; /// Circular base.
700 :
701 : const sal_uInt8 EXC_CH3DDATAFORMAT_STRAIGHT = 0; /// Straight to top.
702 : const sal_uInt8 EXC_CH3DDATAFORMAT_SHARP = 1; /// Sharp top.
703 : const sal_uInt8 EXC_CH3DDATAFORMAT_TRUNC = 2; /// Shart top, truncated.
704 :
705 : // (0x1061) CHPIEEXT ----------------------------------------------------------
706 :
707 : const sal_uInt16 EXC_ID_CHPIEEXT = 0x1061;
708 :
709 : // (0x1062) CHDATERANGE -------------------------------------------------------
710 :
711 : const sal_uInt16 EXC_ID_CHDATERANGE = 0x1062;
712 :
713 : const sal_uInt16 EXC_CHDATERANGE_AUTOMIN = 0x0001;
714 : const sal_uInt16 EXC_CHDATERANGE_AUTOMAX = 0x0002;
715 : const sal_uInt16 EXC_CHDATERANGE_AUTOMAJOR = 0x0004;
716 : const sal_uInt16 EXC_CHDATERANGE_AUTOMINOR = 0x0008;
717 : const sal_uInt16 EXC_CHDATERANGE_DATEAXIS = 0x0010;
718 : const sal_uInt16 EXC_CHDATERANGE_AUTOBASE = 0x0020;
719 : const sal_uInt16 EXC_CHDATERANGE_AUTOCROSS = 0x0040; /// Other axis crosses at own maximum.
720 : const sal_uInt16 EXC_CHDATERANGE_AUTODATE = 0x0080; /// Recognize date/text automatically.
721 :
722 : const sal_uInt16 EXC_CHDATERANGE_DAYS = 0;
723 : const sal_uInt16 EXC_CHDATERANGE_MONTHS = 1;
724 : const sal_uInt16 EXC_CHDATERANGE_YEARS = 2;
725 :
726 : // (0x1066) CHESCHERFORMAT ----------------------------------------------------
727 :
728 : const sal_uInt16 EXC_ID_CHESCHERFORMAT = 0x1066;
729 :
730 : // Other record IDs -----------------------------------------------------------
731 :
732 : const sal_uInt16 EXC_ID_CHWRAPPEDRECORD = 0x0851;
733 : const sal_uInt16 EXC_ID_CHUNITPROPERTIES = 0x0857;
734 : const sal_uInt16 EXC_ID_CHUSEDAXESSETS = 0x1046;
735 : const sal_uInt16 EXC_ID_CHLABELRANGE2 = 0x1062;
736 : const sal_uInt16 EXC_ID_CHPLOTGROWTH = 0x1064;
737 : const sal_uInt16 EXC_ID_CHSERINDEX = 0x1065;
738 : const sal_uInt16 EXC_ID_CHUNKNOWN = 0xFFFF;
739 :
740 : // Structs and classes
741 :
742 : // Common =====================================================================
743 :
744 : struct XclChRectangle
745 : {
746 : sal_Int32 mnX; /// X position of the object in 1/4000 of chart width.
747 : sal_Int32 mnY; /// Y position of the object in 1/4000 of chart height.
748 : sal_Int32 mnWidth; /// Width of the object in 1/4000 of chart width.
749 : sal_Int32 mnHeight; /// Height of the object in 1/4000 of chart height.
750 :
751 : explicit XclChRectangle();
752 : };
753 :
754 : /** Specifies the position of a data series or data point. */
755 : struct XclChDataPointPos
756 : {
757 : sal_uInt16 mnSeriesIdx; /// Series index of series or a data point.
758 : sal_uInt16 mnPointIdx; /// Index of a data point inside a series.
759 :
760 : explicit XclChDataPointPos(
761 : sal_uInt16 nSeriesIdx = EXC_CHSERIES_INVALID,
762 : sal_uInt16 nPointIdx = EXC_CHDATAFORMAT_ALLPOINTS );
763 : };
764 :
765 : bool operator<( const XclChDataPointPos& rL, const XclChDataPointPos& rR );
766 :
767 : /** Contains the type and context of a block of future records which are
768 : guarded by CHFRBLOCKBEGIN and CHFRBLOCKEND records. */
769 : struct XclChFrBlock
770 : {
771 : sal_uInt16 mnType; /// Type of the future record block.
772 : sal_uInt16 mnContext; /// Context dependent on type.
773 : sal_uInt16 mnValue1; /// Optional primary value for current context.
774 : sal_uInt16 mnValue2; /// Optional secondary value for current context.
775 :
776 : explicit XclChFrBlock( sal_uInt16 nType );
777 : };
778 :
779 : // Frame formatting ===========================================================
780 :
781 : struct XclChFramePos
782 : {
783 : XclChRectangle maRect; /// Object dependent position data.
784 : sal_uInt16 mnTLMode; /// Top-left position mode.
785 : sal_uInt16 mnBRMode; /// Bottom-right position mode.
786 :
787 : explicit XclChFramePos();
788 : };
789 :
790 : struct XclChLineFormat
791 : {
792 : Color maColor; /// Line color.
793 : sal_uInt16 mnPattern; /// Line pattern (solid, dashed, ...).
794 : sal_Int16 mnWeight; /// Line weight (hairline, single, ...).
795 : sal_uInt16 mnFlags; /// Additional flags.
796 :
797 : explicit XclChLineFormat();
798 : };
799 :
800 : struct XclChAreaFormat
801 : {
802 : Color maPattColor; /// Pattern color.
803 : Color maBackColor; /// Pattern background color.
804 : sal_uInt16 mnPattern; /// Fill pattern.
805 : sal_uInt16 mnFlags; /// Additional flags.
806 :
807 : explicit XclChAreaFormat();
808 : };
809 :
810 : class SfxItemSet;
811 : class EscherPropertyContainer;
812 :
813 : struct XclChEscherFormat
814 : {
815 : typedef boost::shared_ptr< SfxItemSet > SfxItemSetRef;
816 : typedef boost::shared_ptr< EscherPropertyContainer > EscherPropSetRef;
817 :
818 : SfxItemSetRef mxItemSet; /// Item set for Escher properties import.
819 : EscherPropSetRef mxEscherSet; /// Container for Escher properties export.
820 :
821 : explicit XclChEscherFormat();
822 : ~XclChEscherFormat();
823 : };
824 :
825 : struct XclChPicFormat
826 : {
827 : sal_uInt16 mnBmpMode; /// Bitmap mode, e.g. stretched, stacked.
828 : sal_uInt16 mnFlags; /// Additional flags.
829 : double mfScale; /// Picture scaling (units).
830 :
831 : explicit XclChPicFormat();
832 : };
833 :
834 : struct XclChFrame
835 : {
836 : sal_uInt16 mnFormat; /// Format type of the frame.
837 : sal_uInt16 mnFlags; /// Additional flags.
838 :
839 : explicit XclChFrame();
840 : };
841 :
842 : // Source links ===============================================================
843 :
844 : struct XclChSourceLink
845 : {
846 : sal_uInt8 mnDestType; /// Type of the destination (title, values, ...).
847 : sal_uInt8 mnLinkType; /// Link type (directly, linked to worksheet, ...).
848 : sal_uInt16 mnFlags; /// Additional flags.
849 : sal_uInt16 mnNumFmtIdx; /// Number format index.
850 :
851 : explicit XclChSourceLink();
852 : };
853 :
854 : // Text =======================================================================
855 :
856 : struct XclChObjectLink
857 : {
858 : XclChDataPointPos maPointPos; /// Position of the data point.
859 : sal_uInt16 mnTarget; /// Target of the link.
860 :
861 : explicit XclChObjectLink();
862 : };
863 :
864 0 : struct XclChFrLabelProps
865 : {
866 : OUString maSeparator; /// Separator between label values.
867 : sal_uInt16 mnFlags; /// Flags indicating which values to be displayed.
868 :
869 : explicit XclChFrLabelProps();
870 : };
871 :
872 : struct XclChText
873 : {
874 : XclChRectangle maRect; /// Position of the text object.
875 : Color maTextColor; /// Text color.
876 : sal_uInt8 mnHAlign; /// Horizontal alignment.
877 : sal_uInt8 mnVAlign; /// Vertical alignment.
878 : sal_uInt16 mnBackMode; /// Background mode: transparent, opaque.
879 : sal_uInt16 mnFlags; /// Additional flags.
880 : sal_uInt16 mnFlags2; /// Text object placement and text direction (BIFF8+).
881 : sal_uInt16 mnRotation; /// Text object rotation (BIFF8+).
882 :
883 : explicit XclChText();
884 : };
885 :
886 : // Data series ================================================================
887 :
888 : struct XclChMarkerFormat
889 : {
890 : Color maLineColor; /// Border line color.
891 : Color maFillColor; /// Fill color.
892 : sal_uInt32 mnMarkerSize; /// Size of a marker
893 : sal_uInt16 mnMarkerType; /// Marker type (none, diamond, ...).
894 : sal_uInt16 mnFlags; /// Additional flags.
895 :
896 : explicit XclChMarkerFormat();
897 : };
898 :
899 : struct XclCh3dDataFormat
900 : {
901 : sal_uInt8 mnBase; /// Base form.
902 : sal_uInt8 mnTop; /// Top egde mode.
903 :
904 : explicit XclCh3dDataFormat();
905 : };
906 :
907 : struct XclChDataFormat
908 : {
909 : XclChDataPointPos maPointPos; /// Position of the data point or series.
910 : sal_uInt16 mnFormatIdx; /// Formatting index for automatic colors.
911 : sal_uInt16 mnFlags; /// Additional flags.
912 :
913 : explicit XclChDataFormat();
914 : };
915 :
916 : struct XclChSerTrendLine
917 : {
918 : double mfIntercept; /// Forced intercept.
919 : double mfForecastFor; /// Counter to forecast forward.
920 : double mfForecastBack; /// Counter to forecast backward.
921 : sal_uInt8 mnLineType; /// Type of the trend line.
922 : sal_uInt8 mnOrder; /// Polynomial order or moving average counter.
923 : sal_uInt8 mnShowEquation; /// 1 = Show equation.
924 : sal_uInt8 mnShowRSquared; /// 1 = Show R-squared.
925 :
926 : explicit XclChSerTrendLine();
927 : };
928 :
929 : struct XclChSerErrorBar
930 : {
931 : double mfValue; /// Fixed value for several source types.
932 : sal_uInt16 mnValueCount; /// Number of custom error values.
933 : sal_uInt8 mnBarType; /// Type of the error bar (X/Y).
934 : sal_uInt8 mnSourceType; /// Type of source values.
935 : sal_uInt8 mnLineEnd; /// Type of the line ends.
936 :
937 : explicit XclChSerErrorBar();
938 : };
939 :
940 : struct XclChSeries
941 : {
942 : sal_uInt16 mnCategType; /// Data type for category entries.
943 : sal_uInt16 mnValueType; /// Data type for value entries.
944 : sal_uInt16 mnBubbleType; /// Data type for bubble entries.
945 : sal_uInt16 mnCategCount; /// Number of category entries.
946 : sal_uInt16 mnValueCount; /// Number of value entries.
947 : sal_uInt16 mnBubbleCount; /// Number of bubble entries.
948 :
949 : explicit XclChSeries();
950 : };
951 :
952 : // Chart type groups ==========================================================
953 :
954 : struct XclChType
955 : {
956 : sal_Int16 mnOverlap; /// Bar overlap width (CHBAR).
957 : sal_Int16 mnGap; /// Gap between bars (CHBAR).
958 : sal_uInt16 mnRotation; /// Rotation angle of first pie (CHPIE).
959 : sal_uInt16 mnPieHole; /// Hole size in donut chart (CHPIE).
960 : sal_uInt16 mnBubbleSize; /// Bubble size in bubble chart (CHSCATTER).
961 : sal_uInt16 mnBubbleType; /// Bubble type in bubble chart (CHSCATTER).
962 : sal_uInt16 mnFlags; /// Additional flags (all chart types).
963 :
964 : explicit XclChType();
965 : };
966 :
967 : struct XclChChart3d
968 : {
969 : sal_uInt16 mnRotation; /// Rotation (0...359deg).
970 : sal_Int16 mnElevation; /// Elevation (-90...+90deg).
971 : sal_uInt16 mnEyeDist; /// Eye distance to chart (0...100).
972 : sal_uInt16 mnRelHeight; /// Height relative to width.
973 : sal_uInt16 mnRelDepth; /// Depth relative to width.
974 : sal_uInt16 mnDepthGap; /// Space between series.
975 : sal_uInt16 mnFlags; /// Additional flags.
976 :
977 : explicit XclChChart3d();
978 : };
979 :
980 : struct XclChLegend
981 : {
982 : XclChRectangle maRect; /// Position of the legend.
983 : sal_uInt8 mnDockMode; /// Docking mode.
984 : sal_uInt8 mnSpacing; /// Spacing between elements.
985 : sal_uInt16 mnFlags; /// Additional flags.
986 :
987 : explicit XclChLegend();
988 : };
989 :
990 : struct XclChTypeGroup
991 : {
992 : sal_uInt16 mnFlags; /// Additional flags.
993 : sal_uInt16 mnGroupIdx; /// Chart type group index.
994 :
995 : explicit XclChTypeGroup();
996 : };
997 :
998 : struct XclChProperties
999 : {
1000 : sal_uInt16 mnFlags; /// Additional flags.
1001 : sal_uInt8 mnEmptyMode; /// Plotting mode for empty cells.
1002 :
1003 : explicit XclChProperties();
1004 : };
1005 :
1006 : // Axes =======================================================================
1007 :
1008 : struct XclChLabelRange
1009 : {
1010 : sal_uInt16 mnCross; /// Crossing position of other axis.
1011 : sal_uInt16 mnLabelFreq; /// Frequency of labels.
1012 : sal_uInt16 mnTickFreq; /// Frequency of ticks.
1013 : sal_uInt16 mnFlags; /// Additional flags.
1014 :
1015 : explicit XclChLabelRange();
1016 : };
1017 :
1018 : struct XclChDateRange
1019 : {
1020 : sal_uInt16 mnMinDate; /// Minimum value on axis.
1021 : sal_uInt16 mnMaxDate; /// Maximum value on axis.
1022 : sal_uInt16 mnMajorStep; /// Distance for major grid lines.
1023 : sal_uInt16 mnMajorUnit; /// Time unit for major step.
1024 : sal_uInt16 mnMinorStep; /// Distance for minor grid lines.
1025 : sal_uInt16 mnMinorUnit; /// Time unit for minor step.
1026 : sal_uInt16 mnBaseUnit; /// Time unit for axis values.
1027 : sal_uInt16 mnCross; /// Crossing position of other axis.
1028 : sal_uInt16 mnFlags; /// Additional flags.
1029 :
1030 : explicit XclChDateRange();
1031 : };
1032 :
1033 : struct XclChValueRange
1034 : {
1035 : double mfMin; /// Minimum value on axis.
1036 : double mfMax; /// Maximum value on axis.
1037 : double mfMajorStep; /// Distance for major grid lines.
1038 : double mfMinorStep; /// Distance for minor grid lines.
1039 : double mfCross; /// Crossing position of other axis.
1040 : sal_uInt16 mnFlags; /// Additional flags.
1041 :
1042 : explicit XclChValueRange();
1043 : };
1044 :
1045 : struct XclChTick
1046 : {
1047 : Color maTextColor; /// Tick labels color.
1048 : sal_uInt8 mnMajor; /// Type of tick marks of major grid.
1049 : sal_uInt8 mnMinor; /// Type of tick marks of minor grid.
1050 : sal_uInt8 mnLabelPos; /// Position of labels relative to axis.
1051 : sal_uInt8 mnBackMode; /// Background mode: transparent, opaque.
1052 : sal_uInt16 mnFlags; /// Additional flags.
1053 : sal_uInt16 mnRotation; /// Tick labels angle (BIFF8+).
1054 :
1055 : explicit XclChTick();
1056 : };
1057 :
1058 : struct XclChAxis
1059 : {
1060 : sal_uInt16 mnType; /// Axis type.
1061 :
1062 : explicit XclChAxis();
1063 :
1064 : /** Returns the axis dimension index used by the chart API. */
1065 : sal_Int32 GetApiAxisDimension() const;
1066 : };
1067 :
1068 : struct XclChAxesSet
1069 : {
1070 : XclChRectangle maRect; /// Position of the axes set (inner plot area).
1071 : sal_uInt16 mnAxesSetId; /// Primary/secondary axes set.
1072 :
1073 : explicit XclChAxesSet();
1074 :
1075 : /** Returns the axes set index used by the chart API. */
1076 : sal_Int32 GetApiAxesSetIndex() const;
1077 : };
1078 :
1079 : // Property mode ==============================================================
1080 :
1081 : /** Specifies the type of a formatting. This results in different property names. */
1082 : enum XclChPropertyMode
1083 : {
1084 : EXC_CHPROPMODE_COMMON, /// Common objects, no special handling.
1085 : EXC_CHPROPMODE_LINEARSERIES, /// Specific to data series drawn as lines.
1086 : EXC_CHPROPMODE_FILLEDSERIES /// Specific to data series drawn as areas.
1087 : };
1088 :
1089 : // Static helper functions ====================================================
1090 :
1091 : /** Contains static helper functions for the chart filters. */
1092 : class XclChartHelper
1093 : {
1094 : public:
1095 : /** Returns a palette index for automatic series line colors. */
1096 : static sal_uInt16 GetSeriesLineAutoColorIdx( sal_uInt16 nFormatIdx );
1097 : /** Returns a palette index for automatic series fill colors. */
1098 : static sal_uInt16 GetSeriesFillAutoColorIdx( sal_uInt16 nFormatIdx );
1099 : /** Returns a transparency value for automatic series fill colors. */
1100 : static sal_uInt8 GetSeriesFillAutoTransp( sal_uInt16 nFormatIdx );
1101 : /** Returns an automatic symbol index for the passed format index. */
1102 : static sal_uInt16 GetAutoMarkerType( sal_uInt16 nFormatIdx );
1103 : /** Returns true, if the passed marker type is filled. */
1104 : static bool HasMarkerFillColor( sal_uInt16 nMarkerType );
1105 : /** Returns the role name for a manual data source for error bars. */
1106 : static OUString GetErrorBarValuesRole( sal_uInt8 nBarType );
1107 : };
1108 :
1109 : // Chart formatting info provider =============================================
1110 :
1111 : /** Enumerates different object types for specific automatic formatting behaviour. */
1112 : enum XclChObjectType
1113 : {
1114 : EXC_CHOBJTYPE_BACKGROUND, /// Chart background.
1115 : EXC_CHOBJTYPE_PLOTFRAME, /// Wall formatting in 2d charts.
1116 : EXC_CHOBJTYPE_WALL3D, /// Wall formatting in 3d charts.
1117 : EXC_CHOBJTYPE_FLOOR3D, /// Floor formatting in 3d charts.
1118 : EXC_CHOBJTYPE_TEXT, /// Text boxes (titles, data point labels).
1119 : EXC_CHOBJTYPE_LEGEND, /// Chart legend.
1120 : EXC_CHOBJTYPE_LINEARSERIES, /// Series formatting in a chart supporting line formatting only.
1121 : EXC_CHOBJTYPE_FILLEDSERIES, /// Series formatting in a chart supporting area formatting.
1122 : EXC_CHOBJTYPE_AXISLINE, /// Axis line format.
1123 : EXC_CHOBJTYPE_GRIDLINE, /// Axis grid line format.
1124 : EXC_CHOBJTYPE_TRENDLINE, /// Series trend line.
1125 : EXC_CHOBJTYPE_ERRORBAR, /// Series error bar.
1126 : EXC_CHOBJTYPE_CONNECTLINE, /// Data point connector line.
1127 : EXC_CHOBJTYPE_HILOLINE, /// High/low lines in stock charts.
1128 : EXC_CHOBJTYPE_WHITEDROPBAR, /// White-day drop bar in stock charts.
1129 : EXC_CHOBJTYPE_BLACKDROPBAR /// Black-day drop bar in stock charts.
1130 : };
1131 :
1132 : /** Enumerates different types to handle missing frame objects. */
1133 : enum XclChFrameType
1134 : {
1135 : EXC_CHFRAMETYPE_AUTO, /// Missing frame represents automatic formatting.
1136 : EXC_CHFRAMETYPE_INVISIBLE /// Missing frame represents invisible formatting.
1137 : };
1138 :
1139 : /** Contains information about auto formatting of a specific chart object type. */
1140 : struct XclChFormatInfo
1141 : {
1142 : XclChObjectType meObjType; /// Object type for automatic format.
1143 : XclChPropertyMode mePropMode; /// Property mode for property set helper.
1144 : sal_uInt16 mnAutoLineColorIdx; /// Automatic line color index.
1145 : sal_Int16 mnAutoLineWeight; /// Automatic line weight (hairline, single, ...).
1146 : sal_uInt16 mnAutoPattColorIdx; /// Automatic fill pattern color index.
1147 : XclChFrameType meDefFrameType; /// Default format type for missing frame objects.
1148 : bool mbCreateDefFrame; /// true = Create missing frame objects on import.
1149 : bool mbDeleteDefFrame; /// true = Delete default frame formatting on export.
1150 : bool mbIsFrame; /// true = Object is a frame, false = Object is a line.
1151 : };
1152 :
1153 : /** Provides access to chart auto formatting for all available object types. */
1154 104 : class XclChFormatInfoProvider
1155 : {
1156 : public:
1157 : explicit XclChFormatInfoProvider();
1158 :
1159 : /** Returns an info struct about auto formatting for the passed object type. */
1160 : const XclChFormatInfo& GetFormatInfo( XclChObjectType eObjType ) const;
1161 :
1162 : private:
1163 : typedef ::std::map< XclChObjectType, const XclChFormatInfo* > XclFmtInfoMap;
1164 : XclFmtInfoMap maInfoMap; /// Maps object type to formatting data.
1165 : };
1166 :
1167 : // Chart type info provider ===================================================
1168 :
1169 : /** Enumerates all kinds of different chart types. */
1170 : enum XclChTypeId
1171 : {
1172 : EXC_CHTYPEID_BAR, /// Vertical bar chart.
1173 : EXC_CHTYPEID_HORBAR, /// Horizontal bar chart.
1174 : EXC_CHTYPEID_LINE, /// Line chart.
1175 : EXC_CHTYPEID_AREA, /// Area chart.
1176 : EXC_CHTYPEID_STOCK, /// Stock chart.
1177 : EXC_CHTYPEID_RADARLINE, /// Linear radar chart.
1178 : EXC_CHTYPEID_RADARAREA, /// Filled radar chart.
1179 : EXC_CHTYPEID_PIE, /// Pie chart.
1180 : EXC_CHTYPEID_DONUT, /// Donut chart.
1181 : EXC_CHTYPEID_PIEEXT, /// Pie-to-pie or pie-to-bar chart.
1182 : EXC_CHTYPEID_SCATTER, /// Scatter (XY) chart.
1183 : EXC_CHTYPEID_BUBBLES, /// Bubble chart.
1184 : EXC_CHTYPEID_SURFACE, /// Surface chart.
1185 : EXC_CHTYPEID_UNKNOWN /// Default for unknown chart types.
1186 : };
1187 :
1188 : /** Enumerates different categories of similar chart types. */
1189 : enum XclChTypeCateg
1190 : {
1191 : EXC_CHTYPECATEG_BAR, /// Bar charts (horizontal or vertical).
1192 : EXC_CHTYPECATEG_LINE, /// Line charts (line, area, stock charts).
1193 : EXC_CHTYPECATEG_RADAR, /// Radar charts (linear or filled).
1194 : EXC_CHTYPECATEG_PIE, /// Pie and donut charts.
1195 : EXC_CHTYPECATEG_SCATTER, /// Scatter and bubble charts.
1196 : EXC_CHTYPECATEG_SURFACE /// Surface charts.
1197 : };
1198 :
1199 : /** Enumerates modes for varying point colors in a series. */
1200 : enum XclChVarPointMode
1201 : {
1202 : EXC_CHVARPOINT_NONE, /// No varied colors supported.
1203 : EXC_CHVARPOINT_SINGLE, /// Only supported, if type group contains only one series.
1204 : EXC_CHVARPOINT_MULTI /// Supported for multiple series in a chart type group.
1205 : };
1206 :
1207 : /** Contains information for a chart type. */
1208 : struct XclChTypeInfo
1209 : {
1210 : XclChTypeId meTypeId; /// Unique chart type identifier.
1211 : XclChTypeCateg meTypeCateg; /// Chart type category this type belongs to.
1212 : sal_uInt16 mnRecId; /// Record identifier written to the file.
1213 : const sal_Char* mpcServiceName; /// Service name of the type.
1214 : XclChVarPointMode meVarPointMode; /// Mode for varying point colors.
1215 : sal_Int32 mnDefaultLabelPos; /// Default data label position (API constant).
1216 : bool mbCombinable2d; /// true = Types can be combined in one axes set.
1217 : bool mbSupports3d; /// true = 3d type allowed, false = Only 2d type.
1218 : bool mbPolarCoordSystem; /// true = Polar, false = Cartesian.
1219 : bool mbSeriesIsFrame2d; /// true = Series with area formatting (2d charts).
1220 : bool mbSeriesIsFrame3d; /// true = Series with area formatting (3d charts).
1221 : bool mbSingleSeriesVis; /// true = Only first series visible.
1222 : bool mbCategoryAxis; /// true = X axis contains categories.
1223 : bool mbSwappedAxesSet; /// true = X and Y axes are swapped.
1224 : bool mbSupportsStacking; /// true = Series can be stacked on each other.
1225 : bool mbReverseSeries; /// true = Insert unstacked series in reverse order.
1226 : bool mbTicksBetweenCateg; /// true = X axis ticks between categories.
1227 : };
1228 :
1229 : /** Extended chart type information and access functions. */
1230 : struct XclChExtTypeInfo : public XclChTypeInfo
1231 : {
1232 : bool mb3dChart; /// Chart is actually a 3D chart.
1233 : bool mbSpline; /// Series lines are smoothed.
1234 :
1235 : explicit XclChExtTypeInfo( const XclChTypeInfo& rTypeInfo );
1236 :
1237 : void Set( const XclChTypeInfo& rTypeInfo, bool b3dChart, bool bSpline );
1238 :
1239 : /** Returns true, if this chart type supports area formatting for its series. */
1240 890 : inline bool IsSeriesFrameFormat() const
1241 890 : { return mb3dChart ? mbSeriesIsFrame3d : mbSeriesIsFrame2d; }
1242 : /** Returns the correct object type identifier for series and data points. */
1243 228 : inline XclChObjectType GetSeriesObjectType() const
1244 228 : { return IsSeriesFrameFormat() ? EXC_CHOBJTYPE_FILLEDSERIES : EXC_CHOBJTYPE_LINEARSERIES; }
1245 : };
1246 :
1247 : /** Provides access to chart type info structs for all available chart types. */
1248 104 : class XclChTypeInfoProvider
1249 : {
1250 : public:
1251 : explicit XclChTypeInfoProvider();
1252 :
1253 : /** Returns chart type info for a unique chart type identifier. */
1254 : const XclChTypeInfo& GetTypeInfo( XclChTypeId eType ) const;
1255 : /** Returns the first fitting chart type info for an Excel chart type record identifier. */
1256 : const XclChTypeInfo& GetTypeInfoFromRecId( sal_uInt16 nRecId ) const;
1257 : /** Returns the first fitting chart type info for the passed service name. */
1258 : const XclChTypeInfo& GetTypeInfoFromService( const OUString& rServiceName ) const;
1259 :
1260 : private:
1261 : typedef ::std::map< XclChTypeId, const XclChTypeInfo* > XclChTypeInfoMap;
1262 : XclChTypeInfoMap maInfoMap; /// Maps chart types to type info data.
1263 : };
1264 :
1265 : // Chart text and title object helpers ========================================
1266 :
1267 : /** Enumerates different text box types for default text formatting and title
1268 : positioning. */
1269 : enum XclChTextType
1270 : {
1271 : EXC_CHTEXTTYPE_TITLE, /// Chart title.
1272 : EXC_CHTEXTTYPE_LEGEND, /// Chart legend.
1273 : EXC_CHTEXTTYPE_AXISTITLE, /// Chart axis titles.
1274 : EXC_CHTEXTTYPE_AXISLABEL, /// Chart axis labels.
1275 : EXC_CHTEXTTYPE_DATALABEL /// Data point labels.
1276 : };
1277 :
1278 : /** A map key for text and title objects. */
1279 : struct XclChTextKey : public ::std::pair< XclChTextType, ::std::pair< sal_uInt16, sal_uInt16 > >
1280 : {
1281 666 : inline explicit XclChTextKey( XclChTextType eTextType, sal_uInt16 nMainIdx = 0, sal_uInt16 nSubIdx = 0 )
1282 666 : { first = eTextType; second.first = nMainIdx; second.second = nSubIdx; }
1283 : };
1284 :
1285 : /** Function prototype receiving a chart document and returning a title shape. */
1286 : typedef ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
1287 : (*XclChGetShapeFunc)( const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDocument >& );
1288 :
1289 : // Property helpers ===========================================================
1290 :
1291 416 : class XclChObjectTable
1292 : {
1293 : public:
1294 : typedef ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > XNameContainerRef;
1295 : typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > XServiceFactoryRef;
1296 :
1297 : public:
1298 : explicit XclChObjectTable( XServiceFactoryRef xFactory,
1299 : const OUString& rServiceName, const OUString& rObjNameBase );
1300 :
1301 : /** Returns a named formatting object from the chart document. */
1302 : ::com::sun::star::uno::Any GetObject( const OUString& rObjName );
1303 : /** Insertes a named formatting object into the chart document. */
1304 : OUString InsertObject( const ::com::sun::star::uno::Any& rObj );
1305 :
1306 : private:
1307 : XServiceFactoryRef mxFactory; /// Factory to create the container.
1308 : XNameContainerRef mxContainer; /// Container for the objects.
1309 : OUString maServiceName; /// Service name to create the container.
1310 : OUString maObjNameBase; /// Base of names for inserted objects.
1311 : sal_Int32 mnIndex; /// Index to create unique identifiers.
1312 : };
1313 :
1314 : struct XclFontData;
1315 :
1316 : /** Helper class for usage of property sets. */
1317 208 : class XclChPropSetHelper
1318 : {
1319 : public:
1320 : explicit XclChPropSetHelper();
1321 :
1322 : /** Reads all line properties from the passed property set. */
1323 : void ReadLineProperties(
1324 : XclChLineFormat& rLineFmt,
1325 : XclChObjectTable& rDashTable,
1326 : const ScfPropertySet& rPropSet,
1327 : XclChPropertyMode ePropMode );
1328 : /** Reads solid area properties from the passed property set.
1329 : @return true = object contains complex fill properties. */
1330 : bool ReadAreaProperties(
1331 : XclChAreaFormat& rAreaFmt,
1332 : const ScfPropertySet& rPropSet,
1333 : XclChPropertyMode ePropMode );
1334 : /** Reads gradient or bitmap area properties from the passed property set. */
1335 : void ReadEscherProperties(
1336 : XclChEscherFormat& rEscherFmt,
1337 : XclChPicFormat& rPicFmt,
1338 : XclChObjectTable& rGradientTable,
1339 : XclChObjectTable& rHatchTable,
1340 : XclChObjectTable& rBitmapTable,
1341 : const ScfPropertySet& rPropSet,
1342 : XclChPropertyMode ePropMode );
1343 : /** Reads all marker properties from the passed property set. */
1344 : void ReadMarkerProperties(
1345 : XclChMarkerFormat& rMarkerFmt,
1346 : const ScfPropertySet& rPropSet,
1347 : sal_uInt16 nFormatIdx );
1348 : /** Reads rotation properties from the passed property set. */
1349 : sal_uInt16 ReadRotationProperties(
1350 : const ScfPropertySet& rPropSet,
1351 : bool bSupportsStacked );
1352 :
1353 : /** Writes all line properties to the passed property set. */
1354 : void WriteLineProperties(
1355 : ScfPropertySet& rPropSet,
1356 : XclChObjectTable& rDashTable,
1357 : const XclChLineFormat& rLineFmt,
1358 : XclChPropertyMode ePropMode );
1359 : /** Writes solid area properties to the passed property set. */
1360 : void WriteAreaProperties(
1361 : ScfPropertySet& rPropSet,
1362 : const XclChAreaFormat& rAreaFmt,
1363 : XclChPropertyMode ePropMode );
1364 : /** Writes gradient or bitmap area properties to the passed property set. */
1365 : void WriteEscherProperties(
1366 : ScfPropertySet& rPropSet,
1367 : XclChObjectTable& rGradientTable,
1368 : XclChObjectTable& rHatchTable,
1369 : XclChObjectTable& rBitmapTable,
1370 : const XclChEscherFormat& rEscherFmt,
1371 : const XclChPicFormat* pPicFmt,
1372 : sal_uInt32 nDffFillType,
1373 : XclChPropertyMode ePropMode );
1374 : /** Writes all marker properties to the passed property set. */
1375 : void WriteMarkerProperties(
1376 : ScfPropertySet& rPropSet,
1377 : const XclChMarkerFormat& rMarkerFmt );
1378 : /** Writes rotation properties to the passed property set. */
1379 : void WriteRotationProperties(
1380 : ScfPropertySet& rPropSet,
1381 : sal_uInt16 nRotation,
1382 : bool bSupportsStacked );
1383 :
1384 : private:
1385 : /** Returns a line property set helper according to the passed property mode. */
1386 : ScfPropSetHelper& GetLineHelper( XclChPropertyMode ePropMode );
1387 : /** Returns an area property set helper according to the passed property mode. */
1388 : ScfPropSetHelper& GetAreaHelper( XclChPropertyMode ePropMode );
1389 : /** Returns a gradient property set helper according to the passed property mode. */
1390 : ScfPropSetHelper& GetGradientHelper( XclChPropertyMode ePropMode );
1391 : /** Returns a hatch property set helper according to the passed property mode. */
1392 : ScfPropSetHelper& GetHatchHelper( XclChPropertyMode ePropMode );
1393 :
1394 : private:
1395 : ScfPropSetHelper maLineHlpCommon; /// Properties for lines in common objects.
1396 : ScfPropSetHelper maLineHlpLinear; /// Properties for lines in linear series.
1397 : ScfPropSetHelper maLineHlpFilled; /// Properties for lines in filled series.
1398 : ScfPropSetHelper maAreaHlpCommon; /// Properties for areas in common objects.
1399 : ScfPropSetHelper maAreaHlpFilled; /// Properties for areas in filled series.
1400 : ScfPropSetHelper maGradHlpCommon; /// Properties for gradients in common objects.
1401 : ScfPropSetHelper maGradHlpFilled; /// Properties for gradients in filled series.
1402 : ScfPropSetHelper maHatchHlpCommon; /// Properties for hatches in common objects.
1403 : ScfPropSetHelper maHatchHlpFilled; /// Properties for hatches in filled series.
1404 : ScfPropSetHelper maBitmapHlp; /// Properties for bitmaps.
1405 : };
1406 :
1407 : /** Base struct for internal root data structs for import and export. */
1408 : struct XclChRootData
1409 : {
1410 : typedef boost::shared_ptr< XclChTypeInfoProvider > XclChTypeProvRef;
1411 : typedef boost::shared_ptr< XclChFormatInfoProvider > XclChFmtInfoProvRef;
1412 : typedef boost::shared_ptr< XclChObjectTable > XclChObjectTableRef;
1413 : typedef ::std::map< XclChTextKey, XclChGetShapeFunc > XclChGetShapeFuncMap;
1414 :
1415 : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
1416 : mxChartDoc; /// The chart document.
1417 : Rectangle maChartRect; /// Position and size of the chart shape.
1418 : XclChTypeProvRef mxTypeInfoProv; /// Provides info about chart types.
1419 : XclChFmtInfoProvRef mxFmtInfoProv; /// Provides info about auto formatting.
1420 : XclChObjectTableRef mxLineDashTable; /// Container for line dash styles.
1421 : XclChObjectTableRef mxGradientTable; /// Container for gradient fill styles.
1422 : XclChObjectTableRef mxHatchTable; /// Container for hatch fill styles.
1423 : XclChObjectTableRef mxBitmapTable; /// Container for bitmap fill styles.
1424 : XclChGetShapeFuncMap maGetShapeFuncs; /// Maps title shape getter functions.
1425 : sal_Int32 mnBorderGapX; /// Border gap to chart space in 1/100mm.
1426 : sal_Int32 mnBorderGapY; /// Border gap to chart space in 1/100mm.
1427 : double mfUnitSizeX; /// Size of a chart X unit (1/4000 of chart width) in 1/100 mm.
1428 : double mfUnitSizeY; /// Size of a chart Y unit (1/4000 of chart height) in 1/100 mm.
1429 :
1430 : explicit XclChRootData();
1431 : virtual ~XclChRootData();
1432 :
1433 : /** Starts the API chart document conversion. Must be called once before any API access. */
1434 : void InitConversion(
1435 : const XclRoot& rRoot,
1436 : const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
1437 : const Rectangle& rChartRect );
1438 : /** Finishes the API chart document conversion. Must be called once before any API access. */
1439 : void FinishConversion();
1440 :
1441 : /** Returns the drawing shape interface of the specified title object. */
1442 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
1443 : GetTitleShape( const XclChTextKey& rTitleKey ) const;
1444 : };
1445 :
1446 : #endif
1447 :
1448 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|