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( bool bLock );
86 0 : void LockAllCharts() { LockUnlockAllCharts( true ); };
87 5041 : void UnlockAllCharts() { LockUnlockAllCharts( 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 : 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, bool bTestOnly = 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, bool bTestOnly = 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 : virtual css::uno::Reference<css::chart2::data::XDataSequence>
176 : SAL_CALL createDataSequenceByValueArray(
177 : const OUString& aRole, const OUString& aRangeRepresentation )
178 : throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
179 :
180 : // XRangeXMLConversion
181 : virtual OUString SAL_CALL convertRangeToXML( const OUString& aRangeRepresentation )
182 : throw (::com::sun::star::lang::IllegalArgumentException,
183 : ::com::sun::star::uno::RuntimeException,
184 : std::exception) SAL_OVERRIDE;
185 : virtual OUString SAL_CALL convertRangeFromXML( const OUString& aXMLRange ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
186 :
187 : // XComponent
188 : virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
189 : 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;
190 : 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;
191 :
192 : // XServiceInfo
193 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
194 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
195 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
196 :
197 : SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
198 :
199 : void AddDataSequence( const SwTable &rTable, ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > &rxDataSequence );
200 : void RemoveDataSequence( const SwTable &rTable, ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > &rxDataSequence );
201 :
202 : // will send modifdied events for all data-sequences of the table
203 : void InvalidateTable( const SwTable *pTable );
204 : bool DeleteBox( const SwTable *pTable, const SwTableBox &rBox );
205 : void DisposeAllDataSequences( const SwTable *pTable );
206 :
207 : // functionality needed to get notified about new added rows/cols
208 : void AddRowCols( const SwTable &rTable, const SwSelBoxes& rBoxes, sal_uInt16 nLines, bool bBehind );
209 : };
210 :
211 : typedef cppu::WeakImplHelper2
212 : <
213 : ::com::sun::star::chart2::data::XDataSource,
214 : ::com::sun::star::lang::XServiceInfo
215 : >
216 : SwChartDataSourceBaseClass;
217 :
218 : class SwChartDataSource :
219 : public SwChartDataSourceBaseClass
220 : {
221 : com::sun::star::uno::Sequence<
222 : com::sun::star::uno::Reference<
223 : com::sun::star::chart2::data::XLabeledDataSequence > > aLDS;
224 :
225 : // disallow use of c-tor and assignment operator
226 : SwChartDataSource( const SwChartDataSource & );
227 : SwChartDataSource & operator = ( const SwChartDataSource & );
228 :
229 : public:
230 : SwChartDataSource( const com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::chart2::data::XLabeledDataSequence > > &rLDS );
231 : virtual ~SwChartDataSource();
232 :
233 : // XDataSource
234 : 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;
235 :
236 : // XServiceInfo
237 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
238 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
239 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
240 : };
241 :
242 : typedef cppu::WeakImplHelper10
243 : <
244 : ::com::sun::star::chart2::data::XDataSequence,
245 : ::com::sun::star::chart2::data::XTextualDataSequence,
246 : ::com::sun::star::chart2::data::XNumericalDataSequence,
247 : ::com::sun::star::util::XCloneable,
248 : ::com::sun::star::beans::XPropertySet,
249 : ::com::sun::star::lang::XServiceInfo,
250 : ::com::sun::star::lang::XUnoTunnel,
251 : ::com::sun::star::util::XModifiable,
252 : ::com::sun::star::lang::XEventListener,
253 : ::com::sun::star::lang::XComponent
254 : >
255 : SwChartDataSequenceBaseClass;
256 :
257 : class SwChartDataSequence :
258 : public SwChartDataSequenceBaseClass,
259 : public SwClient
260 : {
261 : ::cppu::OInterfaceContainerHelper aEvtListeners;
262 : ::cppu::OInterfaceContainerHelper aModifyListeners;
263 : ::com::sun::star::chart2::data::DataSequenceRole aRole;
264 :
265 : OUString aRowLabelText;
266 : OUString aColLabelText;
267 :
268 : // holds a reference to the data-provider to guarantee its lifetime last as
269 : // long as the pointer may be used.
270 : ::com::sun::star::uno::Reference< com::sun::star::chart2::data::XDataProvider > xDataProvider;
271 : SwChartDataProvider * pDataProvider;
272 :
273 : SwUnoCrsr* pTblCrsr; // cursor spanned over cells to use
274 : SwDepend aCursorDepend; //the cursor is removed after the doc has been removed
275 :
276 : const SfxItemPropertySet* _pPropSet;
277 :
278 : bool bDisposed;
279 :
280 : // disallow use of c-tor and assignment operator
281 : SwChartDataSequence( const SwChartDataSequence &rObj );
282 : SwChartDataSequence & operator = ( const SwChartDataSequence & );
283 :
284 : protected:
285 : //SwClient
286 : virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
287 :
288 : public:
289 : SwChartDataSequence( SwChartDataProvider &rProvider,
290 : SwFrmFmt &rTblFmt,
291 : SwUnoCrsr *pTableCursor );
292 : virtual ~SwChartDataSequence();
293 :
294 : static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
295 :
296 : //XUnoTunnel
297 : 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;
298 :
299 : // XDataSequence
300 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getData()
301 : throw (::com::sun::star::uno::RuntimeException,
302 : std::exception) SAL_OVERRIDE;
303 : virtual OUString SAL_CALL getSourceRangeRepresentation()
304 : throw (::com::sun::star::uno::RuntimeException,
305 : std::exception) SAL_OVERRIDE;
306 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL generateLabel( ::com::sun::star::chart2::data::LabelOrigin eLabelOrigin )
307 : throw (::com::sun::star::uno::RuntimeException,
308 : std::exception) SAL_OVERRIDE;
309 : virtual ::sal_Int32 SAL_CALL getNumberFormatKeyByIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
310 :
311 : // XTextualDataSequence
312 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getTextualData()
313 : throw (::com::sun::star::uno::RuntimeException,
314 : std::exception) SAL_OVERRIDE;
315 :
316 : // XNumericalDataSequence
317 : virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getNumericalData()
318 : throw (::com::sun::star::uno::RuntimeException,
319 : std::exception) SAL_OVERRIDE;
320 :
321 : // XCloneable
322 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
323 :
324 : // XPropertySet
325 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
326 : 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;
327 : 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;
328 : 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;
329 : 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;
330 : 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;
331 : 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;
332 :
333 : // XServiceInfo
334 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
335 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
336 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
337 :
338 : // XModifiable
339 : virtual sal_Bool SAL_CALL isModified( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
340 : virtual void SAL_CALL setModified( sal_Bool bModified ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
341 :
342 : // XModifyBroadcaster
343 : 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;
344 : 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;
345 :
346 : // XEventListener
347 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
348 :
349 : // XComponent
350 : virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
351 : 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;
352 : 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;
353 :
354 0 : SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
355 : bool DeleteBox( const SwTableBox &rBox );
356 :
357 : void FillRangeDesc( SwRangeDescriptor &rRangeDesc ) const;
358 : bool ExtendTo( bool bExtendCol, sal_Int32 nFirstNew, sal_Int32 nCount );
359 : };
360 :
361 : typedef cppu::WeakImplHelper4
362 : <
363 : ::com::sun::star::chart2::data::XLabeledDataSequence2,
364 : ::com::sun::star::lang::XServiceInfo,
365 : ::com::sun::star::util::XModifyListener,
366 : ::com::sun::star::lang::XComponent
367 : >
368 : SwChartLabeledDataSequenceBaseClass;
369 :
370 : class SwChartLabeledDataSequence :
371 : public SwChartLabeledDataSequenceBaseClass
372 : {
373 : ::cppu::OInterfaceContainerHelper aEvtListeners;
374 : ::cppu::OInterfaceContainerHelper aModifyListeners;
375 :
376 : ::com::sun::star::uno::Reference<
377 : ::com::sun::star::chart2::data::XDataSequence > xData;
378 : ::com::sun::star::uno::Reference<
379 : ::com::sun::star::chart2::data::XDataSequence > xLabels;
380 :
381 : bool bDisposed;
382 :
383 : // disallow use of c-tor and assignment operator
384 : SwChartLabeledDataSequence( const SwChartLabeledDataSequence & );
385 : SwChartLabeledDataSequence & operator = ( const SwChartLabeledDataSequence & );
386 :
387 : 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 );
388 :
389 : public:
390 : SwChartLabeledDataSequence();
391 : virtual ~SwChartLabeledDataSequence();
392 :
393 : // XLabeledDataSequence
394 : 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;
395 : 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;
396 : 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;
397 : 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;
398 :
399 : // XCloneable
400 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
401 :
402 : // XServiceInfo
403 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
404 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
405 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
406 :
407 : // XEventListener
408 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
409 :
410 : // XModifyListener
411 : virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
412 :
413 : // XModifyBroadcaster
414 : 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;
415 : 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;
416 :
417 : // XComponent
418 : virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
419 : 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;
420 : 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;
421 : };
422 :
423 : #endif
424 :
425 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|