merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / model / inc / DataSeries.hxx
blob310f2f57a07fff34d5f127126ae480cba154ded8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DataSeries.hxx,v $
10 * $Revision: 1.4 $
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_DATASERIES_HXX
31 #define _CHART_DATASERIES_HXX
33 // UNO types
34 #include <com/sun/star/chart2/XDataSeries.hpp>
35 #include <com/sun/star/chart2/data/XDataSink.hpp>
36 #include <com/sun/star/chart2/data/XDataSource.hpp>
37 #include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
38 #include <com/sun/star/util/XCloneable.hpp>
39 #include <com/sun/star/util/XModifyBroadcaster.hpp>
40 #include <com/sun/star/util/XModifyListener.hpp>
41 #include <com/sun/star/container/XIndexContainer.hpp>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/beans/XPropertySet.hpp>
44 #include <com/sun/star/uno/XComponentContext.hpp>
46 // helper classes
47 #include "ServiceMacros.hxx"
48 #include <cppuhelper/implbase8.hxx>
49 #include <comphelper/uno3.hxx>
50 #include <osl/mutex.hxx>
52 // STL
53 #include <vector>
54 #include <map>
56 #include "MutexContainer.hxx"
57 #include "OPropertySet.hxx"
59 namespace com { namespace sun { namespace star { namespace style {
60 class XStyle;
61 }}}}
63 namespace chart
66 namespace impl
68 typedef ::cppu::WeakImplHelper8<
69 ::com::sun::star::chart2::XDataSeries,
70 ::com::sun::star::chart2::data::XDataSink,
71 ::com::sun::star::chart2::data::XDataSource,
72 ::com::sun::star::lang::XServiceInfo,
73 ::com::sun::star::chart2::XRegressionCurveContainer,
74 ::com::sun::star::util::XCloneable,
75 ::com::sun::star::util::XModifyBroadcaster,
76 ::com::sun::star::util::XModifyListener >
77 DataSeries_Base;
80 class DataSeries :
81 public MutexContainer,
82 public impl::DataSeries_Base,
83 public ::property::OPropertySet
85 public:
86 explicit DataSeries(
87 const ::com::sun::star::uno::Reference<
88 ::com::sun::star::uno::XComponentContext > & xContext );
89 virtual ~DataSeries();
91 /// establish methods for factory instatiation
92 APPHELPER_SERVICE_FACTORY_HELPER( DataSeries )
93 /// XServiceInfo declarations
94 APPHELPER_XSERVICEINFO_DECL()
96 /// merge XInterface implementations
97 DECLARE_XINTERFACE()
98 /// merge XTypeProvider implementations
99 DECLARE_XTYPEPROVIDER()
101 protected:
102 explicit DataSeries( const DataSeries & rOther );
104 // late initialization to call after copy-constructing
105 void Init( const DataSeries & rOther );
107 // ____ XDataSeries ____
108 // _____________________
109 /// @see ::com::sun::star::chart2::XDataSeries
110 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
111 SAL_CALL getDataPointByIndex( sal_Int32 nIndex )
112 throw (::com::sun::star::lang::IndexOutOfBoundsException,
113 ::com::sun::star::uno::RuntimeException);
114 virtual void SAL_CALL resetDataPoint( sal_Int32 nIndex )
115 throw (::com::sun::star::uno::RuntimeException);
116 virtual void SAL_CALL resetAllDataPoints()
117 throw (::com::sun::star::uno::RuntimeException);
119 // ____ XDataSink ____
120 // ___________________
121 /// @see ::com::sun::star::chart2::data::XDataSink
122 virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >& aData )
123 throw (::com::sun::star::uno::RuntimeException);
125 // ____ XDataSource ____
126 // _____________________
127 /// @see ::com::sun::star::chart2::data::XDataSource
128 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences()
129 throw (::com::sun::star::uno::RuntimeException);
131 // ____ OPropertySet ____
132 // ______________________
133 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
134 throw(::com::sun::star::beans::UnknownPropertyException);
135 virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
136 virtual void SAL_CALL setFastPropertyValue_NoBroadcast
137 ( sal_Int32 nHandle,
138 const ::com::sun::star::uno::Any& rValue )
139 throw (::com::sun::star::uno::Exception);
141 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
143 // ____ XPropertySet ____
144 // ______________________
145 /// @see ::com::sun::star::beans::XPropertySet
146 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
147 getPropertySetInfo()
148 throw (::com::sun::star::uno::RuntimeException);
150 /// make original interface function visible again
151 using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue;
153 // ____ XRegressionCurveContainer ____
154 // ___________________________________
155 /// @see ::com::sun::star::chart2::XRegressionCurveContainer
156 virtual void SAL_CALL addRegressionCurve(
157 const ::com::sun::star::uno::Reference<
158 ::com::sun::star::chart2::XRegressionCurve >& aRegressionCurve )
159 throw (::com::sun::star::lang::IllegalArgumentException,
160 ::com::sun::star::uno::RuntimeException);
161 virtual void SAL_CALL removeRegressionCurve(
162 const ::com::sun::star::uno::Reference<
163 ::com::sun::star::chart2::XRegressionCurve >& aRegressionCurve )
164 throw (::com::sun::star::container::NoSuchElementException,
165 ::com::sun::star::uno::RuntimeException);
166 virtual ::com::sun::star::uno::Sequence<
167 ::com::sun::star::uno::Reference<
168 ::com::sun::star::chart2::XRegressionCurve > > SAL_CALL getRegressionCurves()
169 throw (::com::sun::star::uno::RuntimeException);
170 virtual void SAL_CALL setRegressionCurves(
171 const ::com::sun::star::uno::Sequence<
172 ::com::sun::star::uno::Reference<
173 ::com::sun::star::chart2::XRegressionCurve > >& aRegressionCurves )
174 throw (::com::sun::star::uno::RuntimeException);
176 // ____ XCloneable ____
177 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
178 throw (::com::sun::star::uno::RuntimeException);
180 // ____ XModifyBroadcaster ____
181 virtual void SAL_CALL addModifyListener(
182 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
183 throw (::com::sun::star::uno::RuntimeException);
184 virtual void SAL_CALL removeModifyListener(
185 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
186 throw (::com::sun::star::uno::RuntimeException);
188 // ____ XModifyListener ____
189 virtual void SAL_CALL modified(
190 const ::com::sun::star::lang::EventObject& aEvent )
191 throw (::com::sun::star::uno::RuntimeException);
193 // ____ XEventListener (base of XModifyListener) ____
194 virtual void SAL_CALL disposing(
195 const ::com::sun::star::lang::EventObject& Source )
196 throw (::com::sun::star::uno::RuntimeException);
198 // ____ OPropertySet ____
199 virtual void firePropertyChangeEvent();
200 using OPropertySet::disposing;
202 void fireModifyEvent();
204 /** const variant of getInfoHelper()
206 ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const;
208 private:
209 ::com::sun::star::uno::Reference<
210 ::com::sun::star::uno::XComponentContext >
211 m_xContext;
212 typedef ::std::vector< ::com::sun::star::uno::Reference<
213 ::com::sun::star::chart2::data::XLabeledDataSequence > > tDataSequenceContainer;
214 tDataSequenceContainer m_aDataSequences;
216 typedef ::std::map< sal_Int32,
217 ::com::sun::star::uno::Reference<
218 ::com::sun::star::beans::XPropertySet > > tDataPointAttributeContainer;
219 tDataPointAttributeContainer m_aAttributedDataPoints;
221 typedef
222 ::std::vector< ::com::sun::star::uno::Reference<
223 ::com::sun::star::chart2::XRegressionCurve > >
224 tRegressionCurveContainerType;
225 tRegressionCurveContainerType m_aRegressionCurves;
227 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
230 } // namespace chart
232 // _CHART_DATASERIES_HXX
233 #endif