xref: /trunk/main/chart2/source/model/main/CartesianCoordinateSystem.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_chart2.hxx"
30 #include "CartesianCoordinateSystem.hxx"
31 #include "macros.hxx"
32 #include "servicenames_coosystems.hxx"
33 
34 using namespace ::com::sun::star;
35 
36 using ::com::sun::star::uno::RuntimeException;
37 using ::com::sun::star::uno::Reference;
38 using ::com::sun::star::uno::Sequence;
39 using ::rtl::OUString;
40 
41 namespace
42 {
43 
44 static const ::rtl::OUString lcl_aServiceNameCartesian2d(
45     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.CartesianCoordinateSystem2d" ));
46 static const ::rtl::OUString lcl_aServiceNameCartesian3d(
47     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.CartesianCoordinateSystem3d" ));
48 
49 static const ::rtl::OUString lcl_aImplementationNameCartesian2d(
50     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.CartesianCoordinateSystem2d" ));
51 static const ::rtl::OUString lcl_aImplementationNameCartesian3d(
52     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.CartesianCoordinateSystem3d" ));
53 }
54 
55 namespace chart
56 {
57 
58 // explicit
59 CartesianCoordinateSystem::CartesianCoordinateSystem(
60     const uno::Reference< uno::XComponentContext > & xContext,
61     sal_Int32 nDimensionCount /* = 2 */,
62     sal_Bool bSwapXAndYAxis /* = sal_False */ ) :
63         BaseCoordinateSystem( xContext, nDimensionCount, bSwapXAndYAxis )
64 {}
65 
66 CartesianCoordinateSystem::CartesianCoordinateSystem(
67     const CartesianCoordinateSystem & rSource ) :
68         BaseCoordinateSystem( rSource )
69 {}
70 
71 CartesianCoordinateSystem::~CartesianCoordinateSystem()
72 {}
73 
74 // ____ XCoordinateSystem ____
75 ::rtl::OUString SAL_CALL CartesianCoordinateSystem::getCoordinateSystemType()
76     throw (RuntimeException)
77 {
78     return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
79 }
80 
81 ::rtl::OUString SAL_CALL CartesianCoordinateSystem::getViewServiceName()
82     throw (RuntimeException)
83 {
84     return CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME;
85 }
86 
87 // ____ XCloneable ____
88 uno::Reference< util::XCloneable > SAL_CALL CartesianCoordinateSystem::createClone()
89     throw (RuntimeException)
90 {
91     return Reference< util::XCloneable >( new CartesianCoordinateSystem( *this ));
92 }
93 
94 // ____ XServiceInfo ____
95 Sequence< OUString > CartesianCoordinateSystem::getSupportedServiceNames_Static()
96 {
97     Sequence< OUString > aServices( 1 );
98     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
99     return aServices;
100 }
101 
102 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
103 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem,
104                              C2U( "com.sun.star.comp.chart.CartesianCoordinateSystem" ))
105 
106 
107 // =================================
108 // ==== CartesianCoordinateSystem2d ====
109 // =================================
110 
111 CartesianCoordinateSystem2d::CartesianCoordinateSystem2d(
112     const uno::Reference< uno::XComponentContext > & xContext ) :
113         CartesianCoordinateSystem( xContext, 2, sal_False )
114 {}
115 
116 CartesianCoordinateSystem2d::~CartesianCoordinateSystem2d()
117 {}
118 
119 // ____ XServiceInfo ____
120 Sequence< OUString > CartesianCoordinateSystem2d::getSupportedServiceNames_Static()
121 {
122     Sequence< OUString > aServices( 2 );
123     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
124     aServices[ 1 ] = lcl_aServiceNameCartesian2d;
125     return aServices;
126 }
127 
128 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
129 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem2d, lcl_aImplementationNameCartesian2d )
130 
131 // =================================
132 // ==== CartesianCoordinateSystem3d ====
133 // =================================
134 
135 CartesianCoordinateSystem3d::CartesianCoordinateSystem3d(
136     const uno::Reference< uno::XComponentContext > & xContext ) :
137         CartesianCoordinateSystem( xContext, 3, sal_False )
138 {}
139 
140 CartesianCoordinateSystem3d::~CartesianCoordinateSystem3d()
141 {}
142 
143 // ____ XServiceInfo ____
144 Sequence< OUString > CartesianCoordinateSystem3d::getSupportedServiceNames_Static()
145 {
146     Sequence< OUString > aServices( 2 );
147     aServices[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
148     aServices[ 1 ] = lcl_aServiceNameCartesian3d;
149     return aServices;
150 }
151 
152 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
153 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem3d, lcl_aImplementationNameCartesian3d )
154 
155 }  // namespace chart
156