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