1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX
20 #define INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX
23 #include <com/sun/star/chart2/XDataSeries.hpp>
24 #include <com/sun/star/chart2/data/XDataSink.hpp>
25 #include <com/sun/star/chart2/data/XDataSource.hpp>
26 #include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
27 #include <com/sun/star/util/XCloneable.hpp>
28 #include <com/sun/star/util/XModifyBroadcaster.hpp>
29 #include <com/sun/star/util/XModifyListener.hpp>
30 #include <com/sun/star/container/XIndexContainer.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <cppuhelper/implbase8.hxx>
37 #include <comphelper/uno3.hxx>
38 #include <osl/mutex.hxx>
44 #include "MutexContainer.hxx"
45 #include "OPropertySet.hxx"
52 typedef ::cppu::WeakImplHelper8
<
53 ::com::sun::star::chart2::XDataSeries
,
54 ::com::sun::star::chart2::data::XDataSink
,
55 ::com::sun::star::chart2::data::XDataSource
,
56 ::com::sun::star::lang::XServiceInfo
,
57 ::com::sun::star::chart2::XRegressionCurveContainer
,
58 ::com::sun::star::util::XCloneable
,
59 ::com::sun::star::util::XModifyBroadcaster
,
60 ::com::sun::star::util::XModifyListener
>
65 public MutexContainer
,
66 public impl::DataSeries_Base
,
67 public ::property::OPropertySet
71 const ::com::sun::star::uno::Reference
<
72 ::com::sun::star::uno::XComponentContext
> & xContext
);
73 virtual ~DataSeries();
75 /// establish methods for factory instatiation
76 static css::uno::Reference
< css::uno::XInterface
> SAL_CALL
create( css::uno::Reference
< css::uno::XComponentContext
> const & xContext
)
77 throw(css::uno::Exception
)
79 return (::cppu::OWeakObject
*)new DataSeries( xContext
);
81 /// XServiceInfo declarations
82 virtual OUString SAL_CALL
getImplementationName()
83 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
85 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
87 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 static OUString
getImplementationName_Static();
90 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
92 /// merge XInterface implementations
94 /// merge XTypeProvider implementations
95 DECLARE_XTYPEPROVIDER()
98 explicit DataSeries( const DataSeries
& rOther
);
100 // late initialization to call after copy-constructing
101 void Init( const DataSeries
& rOther
);
103 // ____ XDataSeries ____
104 /// @see ::com::sun::star::chart2::XDataSeries
105 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>
106 SAL_CALL
getDataPointByIndex( sal_Int32 nIndex
)
107 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
108 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 virtual void SAL_CALL
resetDataPoint( sal_Int32 nIndex
)
110 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
111 virtual void SAL_CALL
resetAllDataPoints()
112 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
114 // ____ XDataSink ____
115 /// @see ::com::sun::star::chart2::data::XDataSink
116 virtual void SAL_CALL
setData( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XLabeledDataSequence
> >& aData
)
117 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
119 // ____ XDataSource ____
120 /// @see ::com::sun::star::chart2::data::XDataSource
121 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XLabeledDataSequence
> > SAL_CALL
getDataSequences()
122 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 // ____ OPropertySet ____
125 virtual ::com::sun::star::uno::Any
GetDefaultValue( sal_Int32 nHandle
) const
126 throw (css::beans::UnknownPropertyException
,
127 css::uno::RuntimeException
) SAL_OVERRIDE
;
128 virtual void SAL_CALL
getFastPropertyValue( ::com::sun::star::uno::Any
& rValue
, sal_Int32 nHandle
) const SAL_OVERRIDE
;
129 virtual void SAL_CALL setFastPropertyValue_NoBroadcast
131 const ::com::sun::star::uno::Any
& rValue
)
132 throw (::com::sun::star::uno::Exception
, std::exception
) SAL_OVERRIDE
;
134 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() SAL_OVERRIDE
;
136 // ____ XPropertySet ____
137 /// @see ::com::sun::star::beans::XPropertySet
138 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
140 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
142 /// make original interface function visible again
143 using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue
;
145 // ____ XRegressionCurveContainer ____
146 /// @see ::com::sun::star::chart2::XRegressionCurveContainer
147 virtual void SAL_CALL
addRegressionCurve(
148 const ::com::sun::star::uno::Reference
<
149 ::com::sun::star::chart2::XRegressionCurve
>& aRegressionCurve
)
150 throw (::com::sun::star::lang::IllegalArgumentException
,
151 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
152 virtual void SAL_CALL
removeRegressionCurve(
153 const ::com::sun::star::uno::Reference
<
154 ::com::sun::star::chart2::XRegressionCurve
>& aRegressionCurve
)
155 throw (::com::sun::star::container::NoSuchElementException
,
156 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
157 virtual ::com::sun::star::uno::Sequence
<
158 ::com::sun::star::uno::Reference
<
159 ::com::sun::star::chart2::XRegressionCurve
> > SAL_CALL
getRegressionCurves()
160 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
161 virtual void SAL_CALL
setRegressionCurves(
162 const ::com::sun::star::uno::Sequence
<
163 ::com::sun::star::uno::Reference
<
164 ::com::sun::star::chart2::XRegressionCurve
> >& aRegressionCurves
)
165 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
167 // ____ XCloneable ____
168 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
169 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
171 // ____ XModifyBroadcaster ____
172 virtual void SAL_CALL
addModifyListener(
173 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
174 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
175 virtual void SAL_CALL
removeModifyListener(
176 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
177 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
179 // ____ XModifyListener ____
180 virtual void SAL_CALL
modified(
181 const ::com::sun::star::lang::EventObject
& aEvent
)
182 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
184 // ____ XEventListener (base of XModifyListener) ____
185 virtual void SAL_CALL
disposing(
186 const ::com::sun::star::lang::EventObject
& Source
)
187 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
189 // ____ OPropertySet ____
190 virtual void firePropertyChangeEvent() SAL_OVERRIDE
;
191 using OPropertySet::disposing
;
193 void fireModifyEvent();
196 ::com::sun::star::uno::Reference
<
197 ::com::sun::star::uno::XComponentContext
>
199 typedef ::std::vector
< ::com::sun::star::uno::Reference
<
200 ::com::sun::star::chart2::data::XLabeledDataSequence
> > tDataSequenceContainer
;
201 tDataSequenceContainer m_aDataSequences
;
203 typedef ::std::map
< sal_Int32
,
204 ::com::sun::star::uno::Reference
<
205 ::com::sun::star::beans::XPropertySet
> > tDataPointAttributeContainer
;
206 tDataPointAttributeContainer m_aAttributedDataPoints
;
209 ::std::vector
< ::com::sun::star::uno::Reference
<
210 ::com::sun::star::chart2::XRegressionCurve
> >
211 tRegressionCurveContainerType
;
212 tRegressionCurveContainerType m_aRegressionCurves
;
214 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
> m_xModifyEventForwarder
;
219 // INCLUDED_CHART2_SOURCE_MODEL_INC_DATASERIES_HXX
222 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */