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 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_chart2.hxx"
26 #include "CartesianCoordinateSystem.hxx"
27 #include "macros.hxx"
28 #include "servicenames_coosystems.hxx"
29 
30 using namespace ::com::sun::star;
31 
32 using ::com::sun::star::uno::RuntimeException;
33 using ::com::sun::star::uno::Reference;
34 using ::com::sun::star::uno::Sequence;
35 using ::rtl::OUString;
36 
37 namespace
38 {
39 
40 static const ::rtl::OUString lcl_aServiceNameCartesian2d(
41     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.CartesianCoordinateSystem2d" ));
42 static const ::rtl::OUString lcl_aServiceNameCartesian3d(
43     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.CartesianCoordinateSystem3d" ));
44 
45 static const ::rtl::OUString lcl_aImplementationNameCartesian2d(
46     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.CartesianCoordinateSystem2d" ));
47 static const ::rtl::OUString lcl_aImplementationNameCartesian3d(
48     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.CartesianCoordinateSystem3d" ));
49 }
50 
51 namespace chart
52 {
53 
54 // explicit
CartesianCoordinateSystem(const uno::Reference<uno::XComponentContext> & xContext,sal_Int32 nDimensionCount,sal_Bool bSwapXAndYAxis)55 CartesianCoordinateSystem::CartesianCoordinateSystem(
56     const uno::Reference< uno::XComponentContext > & xContext,
57     sal_Int32 nDimensionCount /* = 2 */,
58     sal_Bool bSwapXAndYAxis /* = sal_False */ ) :
59         BaseCoordinateSystem( xContext, nDimensionCount, bSwapXAndYAxis )
60 {}
61 
CartesianCoordinateSystem(const CartesianCoordinateSystem & rSource)62 CartesianCoordinateSystem::CartesianCoordinateSystem(
63     const CartesianCoordinateSystem & rSource ) :
64         BaseCoordinateSystem( rSource )
65 {}
66 
~CartesianCoordinateSystem()67 CartesianCoordinateSystem::~CartesianCoordinateSystem()
68 {}
69 
70 // ____ XCoordinateSystem ____
getCoordinateSystemType()71 ::rtl::OUString SAL_CALL CartesianCoordinateSystem::getCoordinateSystemType()
72     throw (RuntimeException)
73 {
74     return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
75 }
76 
getViewServiceName()77 ::rtl::OUString SAL_CALL CartesianCoordinateSystem::getViewServiceName()
78     throw (RuntimeException)
79 {
80     return CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME;
81 }
82 
83 // ____ XCloneable ____
createClone()84 uno::Reference< util::XCloneable > SAL_CALL CartesianCoordinateSystem::createClone()
85     throw (RuntimeException)
86 {
87     return Reference< util::XCloneable >( new CartesianCoordinateSystem( *this ));
88 }
89 
90 // ____ XServiceInfo ____
getSupportedServiceNames_Static()91 Sequence< OUString > CartesianCoordinateSystem::getSupportedServiceNames_Static()
92 {
93     Sequence< OUString > aServices( 1 );
94     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
95     return aServices;
96 }
97 
98 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
99 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem,
100                              C2U( "com.sun.star.comp.chart.CartesianCoordinateSystem" ))
101 
102 
103 // =================================
104 // ==== CartesianCoordinateSystem2d ====
105 // =================================
106 
CartesianCoordinateSystem2d(const uno::Reference<uno::XComponentContext> & xContext)107 CartesianCoordinateSystem2d::CartesianCoordinateSystem2d(
108     const uno::Reference< uno::XComponentContext > & xContext ) :
109         CartesianCoordinateSystem( xContext, 2, sal_False )
110 {}
111 
~CartesianCoordinateSystem2d()112 CartesianCoordinateSystem2d::~CartesianCoordinateSystem2d()
113 {}
114 
115 // ____ XServiceInfo ____
getSupportedServiceNames_Static()116 Sequence< OUString > CartesianCoordinateSystem2d::getSupportedServiceNames_Static()
117 {
118     Sequence< OUString > aServices( 2 );
119     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
120     aServices[ 1 ] = lcl_aServiceNameCartesian2d;
121     return aServices;
122 }
123 
124 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
APPHELPER_XSERVICEINFO_IMPL(CartesianCoordinateSystem2d,lcl_aImplementationNameCartesian2d)125 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem2d, lcl_aImplementationNameCartesian2d )
126 
127 // =================================
128 // ==== CartesianCoordinateSystem3d ====
129 // =================================
130 
131 CartesianCoordinateSystem3d::CartesianCoordinateSystem3d(
132     const uno::Reference< uno::XComponentContext > & xContext ) :
133         CartesianCoordinateSystem( xContext, 3, sal_False )
134 {}
135 
~CartesianCoordinateSystem3d()136 CartesianCoordinateSystem3d::~CartesianCoordinateSystem3d()
137 {}
138 
139 // ____ XServiceInfo ____
getSupportedServiceNames_Static()140 Sequence< OUString > CartesianCoordinateSystem3d::getSupportedServiceNames_Static()
141 {
142     Sequence< OUString > aServices( 2 );
143     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
144     aServices[ 1 ] = lcl_aServiceNameCartesian3d;
145     return aServices;
146 }
147 
148 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
149 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem3d, lcl_aImplementationNameCartesian3d )
150 
151 }  // namespace chart
152