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: chart2uno.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 ************************************************************************/
31 #ifndef SC_CHART2UNO_HXX
32 #define SC_CHART2UNO_HXX
34 #include "cellsuno.hxx" // for XModifyListenerArr_Impl / ScLinkListener
35 #include "rangelst.hxx"
36 #include "externalrefmgr.hxx"
38 #include "chartlis.hxx"
40 #include <svtools/lstner.hxx>
41 #include <com/sun/star/chart/ChartDataRowSource.hpp>
42 #include <com/sun/star/chart2/data/XDataProvider.hpp>
43 #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
44 #include <com/sun/star/chart2/data/XDataSource.hpp>
45 #include <com/sun/star/chart2/data/XDataSequence.hpp>
46 #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
47 #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
48 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
49 #include <com/sun/star/chart2/data/DataSequenceRole.hpp>
50 #include <com/sun/star/lang/XServiceInfo.hpp>
51 #include <com/sun/star/beans/XPropertySet.hpp>
52 #include <com/sun/star/util/XCloneable.hpp>
53 #include <com/sun/star/util/XModifyBroadcaster.hpp>
54 // #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
55 // #include <com/sun/star/lang/XUnoTunnel.hpp>
57 #include <cppuhelper/implbase2.hxx>
58 #include <cppuhelper/implbase4.hxx>
59 #include <cppuhelper/implbase6.hxx>
60 #include <cppuhelper/implbase7.hxx>
61 #include <rtl/ustring.hxx>
62 #include <svtools/itemprop.hxx>
68 #include <boost/shared_ptr.hpp>
70 #define USE_CHART2_EMPTYDATASEQUENCE 0
74 // DataProvider ==============================================================
76 class ScChart2DataProvider
: public
77 ::cppu::WeakImplHelper4
<
78 ::com::sun::star::chart2::data::XDataProvider
,
79 ::com::sun::star::chart2::data::XRangeXMLConversion
,
80 ::com::sun::star::beans::XPropertySet
,
81 ::com::sun::star::lang::XServiceInfo
>,
86 explicit ScChart2DataProvider( ScDocument
* pDoc
);
87 virtual ~ScChart2DataProvider();
88 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
90 // XDataProvider ---------------------------------------------------------
92 virtual ::sal_Bool SAL_CALL
createDataSourcePossible(
93 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aArguments
)
94 throw (::com::sun::star::uno::RuntimeException
);
96 virtual ::com::sun::star::uno::Reference
<
97 ::com::sun::star::chart2::data::XDataSource
> SAL_CALL
createDataSource(
98 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aArguments
)
99 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
101 virtual ::com::sun::star::uno::Sequence
<
102 ::com::sun::star::beans::PropertyValue
> SAL_CALL
detectArguments(
103 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSource
>& xDataSource
)
104 throw (::com::sun::star::uno::RuntimeException
);
106 virtual ::sal_Bool SAL_CALL
createDataSequenceByRangeRepresentationPossible(
107 const ::rtl::OUString
& aRangeRepresentation
)
108 throw (::com::sun::star::uno::RuntimeException
);
110 virtual ::com::sun::star::uno::Reference
<
111 ::com::sun::star::chart2::data::XDataSequence
> SAL_CALL
createDataSequenceByRangeRepresentation(
112 const ::rtl::OUString
& aRangeRepresentation
)
113 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
115 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sheet::XRangeSelection
> SAL_CALL
getRangeSelection()
116 throw (::com::sun::star::uno::RuntimeException
);
118 /* virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > SAL_CALL getNumberFormatsSupplier()
119 throw (::com::sun::star::uno::RuntimeException);*/
121 // XRangeXMLConversion ---------------------------------------------------
123 virtual ::rtl::OUString SAL_CALL
convertRangeToXML( const ::rtl::OUString
& sRangeRepresentation
)
124 throw ( ::com::sun::star::uno::RuntimeException
, ::com::sun::star::lang::IllegalArgumentException
);
126 virtual ::rtl::OUString SAL_CALL
convertRangeFromXML( const ::rtl::OUString
& sXMLRange
)
127 throw ( ::com::sun::star::uno::RuntimeException
, ::com::sun::star::lang::IllegalArgumentException
);
129 // XPropertySet ----------------------------------------------------------
131 virtual ::com::sun::star::uno::Reference
<
132 ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
133 getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException
);
135 virtual void SAL_CALL
setPropertyValue(
136 const ::rtl::OUString
& rPropertyName
,
137 const ::com::sun::star::uno::Any
& rValue
)
138 throw( ::com::sun::star::beans::UnknownPropertyException
,
139 ::com::sun::star::beans::PropertyVetoException
,
140 ::com::sun::star::lang::IllegalArgumentException
,
141 ::com::sun::star::lang::WrappedTargetException
,
142 ::com::sun::star::uno::RuntimeException
);
144 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue(
145 const ::rtl::OUString
& rPropertyName
)
146 throw( ::com::sun::star::beans::UnknownPropertyException
,
147 ::com::sun::star::lang::WrappedTargetException
,
148 ::com::sun::star::uno::RuntimeException
);
150 virtual void SAL_CALL
addPropertyChangeListener(
151 const ::rtl::OUString
& rPropertyName
,
152 const ::com::sun::star::uno::Reference
<
153 ::com::sun::star::beans::XPropertyChangeListener
>& xListener
)
154 throw( ::com::sun::star::beans::UnknownPropertyException
,
155 ::com::sun::star::lang::WrappedTargetException
,
156 ::com::sun::star::uno::RuntimeException
);
158 virtual void SAL_CALL
removePropertyChangeListener(
159 const ::rtl::OUString
& rPropertyName
,
160 const ::com::sun::star::uno::Reference
<
161 ::com::sun::star::beans::XPropertyChangeListener
>& rListener
)
162 throw( ::com::sun::star::beans::UnknownPropertyException
,
163 ::com::sun::star::lang::WrappedTargetException
,
164 ::com::sun::star::uno::RuntimeException
);
166 virtual void SAL_CALL
addVetoableChangeListener(
167 const ::rtl::OUString
& rPropertyName
,
168 const ::com::sun::star::uno::Reference
<
169 ::com::sun::star::beans::XVetoableChangeListener
>& rListener
)
170 throw( ::com::sun::star::beans::UnknownPropertyException
,
171 ::com::sun::star::lang::WrappedTargetException
,
172 ::com::sun::star::uno::RuntimeException
);
174 virtual void SAL_CALL
removeVetoableChangeListener(
175 const ::rtl::OUString
& rPropertyName
,
176 const ::com::sun::star::uno::Reference
<
177 ::com::sun::star::beans::XVetoableChangeListener
>& rListener
)
178 throw( ::com::sun::star::beans::UnknownPropertyException
,
179 ::com::sun::star::lang::WrappedTargetException
,
180 ::com::sun::star::uno::RuntimeException
);
182 // XServiceInfo ----------------------------------------------------------
184 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(
185 ::com::sun::star::uno::RuntimeException
);
187 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
&
188 rServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
190 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
191 getSupportedServiceNames() throw(
192 ::com::sun::star::uno::RuntimeException
);
195 * Check the current list of reference tokens, and add the upper left
196 * corner of the minimum range that encloses all ranges if certain
197 * conditions are met.
199 * @param rRefTokens list of reference tokens
201 * @return true if the corner was added, false otherwise.
203 static bool addUpperLeftCornerIfMissing(::std::vector
<ScSharedTokenRef
>& rRefTokens
);
207 void detectRangesFromDataSource(::std::vector
<ScSharedTokenRef
>& rRefTokens
,
208 ::com::sun::star::chart::ChartDataRowSource
& rRowSource
,
209 bool& rRowSourceDetected
,
210 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSource
>& xDataSource
);
214 ScDocument
* m_pDocument
;
215 SfxItemPropertySet m_aPropSet
;
216 sal_Bool m_bIncludeHiddenCells
;
220 // DataSource ================================================================
222 class ScChart2DataSource
: public
223 ::cppu::WeakImplHelper2
<
224 ::com::sun::star::chart2::data::XDataSource
,
225 ::com::sun::star::lang::XServiceInfo
>,
230 explicit ScChart2DataSource( ScDocument
* pDoc
);
231 virtual ~ScChart2DataSource();
232 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
234 // XDataSource -----------------------------------------------------------
236 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
<
237 ::com::sun::star::chart2::data::XLabeledDataSequence
> > SAL_CALL
238 getDataSequences() throw (::com::sun::star::uno::RuntimeException
);
240 // XServiceInfo ----------------------------------------------------------
242 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(
243 ::com::sun::star::uno::RuntimeException
);
245 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
&
246 rServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
248 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
249 getSupportedServiceNames() throw(
250 ::com::sun::star::uno::RuntimeException
);
254 void AddLabeledSequence(const com::sun::star::uno::Reference
< com::sun::star::chart2::data::XLabeledDataSequence
>& xNew
);
258 ScDocument
* m_pDocument
;
259 typedef std::list
< com::sun::star::uno::Reference
< com::sun::star::chart2::data::XLabeledDataSequence
> > LabeledList
;
260 LabeledList m_aLabeledSequences
;
265 // LabeledDataSequence =======================================================
267 class ScChart2LabeledDataSequence
: public
268 ::cppu::WeakImplHelper4
<
269 ::com::sun::star::chart2::data::XLabeledDataSequence
,
270 ::com::sun::star::util::XCloneable
,
271 ::com::sun::star::util::XModifyBroadcaster
,
272 ::com::sun::star::lang::XServiceInfo
>,
277 explicit ScChart2LabeledDataSequence( ScDocument
* pDoc
);
278 virtual ~ScChart2LabeledDataSequence();
280 // SfxListener -----------------------------------------------------------
282 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
284 // XLabeledDataSequence --------------------------------------------------
286 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
> SAL_CALL
getValues()
287 throw (::com::sun::star::uno::RuntimeException
);
288 virtual void SAL_CALL
setValues(
289 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
>& xSequence
)
290 throw (::com::sun::star::uno::RuntimeException
);
291 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
> SAL_CALL
getLabel()
292 throw (::com::sun::star::uno::RuntimeException
);
293 virtual void SAL_CALL
setLabel(
294 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
>& xSequence
)
295 throw (::com::sun::star::uno::RuntimeException
);
297 // XCloneable ------------------------------------------------------------
299 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
300 throw (::com::sun::star::uno::RuntimeException
);
302 // XModifyBroadcaster ----------------------------------------------------
304 virtual void SAL_CALL
addModifyListener(
305 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
306 throw (::com::sun::star::uno::RuntimeException
);
307 virtual void SAL_CALL
removeModifyListener(
308 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
309 throw (::com::sun::star::uno::RuntimeException
);
311 // XServiceInfo ----------------------------------------------------------
313 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(
314 ::com::sun::star::uno::RuntimeException
);
315 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
&
316 rServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
317 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
318 getSupportedServiceNames() throw(
319 ::com::sun::star::uno::RuntimeException
);
322 ::com::sun::star::uno::Reference
<
323 ::com::sun::star::chart2::data::XDataSequence
> m_aData
;
324 ::com::sun::star::uno::Reference
<
325 ::com::sun::star::chart2::data::XDataSequence
> m_aLabel
;
326 ScDocument
* m_pDocument
;
329 // DataSequence ==============================================================
331 class ScChart2DataSequence
: public
332 ::cppu::WeakImplHelper7
<
333 ::com::sun::star::chart2::data::XDataSequence
,
334 ::com::sun::star::chart2::data::XTextualDataSequence
,
335 ::com::sun::star::chart2::data::XNumericalDataSequence
,
336 ::com::sun::star::util::XCloneable
,
337 ::com::sun::star::util::XModifyBroadcaster
,
338 ::com::sun::star::beans::XPropertySet
,
339 // ::com::sun::star::lang::XUnoTunnel,
340 ::com::sun::star::lang::XServiceInfo
>,
344 explicit ScChart2DataSequence( ScDocument
* pDoc
,
345 const com::sun::star::uno::Reference
< com::sun::star::chart2::data::XDataProvider
>& xDP
,
346 ::std::vector
<ScSharedTokenRef
>* pTokens
, bool bIncludeHiddenCells
);
348 virtual ~ScChart2DataSequence();
349 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
351 // XDataSequence ---------------------------------------------------------
353 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>
354 SAL_CALL
getData() throw (::com::sun::star::uno::RuntimeException
);
355 virtual ::rtl::OUString SAL_CALL
getSourceRangeRepresentation()
356 throw (::com::sun::star::uno::RuntimeException
);
357 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
358 SAL_CALL
generateLabel(::com::sun::star::chart2::data::LabelOrigin nOrigin
)
359 throw (::com::sun::star::uno::RuntimeException
);
360 virtual ::sal_Int32 SAL_CALL
getNumberFormatKeyByIndex( ::sal_Int32 nIndex
)
361 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
362 ::com::sun::star::uno::RuntimeException
);
364 // XNumericalDataSequence --------------------------------------------------
366 virtual ::com::sun::star::uno::Sequence
< double >
367 SAL_CALL
getNumericalData( ) throw (::com::sun::star::uno::RuntimeException
);
369 // XTextualDataSequence --------------------------------------------------
371 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
372 SAL_CALL
getTextualData( ) throw (::com::sun::star::uno::RuntimeException
);
374 // XPropertySet ----------------------------------------------------------
376 virtual ::com::sun::star::uno::Reference
<
377 ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
378 getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException
);
380 virtual void SAL_CALL
setPropertyValue(
381 const ::rtl::OUString
& rPropertyName
,
382 const ::com::sun::star::uno::Any
& rValue
)
383 throw( ::com::sun::star::beans::UnknownPropertyException
,
384 ::com::sun::star::beans::PropertyVetoException
,
385 ::com::sun::star::lang::IllegalArgumentException
,
386 ::com::sun::star::lang::WrappedTargetException
,
387 ::com::sun::star::uno::RuntimeException
);
389 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue(
390 const ::rtl::OUString
& rPropertyName
)
391 throw( ::com::sun::star::beans::UnknownPropertyException
,
392 ::com::sun::star::lang::WrappedTargetException
,
393 ::com::sun::star::uno::RuntimeException
);
395 virtual void SAL_CALL
addPropertyChangeListener(
396 const ::rtl::OUString
& rPropertyName
,
397 const ::com::sun::star::uno::Reference
<
398 ::com::sun::star::beans::XPropertyChangeListener
>& xListener
)
399 throw( ::com::sun::star::beans::UnknownPropertyException
,
400 ::com::sun::star::lang::WrappedTargetException
,
401 ::com::sun::star::uno::RuntimeException
);
403 virtual void SAL_CALL
removePropertyChangeListener(
404 const ::rtl::OUString
& rPropertyName
,
405 const ::com::sun::star::uno::Reference
<
406 ::com::sun::star::beans::XPropertyChangeListener
>& rListener
)
407 throw( ::com::sun::star::beans::UnknownPropertyException
,
408 ::com::sun::star::lang::WrappedTargetException
,
409 ::com::sun::star::uno::RuntimeException
);
411 virtual void SAL_CALL
addVetoableChangeListener(
412 const ::rtl::OUString
& rPropertyName
,
413 const ::com::sun::star::uno::Reference
<
414 ::com::sun::star::beans::XVetoableChangeListener
>& rListener
)
415 throw( ::com::sun::star::beans::UnknownPropertyException
,
416 ::com::sun::star::lang::WrappedTargetException
,
417 ::com::sun::star::uno::RuntimeException
);
419 virtual void SAL_CALL
removeVetoableChangeListener(
420 const ::rtl::OUString
& rPropertyName
,
421 const ::com::sun::star::uno::Reference
<
422 ::com::sun::star::beans::XVetoableChangeListener
>& rListener
)
423 throw( ::com::sun::star::beans::UnknownPropertyException
,
424 ::com::sun::star::lang::WrappedTargetException
,
425 ::com::sun::star::uno::RuntimeException
);
427 // XCloneable ------------------------------------------------------------
429 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
430 throw (::com::sun::star::uno::RuntimeException
);
432 // XModifyBroadcaster ----------------------------------------------------
434 virtual void SAL_CALL
addModifyListener(
435 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
436 throw (::com::sun::star::uno::RuntimeException
);
437 virtual void SAL_CALL
removeModifyListener(
438 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
439 throw (::com::sun::star::uno::RuntimeException
);
441 // XServiceInfo ----------------------------------------------------------
443 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(
444 ::com::sun::star::uno::RuntimeException
);
446 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
&
447 rServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
449 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
450 getSupportedServiceNames() throw(
451 ::com::sun::star::uno::RuntimeException
);
453 // XUnoTunnel ------------------------------------------------------------
455 // virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
456 // sal_Int8 >& aIdentifier )
457 // throw(::com::sun::star::uno::RuntimeException);
459 // static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
460 // static ScChart2DataSequence* getImplementation( const com::sun::star::uno::Reference<
461 // com::sun::star::uno::XInterface> xObj );
464 void markRangeDirty(const ScRange
& rRange
) const;
465 void setDataChangedHint(bool b
);
467 // Implementation --------------------------------------------------------
470 DECL_LINK( ValueListenerHdl
, SfxHint
* );
473 ScChart2DataSequence(); // disabled
474 ScChart2DataSequence(const ScChart2DataSequence
& r
); // disabled
476 class ExternalRefListener
: public ScExternalRefManager::LinkListener
479 ExternalRefListener(ScChart2DataSequence
& rParent
, ScDocument
* pDoc
);
480 virtual ~ExternalRefListener();
481 virtual void notify(sal_uInt16 nFileId
, ScExternalRefManager::LinkUpdateType eType
);
482 void addFileId(sal_uInt16 nFileId
);
483 void removeFileId(sal_uInt16 nFileId
);
484 const ::std::hash_set
<sal_uInt16
>& getAllFileIds();
487 ExternalRefListener();
488 ExternalRefListener(const ExternalRefListener
& r
);
490 ScChart2DataSequence
& mrParent
;
491 ::std::hash_set
<sal_uInt16
> maFileIds
;
496 * Build an internal data array to cache the data ranges, and other
497 * information such as hidden values.
499 void BuildDataCache();
501 void RebuildDataCache();
503 sal_Int32
FillCacheFromExternalRef(const ScSharedTokenRef
& pToken
);
505 void UpdateTokensFromRanges(const ScRangeList
& rRanges
);
507 ExternalRefListener
* GetExtRefListener();
509 void StopListeningToAllExternalRefs();
511 void CopyData(const ScChart2DataSequence
& r
);
519 ::rtl::OUString maString
;
524 class HiddenRangeListener
: public ScChartHiddenRangeListener
527 HiddenRangeListener(ScChart2DataSequence
& rParent
);
528 virtual ~HiddenRangeListener();
530 virtual void notify();
533 ScChart2DataSequence
& mrParent
;
536 ::std::list
<Item
> m_aDataArray
;
537 ::com::sun::star::uno::Sequence
<sal_Int32
> m_aHiddenValues
;
540 ::com::sun::star::chart2::data::DataSequenceRole m_aRole
;
541 sal_Bool m_bIncludeHiddenCells
;
544 typedef ::std::auto_ptr
< ::std::vector
<ScSharedTokenRef
> > TokenListPtr
;
545 typedef ::std::auto_ptr
< ::std::vector
<sal_uInt32
> > RangeIndexMapPtr
;
546 typedef ::std::auto_ptr
<ExternalRefListener
> ExtRefListenerPtr
;
548 sal_Int64 m_nObjectId
;
549 ScDocument
* m_pDocument
;
550 TokenListPtr m_pTokens
;
551 RangeIndexMapPtr m_pRangeIndices
;
552 ExtRefListenerPtr m_pExtRefListener
;
553 com::sun::star::uno::Reference
< com::sun::star::chart2::data::XDataProvider
> m_xDataProvider
;
554 SfxItemPropertySet m_aPropSet
;
556 ::std::auto_ptr
<HiddenRangeListener
> m_pHiddenListener
;
557 ScLinkListener
* m_pValueListener
;
558 XModifyListenerArr_Impl m_aValueListeners
;
560 bool m_bGotDataChangedHint
;
561 bool m_bExtDataRebuildQueued
;
564 #if USE_CHART2_EMPTYDATASEQUENCE
565 // DataSequence ==============================================================
567 class ScChart2EmptyDataSequence
: public
568 ::cppu::WeakImplHelper6
<
569 ::com::sun::star::chart2::data::XDataSequence
,
570 ::com::sun::star::chart2::data::XTextualDataSequence
,
571 ::com::sun::star::util::XCloneable
,
572 ::com::sun::star::util::XModifyBroadcaster
,
573 ::com::sun::star::beans::XPropertySet
,
574 // ::com::sun::star::lang::XUnoTunnel,
575 ::com::sun::star::lang::XServiceInfo
>,
580 explicit ScChart2EmptyDataSequence( ScDocument
* pDoc
,
581 const com::sun::star::uno::Reference
< com::sun::star::chart2::data::XDataProvider
>& xDP
,
582 const ScRangeListRef
& rRangeList
, sal_Bool bColumn
);
583 virtual ~ScChart2EmptyDataSequence();
584 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
586 // XDataSequence ---------------------------------------------------------
588 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>
589 SAL_CALL
getData() throw (::com::sun::star::uno::RuntimeException
);
590 virtual ::rtl::OUString SAL_CALL
getSourceRangeRepresentation()
591 throw (::com::sun::star::uno::RuntimeException
);
592 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
593 SAL_CALL
generateLabel(::com::sun::star::chart2::data::LabelOrigin nOrigin
)
594 throw (::com::sun::star::uno::RuntimeException
);
595 virtual ::sal_Int32 SAL_CALL
getNumberFormatKeyByIndex( ::sal_Int32 nIndex
)
596 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
597 ::com::sun::star::uno::RuntimeException
);
599 // XTextualDataSequence --------------------------------------------------
601 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
602 SAL_CALL
getTextualData( ) throw (::com::sun::star::uno::RuntimeException
);
604 // XPropertySet ----------------------------------------------------------
606 virtual ::com::sun::star::uno::Reference
<
607 ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
608 getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException
);
610 virtual void SAL_CALL
setPropertyValue(
611 const ::rtl::OUString
& rPropertyName
,
612 const ::com::sun::star::uno::Any
& rValue
)
613 throw( ::com::sun::star::beans::UnknownPropertyException
,
614 ::com::sun::star::beans::PropertyVetoException
,
615 ::com::sun::star::lang::IllegalArgumentException
,
616 ::com::sun::star::lang::WrappedTargetException
,
617 ::com::sun::star::uno::RuntimeException
);
619 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue(
620 const ::rtl::OUString
& rPropertyName
)
621 throw( ::com::sun::star::beans::UnknownPropertyException
,
622 ::com::sun::star::lang::WrappedTargetException
,
623 ::com::sun::star::uno::RuntimeException
);
625 virtual void SAL_CALL
addPropertyChangeListener(
626 const ::rtl::OUString
& rPropertyName
,
627 const ::com::sun::star::uno::Reference
<
628 ::com::sun::star::beans::XPropertyChangeListener
>& xListener
)
629 throw( ::com::sun::star::beans::UnknownPropertyException
,
630 ::com::sun::star::lang::WrappedTargetException
,
631 ::com::sun::star::uno::RuntimeException
);
633 virtual void SAL_CALL
removePropertyChangeListener(
634 const ::rtl::OUString
& rPropertyName
,
635 const ::com::sun::star::uno::Reference
<
636 ::com::sun::star::beans::XPropertyChangeListener
>& rListener
)
637 throw( ::com::sun::star::beans::UnknownPropertyException
,
638 ::com::sun::star::lang::WrappedTargetException
,
639 ::com::sun::star::uno::RuntimeException
);
641 virtual void SAL_CALL
addVetoableChangeListener(
642 const ::rtl::OUString
& rPropertyName
,
643 const ::com::sun::star::uno::Reference
<
644 ::com::sun::star::beans::XVetoableChangeListener
>& rListener
)
645 throw( ::com::sun::star::beans::UnknownPropertyException
,
646 ::com::sun::star::lang::WrappedTargetException
,
647 ::com::sun::star::uno::RuntimeException
);
649 virtual void SAL_CALL
removeVetoableChangeListener(
650 const ::rtl::OUString
& rPropertyName
,
651 const ::com::sun::star::uno::Reference
<
652 ::com::sun::star::beans::XVetoableChangeListener
>& rListener
)
653 throw( ::com::sun::star::beans::UnknownPropertyException
,
654 ::com::sun::star::lang::WrappedTargetException
,
655 ::com::sun::star::uno::RuntimeException
);
657 // XCloneable ------------------------------------------------------------
659 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
660 throw (::com::sun::star::uno::RuntimeException
);
662 // XModifyBroadcaster ----------------------------------------------------
664 virtual void SAL_CALL
addModifyListener(
665 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
666 throw (::com::sun::star::uno::RuntimeException
);
667 virtual void SAL_CALL
removeModifyListener(
668 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
669 throw (::com::sun::star::uno::RuntimeException
);
671 // XServiceInfo ----------------------------------------------------------
673 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(
674 ::com::sun::star::uno::RuntimeException
);
676 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
&
677 rServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
679 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
680 getSupportedServiceNames() throw(
681 ::com::sun::star::uno::RuntimeException
);
683 // XUnoTunnel ------------------------------------------------------------
685 // virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
686 // sal_Int8 >& aIdentifier )
687 // throw(::com::sun::star::uno::RuntimeException);
689 // static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
690 // static ScChart2DataSequence* getImplementation( const com::sun::star::uno::Reference<
691 // com::sun::star::uno::XInterface> xObj );
693 // Implementation --------------------------------------------------------
695 ScRangeListRef
GetRangeList() { return m_xRanges
; }
700 ::com::sun::star::chart2::data::DataSequenceRole m_aRole
;
701 sal_Bool m_bIncludeHiddenCells
;
703 ScRangeListRef m_xRanges
;
704 ScDocument
* m_pDocument
;
705 com::sun::star::uno::Reference
< com::sun::star::chart2::data::XDataProvider
> m_xDataProvider
;
706 SfxItemPropertySet m_aPropSet
;
707 sal_Bool m_bColumn
; // defines the orientation to create the right labels
712 #endif // SC_CHART2UNO_HXX