xref: /trunk/main/chart2/source/model/main/CartesianCoordinateSystem.cxx (revision 9c15e1abd703a7953928d7a80655ae1a76a41f6d)
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_chartmodel.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
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 
62 CartesianCoordinateSystem::CartesianCoordinateSystem(
63     const CartesianCoordinateSystem & rSource ) :
64         BaseCoordinateSystem( rSource )
65 {}
66 
67 CartesianCoordinateSystem::~CartesianCoordinateSystem()
68 {}
69 
70 // ____ XCoordinateSystem ____
71 ::rtl::OUString SAL_CALL CartesianCoordinateSystem::getCoordinateSystemType()
72 {
73     return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
74 }
75 
76 ::rtl::OUString SAL_CALL CartesianCoordinateSystem::getViewServiceName()
77 {
78     return CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME;
79 }
80 
81 // ____ XCloneable ____
82 uno::Reference< util::XCloneable > SAL_CALL CartesianCoordinateSystem::createClone()
83 {
84     return Reference< util::XCloneable >( new CartesianCoordinateSystem( *this ));
85 }
86 
87 // ____ XServiceInfo ____
88 Sequence< OUString > CartesianCoordinateSystem::getSupportedServiceNames_Static()
89 {
90     Sequence< OUString > aServices( 1 );
91     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
92     return aServices;
93 }
94 
95 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
96 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem,
97                              C2U( "com.sun.star.comp.chart.CartesianCoordinateSystem" ))
98 
99 
100 // =================================
101 // ==== CartesianCoordinateSystem2d ====
102 // =================================
103 
104 CartesianCoordinateSystem2d::CartesianCoordinateSystem2d(
105     const uno::Reference< uno::XComponentContext > & xContext ) :
106         CartesianCoordinateSystem( xContext, 2, sal_False )
107 {}
108 
109 CartesianCoordinateSystem2d::~CartesianCoordinateSystem2d()
110 {}
111 
112 // ____ XServiceInfo ____
113 Sequence< OUString > CartesianCoordinateSystem2d::getSupportedServiceNames_Static()
114 {
115     Sequence< OUString > aServices( 2 );
116     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
117     aServices[ 1 ] = lcl_aServiceNameCartesian2d;
118     return aServices;
119 }
120 
121 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
122 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem2d, lcl_aImplementationNameCartesian2d )
123 
124 // =================================
125 // ==== CartesianCoordinateSystem3d ====
126 // =================================
127 
128 CartesianCoordinateSystem3d::CartesianCoordinateSystem3d(
129     const uno::Reference< uno::XComponentContext > & xContext ) :
130         CartesianCoordinateSystem( xContext, 3, sal_False )
131 {}
132 
133 CartesianCoordinateSystem3d::~CartesianCoordinateSystem3d()
134 {}
135 
136 // ____ XServiceInfo ____
137 Sequence< OUString > CartesianCoordinateSystem3d::getSupportedServiceNames_Static()
138 {
139     Sequence< OUString > aServices( 2 );
140     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
141     aServices[ 1 ] = lcl_aServiceNameCartesian3d;
142     return aServices;
143 }
144 
145 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
146 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem3d, lcl_aImplementationNameCartesian3d )
147 
148 }  // namespace chart
149