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 "PolarCoordinateSystem.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_aServiceNamePolar2d(
41     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.PolarCoordinateSystem2d" ));
42 static const ::rtl::OUString lcl_aServiceNamePolar3d(
43     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.PolarCoordinateSystem3d" ));
44 
45 static const ::rtl::OUString lcl_aImplementationNamePolar2d(
46     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PolarCoordinateSystem2d" ));
47 static const ::rtl::OUString lcl_aImplementationNamePolar3d(
48     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PolarCoordinateSystem3d" ));
49 }
50 
51 namespace chart
52 {
53 
54 // explicit
PolarCoordinateSystem(const uno::Reference<uno::XComponentContext> & xContext,sal_Int32 nDimensionCount,sal_Bool bSwapXAndYAxis)55 PolarCoordinateSystem::PolarCoordinateSystem(
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 
PolarCoordinateSystem(const PolarCoordinateSystem & rSource)62 PolarCoordinateSystem::PolarCoordinateSystem(
63     const PolarCoordinateSystem & rSource ) :
64         BaseCoordinateSystem( rSource )
65 {}
66 
~PolarCoordinateSystem()67 PolarCoordinateSystem::~PolarCoordinateSystem()
68 {}
69 
70 // ____ XCoordinateSystem ____
getCoordinateSystemType()71 ::rtl::OUString SAL_CALL PolarCoordinateSystem::getCoordinateSystemType()
72     throw (RuntimeException)
73 {
74     return CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
75 }
76 
getViewServiceName()77 ::rtl::OUString SAL_CALL PolarCoordinateSystem::getViewServiceName()
78     throw (RuntimeException)
79 {
80     return CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME;
81 }
82 
83 // ____ XCloneable ____
createClone()84 uno::Reference< util::XCloneable > SAL_CALL PolarCoordinateSystem::createClone()
85     throw (RuntimeException)
86 {
87     return Reference< util::XCloneable >( new PolarCoordinateSystem( *this ));
88 }
89 
90 // ____ XServiceInfo ____
getSupportedServiceNames_Static()91 Sequence< OUString > PolarCoordinateSystem::getSupportedServiceNames_Static()
92 {
93     Sequence< OUString > aServices( 1 );
94     aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
95     return aServices;
96 }
97 
98 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
99 APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem,
100                              C2U( "com.sun.star.comp.chart.PolarCoordinateSystem" ))
101 
102 
103 // =================================
104 // ==== PolarCoordinateSystem2d ====
105 // =================================
106 
PolarCoordinateSystem2d(const uno::Reference<uno::XComponentContext> & xContext)107 PolarCoordinateSystem2d::PolarCoordinateSystem2d(
108     const uno::Reference< uno::XComponentContext > & xContext ) :
109         PolarCoordinateSystem( xContext, 2, sal_False )
110 {}
111 
~PolarCoordinateSystem2d()112 PolarCoordinateSystem2d::~PolarCoordinateSystem2d()
113 {}
114 
115 // ____ XServiceInfo ____
getSupportedServiceNames_Static()116 Sequence< OUString > PolarCoordinateSystem2d::getSupportedServiceNames_Static()
117 {
118     Sequence< OUString > aServices( 2 );
119     aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
120     aServices[ 1 ] = lcl_aServiceNamePolar2d;
121     return aServices;
122 }
123 
124 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
APPHELPER_XSERVICEINFO_IMPL(PolarCoordinateSystem2d,lcl_aImplementationNamePolar2d)125 APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem2d, lcl_aImplementationNamePolar2d )
126 
127 // =================================
128 // ==== PolarCoordinateSystem3d ====
129 // =================================
130 
131 PolarCoordinateSystem3d::PolarCoordinateSystem3d(
132     const uno::Reference< uno::XComponentContext > & xContext ) :
133         PolarCoordinateSystem( xContext, 3, sal_False )
134 {}
135 
~PolarCoordinateSystem3d()136 PolarCoordinateSystem3d::~PolarCoordinateSystem3d()
137 {}
138 
139 // ____ XServiceInfo ____
getSupportedServiceNames_Static()140 Sequence< OUString > PolarCoordinateSystem3d::getSupportedServiceNames_Static()
141 {
142     Sequence< OUString > aServices( 2 );
143     aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
144     aServices[ 1 ] = lcl_aServiceNamePolar3d;
145     return aServices;
146 }
147 
148 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
149 APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem3d, lcl_aImplementationNamePolar3d )
150 
151 }  // namespace chart
152