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 : #ifndef INCLUDED_SW_INC_UNOCHART_HXX
20 : #define INCLUDED_SW_INC_UNOCHART_HXX
21 :
22 : #include <map>
23 : #include <set>
24 :
25 : #include <com/sun/star/lang/XUnoTunnel.hpp>
26 : #include <com/sun/star/chart2/data/XDataProvider.hpp>
27 : #include <com/sun/star/chart2/data/XDataSource.hpp>
28 : #include <com/sun/star/chart2/data/XDataSequence.hpp>
29 : #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
30 : #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
31 : #include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp>
32 : #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
33 : #include <com/sun/star/chart2/data/DataSequenceRole.hpp>
34 : #include <com/sun/star/lang/XServiceInfo.hpp>
35 : #include <com/sun/star/beans/XPropertySet.hpp>
36 : #include <com/sun/star/util/XCloneable.hpp>
37 : #include <com/sun/star/lang/XComponent.hpp>
38 : #include <com/sun/star/lang/XEventListener.hpp>
39 : #include <com/sun/star/util/XModifiable.hpp>
40 : #include <com/sun/star/util/XModifyBroadcaster.hpp>
41 : #include <com/sun/star/util/XModifyListener.hpp>
42 : #include <com/sun/star/chart/ChartDataRowSource.hpp>
43 :
44 : #include <cppuhelper/interfacecontainer.h>
45 : #include <cppuhelper/implbase2.hxx>
46 : #include <cppuhelper/implbase4.hxx>
47 : #include <cppuhelper/implbase6.hxx>
48 : #include <cppuhelper/implbase10.hxx>
49 : #include <cppuhelper/weakref.hxx>
50 :
51 : #include <tools/link.hxx>
52 : #include <vcl/timer.hxx>
53 :
54 : #include <calbck.hxx>
55 :
56 : class SfxItemPropertySet;
57 : class SwDoc;
58 : class SwTable;
59 : class SwTableBox;
60 : class SwUnoCrsr;
61 : struct SwRangeDescriptor;
62 : class SwSelBoxes;
63 : class SwFrmFmt;
64 :
65 : bool FillRangeDescriptor( SwRangeDescriptor &rDesc, const OUString &rCellRangeName );
66 :
67 : class SwChartHelper
68 : {
69 : public:
70 : static void DoUpdateAllCharts( SwDoc* pDoc );
71 : };
72 :
73 : class SwChartLockController_Helper
74 : {
75 : SwDoc *pDoc;
76 :
77 : DECL_LINK( DoUnlockAllCharts, Timer * );
78 : Timer aUnlockTimer; // timer to unlock chart controllers
79 : bool bIsLocked;
80 :
81 : // disallow use of d-tor, copy c-tor and assignment operator
82 : SwChartLockController_Helper( const SwChartLockController_Helper & );
83 : SwChartLockController_Helper & operator = ( const SwChartLockController_Helper & );
84 :
85 : void LockUnlockAllCharts( sal_Bool bLock );
86 0 : void LockAllCharts() { LockUnlockAllCharts( sal_True ); };
87 0 : void UnlockAllCharts() { LockUnlockAllCharts( sal_False ); };
88 :
89 : public:
90 : SwChartLockController_Helper( SwDoc *pDocument );
91 : ~SwChartLockController_Helper();
92 :
93 : void StartOrContinueLocking();
94 : void Disconnect();
95 : };
96 :
97 : typedef cppu::WeakImplHelper4
98 : <
99 : ::com::sun::star::chart2::data::XDataProvider,
100 : ::com::sun::star::chart2::data::XRangeXMLConversion,
101 : ::com::sun::star::lang::XComponent,
102 : ::com::sun::star::lang::XServiceInfo
103 : >
104 : SwChartDataProviderBaseClass;
105 :
106 : class SwChartDataProvider :
107 : public SwChartDataProviderBaseClass,
108 : public SwClient
109 : {
110 :
111 : // used to keep weak-references to all data-sequences of a single table
112 : // see set definition below...
113 : struct lt_DataSequenceRef
114 : {
115 0 : bool operator()( ::com::sun::star::uno::WeakReference< ::com::sun::star::chart2::data::XDataSequence > xWRef1, ::com::sun::star::uno::WeakReference< ::com::sun::star::chart2::data::XDataSequence > xWRef2 ) const
116 : {
117 0 : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > xRef1( xWRef1 );
118 0 : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > xRef2( xWRef2 );
119 0 : return xRef1.get() < xRef2.get();
120 : }
121 : };
122 : typedef std::set< ::com::sun::star::uno::WeakReference < ::com::sun::star::chart2::data::XDataSequence >, lt_DataSequenceRef > Set_DataSequenceRef_t;
123 :
124 : // map of data-sequence sets for each table
125 : struct lt_SwTable_Ptr
126 : {
127 0 : bool operator()( const SwTable *p1, const SwTable *p2 ) const
128 : {
129 0 : return p1 < p2;
130 : }
131 : };
132 : typedef std::map< const SwTable *, Set_DataSequenceRef_t, lt_SwTable_Ptr > Map_Set_DataSequenceRef_t;
133 :
134 : // map of all data-sequences provided directly or indirectly (e.g. via
135 : // data-source) by this object. Since there is only one object of this type
136 : // for each document it should hold references to all used data-sequences for
137 : // all tables of the document.
138 : mutable Map_Set_DataSequenceRef_t aDataSequences;
139 :
140 : ::cppu::OInterfaceContainerHelper aEvtListeners;
141 : const SwDoc * pDoc;
142 : sal_Bool bDisposed;
143 :
144 : // disallow use of c-tor and assignment operator
145 : SwChartDataProvider( const SwChartDataProvider & );
146 : SwChartDataProvider & operator = ( const SwChartDataProvider & );
147 :
148 : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource > SAL_CALL Impl_createDataSource( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments, sal_Bool bTestOnly = sal_False )
149 : throw (::com::sun::star::lang::IllegalArgumentException,
150 : ::com::sun::star::uno::RuntimeException,
151 : std::exception);
152 : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > SAL_CALL Impl_createDataSequenceByRangeRepresentation( const OUString& aRangeRepresentation, sal_Bool bTestOnly = sal_False )
153 : throw (::com::sun::star::lang::IllegalArgumentException,
154 : ::com::sun::star::uno::RuntimeException,
155 : std::exception);
156 :
157 : OUString GetBrokenCellRangeForExport( const OUString &rCellRangeRepresentation );
158 :
159 : protected:
160 : //SwClient
161 : virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
162 :
163 : public:
164 : SwChartDataProvider( const SwDoc* pDoc );
165 : virtual ~SwChartDataProvider();
166 :
167 : // XDataProvider
168 : virtual sal_Bool SAL_CALL createDataSourcePossible( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
169 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource > SAL_CALL createDataSource( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
170 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL detectArguments( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xDataSource ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
171 : virtual sal_Bool SAL_CALL createDataSequenceByRangeRepresentationPossible( const OUString& aRangeRepresentation ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
172 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > SAL_CALL createDataSequenceByRangeRepresentation( const OUString& aRangeRepresentation ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
173 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XRangeSelection > SAL_CALL getRangeSelection( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
174 :
175 : // XRangeXMLConversion
176 : virtual OUString SAL_CALL convertRangeToXML( const OUString& aRangeRepresentation )
177 : throw (::com::sun::star::lang::IllegalArgumentException,
178 : ::com::sun::star::uno::RuntimeException,
179 : std::exception) SAL_OVERRIDE;
180 : virtual OUString SAL_CALL convertRangeFromXML( const OUString& aXMLRange ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
181 :
182 : // XComponent
183 : virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
184 : virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
185 : virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
186 :
187 : // XServiceInfo
188 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
189 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
190 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
191 :
192 : SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
193 :
194 : void AddDataSequence( const SwTable &rTable, ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > &rxDataSequence );
195 : void RemoveDataSequence( const SwTable &rTable, ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > &rxDataSequence );
196 :
197 : // will send modifdied events for all data-sequences of the table
198 : void InvalidateTable( const SwTable *pTable );
199 : sal_Bool DeleteBox( const SwTable *pTable, const SwTableBox &rBox );
200 : void DisposeAllDataSequences( const SwTable *pTable );
201 :
202 : // functionality needed to get notified about new added rows/cols
203 : void AddRowCols( const SwTable &rTable, const SwSelBoxes& rBoxes, sal_uInt16 nLines, sal_Bool bBehind );
204 : };
205 :
206 : typedef cppu::WeakImplHelper2
207 : <
208 : ::com::sun::star::chart2::data::XDataSource,
209 : ::com::sun::star::lang::XServiceInfo
210 : >
211 : SwChartDataSourceBaseClass;
212 :
213 : class SwChartDataSource :
214 : public SwChartDataSourceBaseClass
215 : {
216 : com::sun::star::uno::Sequence<
217 : com::sun::star::uno::Reference<
218 : com::sun::star::chart2::data::XLabeledDataSequence > > aLDS;
219 :
220 : // disallow use of c-tor and assignment operator
221 : SwChartDataSource( const SwChartDataSource & );
222 : SwChartDataSource & operator = ( const SwChartDataSource & );
223 :
224 : public:
225 : SwChartDataSource( const com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::chart2::data::XLabeledDataSequence > > &rLDS );
226 : virtual ~SwChartDataSource();
227 :
228 : // XDataSource
229 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
230 :
231 : // XServiceInfo
232 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
233 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
234 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
235 : };
236 :
237 : typedef cppu::WeakImplHelper10
238 : <
239 : ::com::sun::star::chart2::data::XDataSequence,
240 : ::com::sun::star::chart2::data::XTextualDataSequence,
241 : ::com::sun::star::chart2::data::XNumericalDataSequence,
242 : ::com::sun::star::util::XCloneable,
243 : ::com::sun::star::beans::XPropertySet,
244 : ::com::sun::star::lang::XServiceInfo,
245 : ::com::sun::star::lang::XUnoTunnel,
246 : ::com::sun::star::util::XModifiable,
247 : ::com::sun::star::lang::XEventListener,
248 : ::com::sun::star::lang::XComponent
249 : >
250 : SwChartDataSequenceBaseClass;
251 :
252 : class SwChartDataSequence :
253 : public SwChartDataSequenceBaseClass,
254 : public SwClient
255 : {
256 : ::cppu::OInterfaceContainerHelper aEvtListeners;
257 : ::cppu::OInterfaceContainerHelper aModifyListeners;
258 : ::com::sun::star::chart2::data::DataSequenceRole aRole;
259 :
260 : OUString aRowLabelText;
261 : OUString aColLabelText;
262 :
263 : // holds a reference to the data-provider to guarantee its lifetime last as
264 : // long as the pointer may be used.
265 : ::com::sun::star::uno::Reference< com::sun::star::chart2::data::XDataProvider > xDataProvider;
266 : SwChartDataProvider * pDataProvider;
267 :
268 : SwUnoCrsr* pTblCrsr; // cursor spanned over cells to use
269 : SwDepend aCursorDepend; //the cursor is removed after the doc has been removed
270 :
271 : const SfxItemPropertySet* _pPropSet;
272 :
273 : sal_Bool bDisposed;
274 :
275 : // disallow use of c-tor and assignment operator
276 : SwChartDataSequence( const SwChartDataSequence &rObj );
277 : SwChartDataSequence & operator = ( const SwChartDataSequence & );
278 :
279 : protected:
280 : //SwClient
281 : virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
282 :
283 : public:
284 : SwChartDataSequence( SwChartDataProvider &rProvider,
285 : SwFrmFmt &rTblFmt,
286 : SwUnoCrsr *pTableCursor );
287 : virtual ~SwChartDataSequence();
288 :
289 : static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
290 :
291 : //XUnoTunnel
292 : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
293 :
294 : // XDataSequence
295 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getData()
296 : throw (::com::sun::star::uno::RuntimeException,
297 : std::exception) SAL_OVERRIDE;
298 : virtual OUString SAL_CALL getSourceRangeRepresentation()
299 : throw (::com::sun::star::uno::RuntimeException,
300 : std::exception) SAL_OVERRIDE;
301 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL generateLabel( ::com::sun::star::chart2::data::LabelOrigin eLabelOrigin )
302 : throw (::com::sun::star::uno::RuntimeException,
303 : std::exception) SAL_OVERRIDE;
304 : virtual ::sal_Int32 SAL_CALL getNumberFormatKeyByIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
305 :
306 : // XTextualDataSequence
307 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getTextualData()
308 : throw (::com::sun::star::uno::RuntimeException,
309 : std::exception) SAL_OVERRIDE;
310 :
311 : // XNumericalDataSequence
312 : virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getNumericalData()
313 : throw (::com::sun::star::uno::RuntimeException,
314 : std::exception) SAL_OVERRIDE;
315 :
316 : // XCloneable
317 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
318 :
319 : // XPropertySet
320 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
321 : virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
322 : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
323 : virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
324 : virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
325 : virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
326 : virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
327 :
328 : // XServiceInfo
329 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
330 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
331 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
332 :
333 : // XModifiable
334 : virtual sal_Bool SAL_CALL isModified( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
335 : virtual void SAL_CALL setModified( sal_Bool bModified ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
336 :
337 : // XModifyBroadcaster
338 : virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
339 : virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
340 :
341 : // XEventListener
342 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
343 :
344 : // XComponent
345 : virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
346 : virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
347 : virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
348 :
349 0 : SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
350 : sal_Bool DeleteBox( const SwTableBox &rBox );
351 :
352 : void FillRangeDesc( SwRangeDescriptor &rRangeDesc ) const;
353 : bool ExtendTo( bool bExtendCol, sal_Int32 nFirstNew, sal_Int32 nCount );
354 : };
355 :
356 : typedef cppu::WeakImplHelper4
357 : <
358 : ::com::sun::star::chart2::data::XLabeledDataSequence2,
359 : ::com::sun::star::lang::XServiceInfo,
360 : ::com::sun::star::util::XModifyListener,
361 : ::com::sun::star::lang::XComponent
362 : >
363 : SwChartLabeledDataSequenceBaseClass;
364 :
365 : class SwChartLabeledDataSequence :
366 : public SwChartLabeledDataSequenceBaseClass
367 : {
368 : ::cppu::OInterfaceContainerHelper aEvtListeners;
369 : ::cppu::OInterfaceContainerHelper aModifyListeners;
370 :
371 : ::com::sun::star::uno::Reference<
372 : ::com::sun::star::chart2::data::XDataSequence > xData;
373 : ::com::sun::star::uno::Reference<
374 : ::com::sun::star::chart2::data::XDataSequence > xLabels;
375 :
376 : sal_Bool bDisposed;
377 :
378 : // disallow use of c-tor and assignment operator
379 : SwChartLabeledDataSequence( const SwChartLabeledDataSequence & );
380 : SwChartLabeledDataSequence & operator = ( const SwChartLabeledDataSequence & );
381 :
382 : void SetDataSequence( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& rxDest, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& rxSource );
383 :
384 : public:
385 : SwChartLabeledDataSequence();
386 : virtual ~SwChartLabeledDataSequence();
387 :
388 : // XLabeledDataSequence
389 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > SAL_CALL getValues( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
390 : virtual void SAL_CALL setValues( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xSequence ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
391 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > SAL_CALL getLabel( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
392 : virtual void SAL_CALL setLabel( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xSequence ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
393 :
394 : // XCloneable
395 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
396 :
397 : // XServiceInfo
398 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
399 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
400 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
401 :
402 : // XEventListener
403 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
404 :
405 : // XModifyListener
406 : virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
407 :
408 : // XModifyBroadcaster
409 : virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
410 : virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
411 :
412 : // XComponent
413 : virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
414 : virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
415 : virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
416 : };
417 :
418 : #endif
419 :
420 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|