1*cde9e8dcSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*cde9e8dcSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*cde9e8dcSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*cde9e8dcSAndrew Rist * distributed with this work for additional information
6*cde9e8dcSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*cde9e8dcSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*cde9e8dcSAndrew Rist * "License"); you may not use this file except in compliance
9*cde9e8dcSAndrew Rist * with the License. You may obtain a copy of the License at
10*cde9e8dcSAndrew Rist *
11*cde9e8dcSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*cde9e8dcSAndrew Rist *
13*cde9e8dcSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*cde9e8dcSAndrew Rist * software distributed under the License is distributed on an
15*cde9e8dcSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*cde9e8dcSAndrew Rist * KIND, either express or implied. See the License for the
17*cde9e8dcSAndrew Rist * specific language governing permissions and limitations
18*cde9e8dcSAndrew Rist * under the License.
19*cde9e8dcSAndrew Rist *
20*cde9e8dcSAndrew Rist *************************************************************/
21*cde9e8dcSAndrew Rist
22*cde9e8dcSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_chart2.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include "ChartElementFactory.hxx"
28cdf0e10cSrcweir #include "ObjectIdentifier.hxx"
29cdf0e10cSrcweir #include "AccessibleChartElement.hxx"
30cdf0e10cSrcweir
31cdf0e10cSrcweir namespace chart
32cdf0e10cSrcweir {
33cdf0e10cSrcweir
CreateChartElement(const AccessibleElementInfo & rAccInfo)34cdf0e10cSrcweir AccessibleBase* ChartElementFactory::CreateChartElement( const AccessibleElementInfo& rAccInfo )
35cdf0e10cSrcweir {
36cdf0e10cSrcweir ObjectIdentifier aOID( rAccInfo.m_aOID );
37cdf0e10cSrcweir ObjectType eType( aOID.getObjectType() );
38cdf0e10cSrcweir
39cdf0e10cSrcweir switch( eType )
40cdf0e10cSrcweir {
41cdf0e10cSrcweir case OBJECTTYPE_DATA_POINT:
42cdf0e10cSrcweir case OBJECTTYPE_LEGEND_ENTRY:
43cdf0e10cSrcweir return new AccessibleChartElement( rAccInfo, false, false );
44cdf0e10cSrcweir case OBJECTTYPE_PAGE:
45cdf0e10cSrcweir case OBJECTTYPE_TITLE:
46cdf0e10cSrcweir case OBJECTTYPE_LEGEND:
47cdf0e10cSrcweir case OBJECTTYPE_DIAGRAM:
48cdf0e10cSrcweir case OBJECTTYPE_DIAGRAM_WALL:
49cdf0e10cSrcweir case OBJECTTYPE_DIAGRAM_FLOOR:
50cdf0e10cSrcweir case OBJECTTYPE_AXIS:
51cdf0e10cSrcweir case OBJECTTYPE_AXIS_UNITLABEL:
52cdf0e10cSrcweir case OBJECTTYPE_GRID:
53cdf0e10cSrcweir case OBJECTTYPE_SUBGRID:
54cdf0e10cSrcweir case OBJECTTYPE_DATA_SERIES:
55cdf0e10cSrcweir case OBJECTTYPE_DATA_LABELS:
56cdf0e10cSrcweir case OBJECTTYPE_DATA_LABEL:
57cdf0e10cSrcweir case OBJECTTYPE_DATA_ERRORS:
58cdf0e10cSrcweir case OBJECTTYPE_DATA_ERRORS_X:
59cdf0e10cSrcweir case OBJECTTYPE_DATA_ERRORS_Y:
60cdf0e10cSrcweir case OBJECTTYPE_DATA_ERRORS_Z:
61cdf0e10cSrcweir case OBJECTTYPE_DATA_CURVE: // e.g. a statistical method printed as line
62cdf0e10cSrcweir case OBJECTTYPE_DATA_AVERAGE_LINE:
63cdf0e10cSrcweir case OBJECTTYPE_DATA_STOCK_RANGE:
64cdf0e10cSrcweir case OBJECTTYPE_DATA_STOCK_LOSS:
65cdf0e10cSrcweir case OBJECTTYPE_DATA_STOCK_GAIN:
66cdf0e10cSrcweir case OBJECTTYPE_DATA_CURVE_EQUATION:
67cdf0e10cSrcweir return new AccessibleChartElement( rAccInfo, true, false );
68cdf0e10cSrcweir case OBJECTTYPE_UNKNOWN:
69cdf0e10cSrcweir break;
70cdf0e10cSrcweir default:
71cdf0e10cSrcweir break;
72cdf0e10cSrcweir }
73cdf0e10cSrcweir
74cdf0e10cSrcweir return 0;
75cdf0e10cSrcweir
76cdf0e10cSrcweir /*
77cdf0e10cSrcweir sal_uInt16 nObjId = rId.GetObjectId();
78cdf0e10cSrcweir switch( nObjId )
79cdf0e10cSrcweir {
80cdf0e10cSrcweir case CHOBJID_LEGEND:
81cdf0e10cSrcweir return new AccLegend( pParent );
82cdf0e10cSrcweir case AccLegendEntry::ObjectId:
83cdf0e10cSrcweir return new AccLegendEntry( pParent, rId.GetIndex1() );
84cdf0e10cSrcweir
85cdf0e10cSrcweir case CHOBJID_TITLE_MAIN:
86cdf0e10cSrcweir return new AccTitle( pParent, Title::MAIN );
87cdf0e10cSrcweir case CHOBJID_TITLE_SUB:
88cdf0e10cSrcweir return new AccTitle( pParent, Title::SUB );
89cdf0e10cSrcweir case CHOBJID_DIAGRAM_TITLE_X_AXIS:
90cdf0e10cSrcweir return new AccTitle( pParent, Title::X_AXIS );
91cdf0e10cSrcweir case CHOBJID_DIAGRAM_TITLE_Y_AXIS:
92cdf0e10cSrcweir return new AccTitle( pParent, Title::Y_AXIS );
93cdf0e10cSrcweir case CHOBJID_DIAGRAM_TITLE_Z_AXIS:
94cdf0e10cSrcweir return new AccTitle( pParent, Title::Z_AXIS );
95cdf0e10cSrcweir
96cdf0e10cSrcweir case CHOBJID_DIAGRAM:
97cdf0e10cSrcweir return new AccDiagram( pParent );
98cdf0e10cSrcweir
99cdf0e10cSrcweir // series
100cdf0e10cSrcweir case CHOBJID_DIAGRAM_ROWGROUP:
101cdf0e10cSrcweir return new AccDataSeries( pParent, rId.GetIndex1() );
102cdf0e10cSrcweir
103cdf0e10cSrcweir // data points
104cdf0e10cSrcweir case CHOBJID_DIAGRAM_DATA:
105cdf0e10cSrcweir return new AccDataPoint( pParent, rId.GetIndex1(), rId.GetIndex2() );
106cdf0e10cSrcweir
107cdf0e10cSrcweir case Axis::X_AXIS:
108cdf0e10cSrcweir case Axis::Y_AXIS:
109cdf0e10cSrcweir case Axis::Z_AXIS:
110cdf0e10cSrcweir case Axis::SEC_X_AXIS:
111cdf0e10cSrcweir case Axis::SEC_Y_AXIS:
112cdf0e10cSrcweir return new AccAxis( pParent, static_cast< Axis::AxisType >( nObjId ) );
113cdf0e10cSrcweir
114cdf0e10cSrcweir case Grid::X_MAJOR:
115cdf0e10cSrcweir case Grid::Y_MAJOR:
116cdf0e10cSrcweir case Grid::Z_MAJOR:
117cdf0e10cSrcweir case Grid::X_MINOR:
118cdf0e10cSrcweir case Grid::Y_MINOR:
119cdf0e10cSrcweir case Grid::Z_MINOR:
120cdf0e10cSrcweir return new AccGrid( pParent, static_cast< AccGrid::GridType >( nObjId ) );
121cdf0e10cSrcweir
122cdf0e10cSrcweir case AccStatisticsObject::MEAN_VAL_LINE:
123cdf0e10cSrcweir case AccStatisticsObject::ERROR_BARS:
124cdf0e10cSrcweir case AccStatisticsObject::REGRESSION:
125cdf0e10cSrcweir return new AccStatisticsObject( pParent,
126cdf0e10cSrcweir static_cast< AccStatisticsObject::StatisticsObjectType >( nObjId ),
127cdf0e10cSrcweir rId.GetIndex1() );
128cdf0e10cSrcweir
129cdf0e10cSrcweir case CHOBJID_DIAGRAM_WALL:
130cdf0e10cSrcweir return new AccWall( pParent );
131cdf0e10cSrcweir
132cdf0e10cSrcweir case CHOBJID_DIAGRAM_FLOOR:
133cdf0e10cSrcweir return new AccFloor( pParent );
134cdf0e10cSrcweir
135cdf0e10cSrcweir case CHOBJID_DIAGRAM_AREA:
136cdf0e10cSrcweir return new AccArea( pParent );
137cdf0e10cSrcweir }
138cdf0e10cSrcweir */
139cdf0e10cSrcweir }
140cdf0e10cSrcweir
141cdf0e10cSrcweir } // namespace chart
142