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