1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: BaseCoordinateSystem.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART_COORDINATESYSTEM_HXX
31 #define CHART_COORDINATESYSTEM_HXX
33 #include "ServiceMacros.hxx"
34 #include "OPropertySet.hxx"
35 #include "MutexContainer.hxx"
36 #include <cppuhelper/implbase6.hxx>
37 #include <comphelper/uno3.hxx>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/uno/XComponentContext.hpp>
40 #include <com/sun/star/chart2/XCoordinateSystem.hpp>
41 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
42 #include <com/sun/star/util/XCloneable.hpp>
43 #include <com/sun/star/util/XModifyBroadcaster.hpp>
44 #include <com/sun/star/util/XModifyListener.hpp>
53 typedef ::cppu::WeakImplHelper6
54 < ::com::sun::star::lang::XServiceInfo
,
55 ::com::sun::star::chart2::XCoordinateSystem
,
56 ::com::sun::star::chart2::XChartTypeContainer
,
57 ::com::sun::star::util::XCloneable
,
58 ::com::sun::star::util::XModifyBroadcaster
,
59 ::com::sun::star::util::XModifyListener
>
60 BaseCoordinateSystem_Base
;
63 class BaseCoordinateSystem
:
64 public impl::BaseCoordinateSystem_Base
,
65 public MutexContainer
,
66 public ::property::OPropertySet
70 const ::com::sun::star::uno::Reference
<
71 ::com::sun::star::uno::XComponentContext
> & xContext
,
72 sal_Int32 nDimensionCount
= 2,
73 sal_Bool bSwapXAndYAxis
= sal_False
);
74 explicit BaseCoordinateSystem( const BaseCoordinateSystem
& rSource
);
75 virtual ~BaseCoordinateSystem();
77 // ____ OPropertySet ____
78 virtual ::com::sun::star::uno::Any
GetDefaultValue( sal_Int32 nHandle
) const
79 throw(::com::sun::star::beans::UnknownPropertyException
);
81 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
83 // ____ XPropertySet ____
84 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
86 throw (::com::sun::star::uno::RuntimeException
);
88 /// merge XInterface implementations
90 /// merge XTypeProvider implementations
91 DECLARE_XTYPEPROVIDER()
94 // ____ XCoordinateSystem ____
95 virtual ::sal_Int32 SAL_CALL
getDimension()
96 throw (::com::sun::star::uno::RuntimeException
);
98 // virtual ::rtl::OUString SAL_CALL getCoordinateSystemType()
99 // throw (::com::sun::star::uno::RuntimeException);
101 // virtual ::rtl::OUString SAL_CALL getViewServiceName()
102 // throw (::com::sun::star::uno::RuntimeException);
103 virtual void SAL_CALL
setAxisByDimension(
104 ::sal_Int32 nDimension
,
105 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XAxis
>& xAxis
,
107 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
108 ::com::sun::star::uno::RuntimeException
);
109 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XAxis
> SAL_CALL
getAxisByDimension(
110 ::sal_Int32 nDimension
, ::sal_Int32 nIndex
)
111 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
112 ::com::sun::star::uno::RuntimeException
);
113 virtual ::sal_Int32 SAL_CALL
getMaximumAxisIndexByDimension( ::sal_Int32 nDimension
)
114 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
115 ::com::sun::star::uno::RuntimeException
);
117 // ____ XChartTypeContainer ____
118 virtual void SAL_CALL
addChartType(
119 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XChartType
>& aChartType
)
120 throw (::com::sun::star::lang::IllegalArgumentException
,
121 ::com::sun::star::uno::RuntimeException
);
122 virtual void SAL_CALL
removeChartType(
123 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XChartType
>& aChartType
)
124 throw (::com::sun::star::container::NoSuchElementException
,
125 ::com::sun::star::uno::RuntimeException
);
126 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XChartType
> > SAL_CALL
getChartTypes()
127 throw (::com::sun::star::uno::RuntimeException
);
128 virtual void SAL_CALL
setChartTypes(
129 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XChartType
> >& aChartTypes
)
130 throw (::com::sun::star::lang::IllegalArgumentException
,
131 ::com::sun::star::uno::RuntimeException
);
133 // ____ XCloneable ____
135 // virtual ::com::sun::star::uno::Reference<
136 // ::com::sun::star::util::XCloneable > SAL_CALL createClone()
137 // throw (::com::sun::star::uno::RuntimeException);
139 // ____ XServiceInfo ____
141 // virtual ::rtl::OUString SAL_CALL getImplementationName()
142 // throw (::com::sun::star::uno::RuntimeException);
143 // virtual ::sal_Bool SAL_CALL supportsService(
144 // const ::rtl::OUString& ServiceName )
145 // throw (::com::sun::star::uno::RuntimeException);
146 // virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
147 // throw (::com::sun::star::uno::RuntimeException);
149 // ____ XModifyBroadcaster ____
150 virtual void SAL_CALL
addModifyListener(
151 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
152 throw (::com::sun::star::uno::RuntimeException
);
153 virtual void SAL_CALL
removeModifyListener(
154 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
155 throw (::com::sun::star::uno::RuntimeException
);
157 // ____ XModifyListener ____
158 virtual void SAL_CALL
modified(
159 const ::com::sun::star::lang::EventObject
& aEvent
)
160 throw (::com::sun::star::uno::RuntimeException
);
162 // ____ XEventListener (base of XModifyListener) ____
163 virtual void SAL_CALL
disposing(
164 const ::com::sun::star::lang::EventObject
& Source
)
165 throw (::com::sun::star::uno::RuntimeException
);
167 // ____ OPropertySet ____
168 virtual void firePropertyChangeEvent();
169 using OPropertySet::disposing
;
171 void fireModifyEvent();
174 ::com::sun::star::uno::Reference
<
175 ::com::sun::star::uno::XComponentContext
> m_xContext
;
177 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
> m_xModifyEventForwarder
;
180 sal_Int32 m_nDimensionCount
;
181 typedef ::std::vector
< ::std::vector
< ::com::sun::star::uno::Reference
<
182 ::com::sun::star::chart2::XAxis
> > > tAxisVecVecType
;
183 tAxisVecVecType m_aAllAxis
; //outer sequence is the dimension; inner sequence is the axis index that indicates main or secondary axis
184 ::com::sun::star::uno::Sequence
<
185 ::com::sun::star::uno::Any
> m_aOrigin
;
186 ::std::vector
< ::com::sun::star::uno::Reference
<
187 ::com::sun::star::chart2::XChartType
> > m_aChartTypes
;
192 // CHART_COORDINATESYSTEM_HXX