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 :
30 : namespace
31 : {
32 :
33 36 : static const OUString lcl_aServiceNamePolar2d( "com.sun.star.chart2.PolarCoordinateSystem2d" );
34 36 : static const OUString lcl_aServiceNamePolar3d( "com.sun.star.chart2.PolarCoordinateSystem3d" );
35 :
36 36 : static const OUString lcl_aImplementationNamePolar2d( "com.sun.star.comp.chart2.PolarCoordinateSystem2d" );
37 36 : static const OUString lcl_aImplementationNamePolar3d( "com.sun.star.comp.chart2.PolarCoordinateSystem3d" );
38 : }
39 :
40 : namespace chart
41 : {
42 :
43 : // explicit
44 168 : PolarCoordinateSystem::PolarCoordinateSystem(
45 : const uno::Reference< uno::XComponentContext > & xContext,
46 : sal_Int32 nDimensionCount /* = 2 */,
47 : bool bSwapXAndYAxis /* = sal_False */ ) :
48 168 : BaseCoordinateSystem( xContext, nDimensionCount, bSwapXAndYAxis )
49 168 : {}
50 :
51 0 : PolarCoordinateSystem::PolarCoordinateSystem(
52 : const PolarCoordinateSystem & rSource ) :
53 0 : BaseCoordinateSystem( rSource )
54 0 : {}
55 :
56 208 : PolarCoordinateSystem::~PolarCoordinateSystem()
57 208 : {}
58 :
59 : // ____ XCoordinateSystem ____
60 4 : OUString SAL_CALL PolarCoordinateSystem::getCoordinateSystemType()
61 : throw (RuntimeException, std::exception)
62 : {
63 4 : return CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
64 : }
65 :
66 20 : OUString SAL_CALL PolarCoordinateSystem::getViewServiceName()
67 : throw (RuntimeException, std::exception)
68 : {
69 20 : return CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME;
70 : }
71 :
72 : // ____ XCloneable ____
73 0 : uno::Reference< util::XCloneable > SAL_CALL PolarCoordinateSystem::createClone()
74 : throw (RuntimeException, std::exception)
75 : {
76 0 : return Reference< util::XCloneable >( new PolarCoordinateSystem( *this ));
77 : }
78 :
79 : // ____ XServiceInfo ____
80 0 : Sequence< OUString > PolarCoordinateSystem::getSupportedServiceNames_Static()
81 : {
82 0 : Sequence< OUString > aServices( 1 );
83 0 : aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
84 0 : return aServices;
85 : }
86 :
87 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
88 0 : APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem,
89 : OUString("com.sun.star.comp.chart.PolarCoordinateSystem") )
90 :
91 : // ==== PolarCoordinateSystem2d ====
92 :
93 110 : PolarCoordinateSystem2d::PolarCoordinateSystem2d(
94 : const uno::Reference< uno::XComponentContext > & xContext ) :
95 110 : PolarCoordinateSystem( xContext, 2, false )
96 110 : {}
97 :
98 220 : PolarCoordinateSystem2d::~PolarCoordinateSystem2d()
99 220 : {}
100 :
101 : // ____ XServiceInfo ____
102 12 : Sequence< OUString > PolarCoordinateSystem2d::getSupportedServiceNames_Static()
103 : {
104 12 : Sequence< OUString > aServices( 2 );
105 12 : aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
106 12 : aServices[ 1 ] = lcl_aServiceNamePolar2d;
107 12 : return aServices;
108 : }
109 :
110 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
111 486 : APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem2d, lcl_aImplementationNamePolar2d )
112 :
113 : // ==== PolarCoordinateSystem3d ====
114 :
115 14 : PolarCoordinateSystem3d::PolarCoordinateSystem3d(
116 : const uno::Reference< uno::XComponentContext > & xContext ) :
117 14 : PolarCoordinateSystem( xContext, 3, false )
118 14 : {}
119 :
120 28 : PolarCoordinateSystem3d::~PolarCoordinateSystem3d()
121 28 : {}
122 :
123 : // ____ XServiceInfo ____
124 4 : Sequence< OUString > PolarCoordinateSystem3d::getSupportedServiceNames_Static()
125 : {
126 4 : Sequence< OUString > aServices( 2 );
127 4 : aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
128 4 : aServices[ 1 ] = lcl_aServiceNamePolar3d;
129 4 : return aServices;
130 : }
131 :
132 : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
133 486 : APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem3d, lcl_aImplementationNamePolar3d )
134 :
135 108 : } // namespace chart
136 :
137 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|