1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_chart2.hxx"
30 #include "CartesianCoordinateSystem.hxx"
32 #include "servicenames_coosystems.hxx"
34 using namespace ::com::sun::star
;
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
;
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" ));
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" ));
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
)
66 CartesianCoordinateSystem::CartesianCoordinateSystem(
67 const CartesianCoordinateSystem
& rSource
) :
68 BaseCoordinateSystem( rSource
)
71 CartesianCoordinateSystem::~CartesianCoordinateSystem()
74 // ____ XCoordinateSystem ____
75 ::rtl::OUString SAL_CALL
CartesianCoordinateSystem::getCoordinateSystemType()
76 throw (RuntimeException
)
78 return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME
;
81 ::rtl::OUString SAL_CALL
CartesianCoordinateSystem::getViewServiceName()
82 throw (RuntimeException
)
84 return CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME
;
87 // ____ XCloneable ____
88 uno::Reference
< util::XCloneable
> SAL_CALL
CartesianCoordinateSystem::createClone()
89 throw (RuntimeException
)
91 return Reference
< util::XCloneable
>( new CartesianCoordinateSystem( *this ));
94 // ____ XServiceInfo ____
95 Sequence
< OUString
> CartesianCoordinateSystem::getSupportedServiceNames_Static()
97 Sequence
< OUString
> aServices( 1 );
98 aServices
[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME
;
102 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
103 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem
,
104 C2U( "com.sun.star.comp.chart.CartesianCoordinateSystem" ))
107 // =================================
108 // ==== CartesianCoordinateSystem2d ====
109 // =================================
111 CartesianCoordinateSystem2d::CartesianCoordinateSystem2d(
112 const uno::Reference
< uno::XComponentContext
> & xContext
) :
113 CartesianCoordinateSystem( xContext
, 2, sal_False
)
116 CartesianCoordinateSystem2d::~CartesianCoordinateSystem2d()
119 // ____ XServiceInfo ____
120 Sequence
< OUString
> CartesianCoordinateSystem2d::getSupportedServiceNames_Static()
122 Sequence
< OUString
> aServices( 2 );
123 aServices
[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME
;
124 aServices
[ 1 ] = lcl_aServiceNameCartesian2d
;
128 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
129 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem2d
, lcl_aImplementationNameCartesian2d
)
131 // =================================
132 // ==== CartesianCoordinateSystem3d ====
133 // =================================
135 CartesianCoordinateSystem3d::CartesianCoordinateSystem3d(
136 const uno::Reference
< uno::XComponentContext
> & xContext
) :
137 CartesianCoordinateSystem( xContext
, 3, sal_False
)
140 CartesianCoordinateSystem3d::~CartesianCoordinateSystem3d()
143 // ____ XServiceInfo ____
144 Sequence
< OUString
> CartesianCoordinateSystem3d::getSupportedServiceNames_Static()
146 Sequence
< OUString
> aServices( 2 );
147 aServices
[ 0 ] = CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME
;
148 aServices
[ 1 ] = lcl_aServiceNameCartesian3d
;
152 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
153 APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem3d
, lcl_aImplementationNameCartesian3d
)