Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "PolarCoordinateSystem.hxx"
21 : #include "macros.hxx"
22 : #include "servicenames_coosystems.hxx"
23 :
24 : using namespace ::com::sun::star;
25 :
26 : using ::com::sun::star::uno::RuntimeException;
27 : using ::com::sun::star::uno::Reference;
28 : using ::com::sun::star::uno::Sequence;
29 : using ::rtl::OUString;
30 :
31 : namespace
32 : {
33 :
34 1 : static const ::rtl::OUString lcl_aServiceNamePolar2d(
35 : RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.PolarCoordinateSystem2d" ));
36 1 : static const ::rtl::OUString lcl_aServiceNamePolar3d(
37 : RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.PolarCoordinateSystem3d" ));
38 :
39 1 : static const ::rtl::OUString lcl_aImplementationNamePolar2d(
40 : RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PolarCoordinateSystem2d" ));
41 1 : static const ::rtl::OUString lcl_aImplementationNamePolar3d(
42 : RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PolarCoordinateSystem3d" ));
43 : }
44 :
45 : namespace chart
46 : {
47 :
48 : // explicit
49 37 : PolarCoordinateSystem::PolarCoordinateSystem(
50 : const uno::Reference< uno::XComponentContext > & xContext,
51 : sal_Int32 nDimensionCount /* = 2 */,
52 : sal_Bool bSwapXAndYAxis /* = sal_False */ ) :
53 37 : BaseCoordinateSystem( xContext, nDimensionCount, bSwapXAndYAxis )
54 37 : {}
55 :
56 0 : PolarCoordinateSystem::PolarCoordinateSystem(
57 : const PolarCoordinateSystem & rSource ) :
58 0 : BaseCoordinateSystem( rSource )
59 0 : {}
60 :
61 37 : PolarCoordinateSystem::~PolarCoordinateSystem()
62 37 : {}
63 :
64 : // ____ XCoordinateSystem ____
65 0 : ::rtl::OUString SAL_CALL PolarCoordinateSystem::getCoordinateSystemType()
66 : throw (RuntimeException)
67 : {
68 0 : return CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
69 : }
70 :
71 0 : ::rtl::OUString SAL_CALL PolarCoordinateSystem::getViewServiceName()
72 : throw (RuntimeException)
73 : {
74 0 : return CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME;
75 : }
76 :
77 : // ____ XCloneable ____
78 0 : uno::Reference< util::XCloneable > SAL_CALL PolarCoordinateSystem::createClone()
79 : throw (RuntimeException)
80 : {
81 0 : return Reference< util::XCloneable >( new PolarCoordinateSystem( *this ));
82 : }
83 :
84 : // ____ XServiceInfo ____
85 0 : Sequence< OUString > PolarCoordinateSystem::getSupportedServiceNames_Static()
86 : {
87 0 : Sequence< OUString > aServices( 1 );
88 0 : aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
89 0 : return aServices;
90 : }
91 :
92 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
93 0 : APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem,
94 : C2U( "com.sun.star.comp.chart.PolarCoordinateSystem" ))
95 :
96 :
97 : // =================================
98 : // ==== PolarCoordinateSystem2d ====
99 : // =================================
100 :
101 37 : PolarCoordinateSystem2d::PolarCoordinateSystem2d(
102 : const uno::Reference< uno::XComponentContext > & xContext ) :
103 37 : PolarCoordinateSystem( xContext, 2, sal_False )
104 37 : {}
105 :
106 74 : PolarCoordinateSystem2d::~PolarCoordinateSystem2d()
107 74 : {}
108 :
109 : // ____ XServiceInfo ____
110 1 : Sequence< OUString > PolarCoordinateSystem2d::getSupportedServiceNames_Static()
111 : {
112 1 : Sequence< OUString > aServices( 2 );
113 1 : aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
114 1 : aServices[ 1 ] = lcl_aServiceNamePolar2d;
115 1 : return aServices;
116 : }
117 :
118 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
119 16 : APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem2d, lcl_aImplementationNamePolar2d )
120 :
121 : // =================================
122 : // ==== PolarCoordinateSystem3d ====
123 : // =================================
124 :
125 0 : PolarCoordinateSystem3d::PolarCoordinateSystem3d(
126 : const uno::Reference< uno::XComponentContext > & xContext ) :
127 0 : PolarCoordinateSystem( xContext, 3, sal_False )
128 0 : {}
129 :
130 0 : PolarCoordinateSystem3d::~PolarCoordinateSystem3d()
131 0 : {}
132 :
133 : // ____ XServiceInfo ____
134 0 : Sequence< OUString > PolarCoordinateSystem3d::getSupportedServiceNames_Static()
135 : {
136 0 : Sequence< OUString > aServices( 2 );
137 0 : aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
138 0 : aServices[ 1 ] = lcl_aServiceNamePolar3d;
139 0 : return aServices;
140 : }
141 :
142 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
143 16 : APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem3d, lcl_aImplementationNamePolar3d )
144 :
145 3 : } // namespace chart
146 :
147 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|