xref: /trunk/main/sc/inc/docuno.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_DOCUNO_HXX
25 #define SC_DOCUNO_HXX
26 
27 #include "address.hxx"
28 #include <sfx2/sfxbasemodel.hxx>
29 #include <svl/lstner.hxx>
30 #include <svx/fmdmod.hxx>
31 #include <com/sun/star/view/XRenderable.hpp>
32 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
33 #include <com/sun/star/document/XActionLockable.hpp>
34 #include <com/sun/star/document/XLinkTargetSupplier.hpp>
35 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
36 #include <com/sun/star/drawing/XDrawPages.hpp>
37 #include <com/sun/star/sheet/XGoalSeek.hpp>
38 #include <com/sun/star/sheet/XCalculatable.hpp>
39 #include <com/sun/star/sheet/XScenarios.hpp>
40 #include <com/sun/star/sheet/XConsolidatable.hpp>
41 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
42 #include <com/sun/star/sheet/XDocumentAuditing.hpp>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #include <com/sun/star/util/XProtectable.hpp>
45 #include <com/sun/star/container/XEnumerationAccess.hpp>
46 #include <com/sun/star/table/XTableColumns.hpp>
47 #include <com/sun/star/table/XTableRows.hpp>
48 #include <com/sun/star/sheet/XSheetAnnotations.hpp>
49 #include <com/sun/star/beans/XPropertySet.hpp>
50 #include <com/sun/star/sheet/XCellRangesAccess.hpp>
51 #include <com/sun/star/util/XChangesNotifier.hpp>
52 #include <cppuhelper/implbase2.hxx>
53 #include <cppuhelper/implbase3.hxx>
54 #include <cppuhelper/implbase4.hxx>
55 #include <cppuhelper/implbase5.hxx>
56 #include <cppuhelper/interfacecontainer.h>
57 #include <svl/itemprop.hxx>
58 #include "drwlayer.hxx"
59 
60 class ScDocShell;
61 class ScAnnotationObj;
62 class ScMarkData;
63 class ScPrintFuncCache;
64 class ScPrintSelectionStatus;
65 class ScTableColumnObj;
66 class ScTableRowObj;
67 class ScTableSheetObj;
68 class SvxFmDrawPage;
69 class SvxDrawPage;
70 class ScRangeList;
71 class ScPrintUIOptions;
72 class ScSheetSaveData;
73 
74 class SC_DLLPUBLIC ScModelObj : public SfxBaseModel,
75 					public com::sun::star::sheet::XSpreadsheetDocument,
76 					public com::sun::star::document::XActionLockable,
77 					public com::sun::star::sheet::XCalculatable,
78 					public com::sun::star::util::XProtectable,
79 					public com::sun::star::drawing::XDrawPagesSupplier,
80 					public com::sun::star::sheet::XGoalSeek,
81 					public com::sun::star::sheet::XConsolidatable,
82 					public com::sun::star::sheet::XDocumentAuditing,
83 					public com::sun::star::style::XStyleFamiliesSupplier,
84 					public com::sun::star::view::XRenderable,
85 					public com::sun::star::document::XLinkTargetSupplier,
86 					public com::sun::star::beans::XPropertySet,
87 					public SvxFmMSFactory,	// derived from XMultiServiceFactory
88                     public com::sun::star::lang::XServiceInfo,
89                     public ::com::sun::star::util::XChangesNotifier
90 {
91 private:
92 	SfxItemPropertySet		aPropSet;
93 	ScDocShell*				pDocShell;
94 	ScPrintFuncCache*		pPrintFuncCache;
95     ScPrintUIOptions*       pPrinterOptions;
96 	com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> xNumberAgg;
97 	com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawGradTab;
98 	com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawHatchTab;
99 	com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawBitmapTab;
100 	com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawTrGradTab;
101 	com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawMarkerTab;
102 	com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawDashTab;
103     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xChartDataProv;
104 	com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xObjProvider;
105 
106     ::cppu::OInterfaceContainerHelper maChangesListeners;
107 
108 	sal_Bool					FillRenderMarkData( const com::sun::star::uno::Any& aSelection,
109                                                 const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rOptions,
110                                                 ScMarkData& rMark, ScPrintSelectionStatus& rStatus, String& rPagesStr ) const;
111     com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> GetFormatter();
112     void                    HandleCalculateEvents();
113 
114 	rtl::OUString			maBuildId;
115 protected:
GetPropertySet() const116     const SfxItemPropertySet&   GetPropertySet() const { return aPropSet; }
117 
118 public:
119 							ScModelObj(ScDocShell* pDocSh);
120 	virtual					~ScModelObj();
121 
122 	//	create ScModelObj and set at pDocSh (SetBaseModel)
123 	static void				CreateAndSet(ScDocShell* pDocSh);
124 
125 	ScDocument*				GetDocument() const;
126     SfxObjectShell*         GetEmbeddedObject() const;
127 
128     void                    UpdateAllRowHeights( const ScMarkData* pTabMark = NULL, bool bCalcOutputFactor = false );
129 
130     void                    BeforeXMLLoading();
131     void                    AfterXMLLoading(sal_Bool bRet);
132     ScSheetSaveData*        GetSheetSaveData();
133 
134     void                    RepaintRange( const ScRange& rRange );
135 
136     bool                    HasChangesListeners() const;
137 
138     void                    NotifyChanges( const ::rtl::OUString& rOperation, const ScRangeList& rRanges,
139                                            const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rProperties =
140                                                ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >() );
141 
142 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
143 								const ::com::sun::star::uno::Type & rType )
144 									throw(::com::sun::star::uno::RuntimeException);
145 	virtual void SAL_CALL	acquire() throw();
146 	virtual void SAL_CALL	release() throw();
147 
148 //?	virtual UString			getClassName(void);
149 
150 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
151 
152 							// XSpreadsheetDocument
153 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheets > SAL_CALL
154 							getSheets() throw(::com::sun::star::uno::RuntimeException);
155 
156 								// XStyleFamiliesSupplier
157 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
158 							getStyleFamilies() throw(::com::sun::star::uno::RuntimeException);
159 
160 							// XRenderable
161 	virtual sal_Int32 SAL_CALL getRendererCount( const ::com::sun::star::uno::Any& aSelection,
162 									const ::com::sun::star::uno::Sequence<
163 										::com::sun::star::beans::PropertyValue >& xOptions )
164 								throw (::com::sun::star::lang::IllegalArgumentException,
165 										::com::sun::star::uno::RuntimeException);
166 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
167 							getRenderer( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection,
168 									const ::com::sun::star::uno::Sequence<
169 										::com::sun::star::beans::PropertyValue >& xOptions )
170 								throw (::com::sun::star::lang::IllegalArgumentException,
171 										::com::sun::star::uno::RuntimeException);
172 	virtual void SAL_CALL	render( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection,
173 									const ::com::sun::star::uno::Sequence<
174 										::com::sun::star::beans::PropertyValue >& xOptions )
175 								throw (::com::sun::star::lang::IllegalArgumentException,
176 										::com::sun::star::uno::RuntimeException);
177 
178 							// XLinkTargetSupplier
179 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
180 							getLinks() throw(::com::sun::star::uno::RuntimeException);
181 
182 							// XActionLockable
183 	virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException);
184 	virtual void SAL_CALL	addActionLock() throw(::com::sun::star::uno::RuntimeException);
185 	virtual void SAL_CALL	removeActionLock() throw(::com::sun::star::uno::RuntimeException);
186 	virtual void SAL_CALL	setActionLocks( sal_Int16 nLock )
187 								throw(::com::sun::star::uno::RuntimeException);
188 	virtual sal_Int16 SAL_CALL resetActionLocks() throw(::com::sun::star::uno::RuntimeException);
189 
190         virtual void SAL_CALL   lockControllers() throw (::com::sun::star::uno::RuntimeException);
191         virtual void SAL_CALL   unlockControllers() throw (::com::sun::star::uno::RuntimeException);
192 
193 								// XCalculatable
194 	virtual void SAL_CALL	calculate() throw(::com::sun::star::uno::RuntimeException);
195 	virtual void SAL_CALL	calculateAll() throw(::com::sun::star::uno::RuntimeException);
196 	virtual sal_Bool SAL_CALL isAutomaticCalculationEnabled()
197 								throw(::com::sun::star::uno::RuntimeException);
198 	virtual void SAL_CALL	enableAutomaticCalculation( sal_Bool bEnabled )
199 								throw(::com::sun::star::uno::RuntimeException);
200 
201 							// XProtectable
202 	virtual void SAL_CALL	protect( const ::rtl::OUString& aPassword )
203 								throw(::com::sun::star::uno::RuntimeException);
204 	virtual void SAL_CALL	unprotect( const ::rtl::OUString& aPassword )
205 								throw(::com::sun::star::lang::IllegalArgumentException,
206 									::com::sun::star::uno::RuntimeException);
207 	virtual sal_Bool SAL_CALL isProtected() throw(::com::sun::star::uno::RuntimeException);
208 
209 							//	XDrawPagesSupplier
210 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > SAL_CALL
211 							getDrawPages() throw(::com::sun::star::uno::RuntimeException);
212 
213 	//!	XPrintable??
214 
215 							//	XGoalSeek
216 	virtual ::com::sun::star::sheet::GoalResult SAL_CALL seekGoal(
217 								const ::com::sun::star::table::CellAddress& aFormulaPosition,
218 								const ::com::sun::star::table::CellAddress& aVariablePosition,
219 								const ::rtl::OUString& aGoalValue )
220 									throw(::com::sun::star::uno::RuntimeException);
221 
222 							//	XConsolidatable
223 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XConsolidationDescriptor >
224 							SAL_CALL createConsolidationDescriptor( sal_Bool bEmpty )
225 								throw(::com::sun::star::uno::RuntimeException);
226 	virtual void SAL_CALL consolidate( const ::com::sun::star::uno::Reference<
227 								::com::sun::star::sheet::XConsolidationDescriptor >& xDescriptor )
228 									throw(::com::sun::star::uno::RuntimeException);
229 
230 							//	XDocumentAuditing
231 	virtual void SAL_CALL	refreshArrows() throw(::com::sun::star::uno::RuntimeException);
232 
233                             //  XViewDataSupplier
234     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData(  )
235                                 throw (::com::sun::star::uno::RuntimeException);
236 
237                             // XPropertySet
238 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
239 							SAL_CALL getPropertySetInfo()
240 								throw(::com::sun::star::uno::RuntimeException);
241 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
242 									const ::com::sun::star::uno::Any& aValue )
243 								throw(::com::sun::star::beans::UnknownPropertyException,
244 									::com::sun::star::beans::PropertyVetoException,
245 									::com::sun::star::lang::IllegalArgumentException,
246 									::com::sun::star::lang::WrappedTargetException,
247 									::com::sun::star::uno::RuntimeException);
248 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
249 									const ::rtl::OUString& PropertyName )
250 								throw(::com::sun::star::beans::UnknownPropertyException,
251 									::com::sun::star::lang::WrappedTargetException,
252 									::com::sun::star::uno::RuntimeException);
253 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
254 									const ::com::sun::star::uno::Reference<
255 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
256 								throw(::com::sun::star::beans::UnknownPropertyException,
257 									::com::sun::star::lang::WrappedTargetException,
258 									::com::sun::star::uno::RuntimeException);
259 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
260 									const ::com::sun::star::uno::Reference<
261 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
262 								throw(::com::sun::star::beans::UnknownPropertyException,
263 									::com::sun::star::lang::WrappedTargetException,
264 									::com::sun::star::uno::RuntimeException);
265 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
266 									const ::com::sun::star::uno::Reference<
267 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
268 								throw(::com::sun::star::beans::UnknownPropertyException,
269 									::com::sun::star::lang::WrappedTargetException,
270 									::com::sun::star::uno::RuntimeException);
271 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
272 									const ::com::sun::star::uno::Reference<
273 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
274 								throw(::com::sun::star::beans::UnknownPropertyException,
275 									::com::sun::star::lang::WrappedTargetException,
276 									::com::sun::star::uno::RuntimeException);
277 
278 							// XMultiServiceFactory
279 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
280 							createInstance( const ::rtl::OUString& aServiceSpecifier )
281 								throw(::com::sun::star::uno::Exception,
282 										::com::sun::star::uno::RuntimeException);
283 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
284 							createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier,
285 								const ::com::sun::star::uno::Sequence<
286 									::com::sun::star::uno::Any >& Arguments )
287 								throw(::com::sun::star::uno::Exception,
288 									::com::sun::star::uno::RuntimeException);
289 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames()
290 								throw(::com::sun::star::uno::RuntimeException);
291 
292 							// XServiceInfo
293 	virtual ::rtl::OUString SAL_CALL getImplementationName()
294 								throw(::com::sun::star::uno::RuntimeException);
295 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
296 								throw(::com::sun::star::uno::RuntimeException);
297 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
298 								throw(::com::sun::star::uno::RuntimeException);
299 
300 							// XUnoTunnel
301 	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
302 									sal_Int8 >& aIdentifier )
303 								throw(::com::sun::star::uno::RuntimeException);
304 
305 	static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
306 	static ScModelObj* getImplementation( const com::sun::star::uno::Reference<
307 									com::sun::star::uno::XInterface> xObj );
308 
309 							// XTypeProvider
310 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
311 								throw(::com::sun::star::uno::RuntimeException);
312 	virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
313 								throw(::com::sun::star::uno::RuntimeException);
314 
315                             // XChangesNotifier
316     virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference<
317                                     ::com::sun::star::util::XChangesListener >& aListener )
318                                 throw (::com::sun::star::uno::RuntimeException);
319     virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference<
320                                     ::com::sun::star::util::XChangesListener >& aListener )
321                                 throw (::com::sun::star::uno::RuntimeException);
322 };
323 
324 
325 class ScDrawPagesObj : public cppu::WeakImplHelper2<
326 								com::sun::star::drawing::XDrawPages,
327 								com::sun::star::lang::XServiceInfo>,
328 						public SfxListener
329 {
330 private:
331 	ScDocShell*				pDocShell;
332 
333 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
334 							GetObjectByIndex_Impl(sal_Int32 nIndex) const;
335 
336 public:
337 							ScDrawPagesObj(ScDocShell* pDocSh);
338 	virtual					~ScDrawPagesObj();
339 
340 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
341 
342 							// XDrawPages
343 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL
344 							insertNewByIndex( sal_Int32 nIndex )
345 								throw(::com::sun::star::uno::RuntimeException);
346 	virtual void SAL_CALL	remove( const ::com::sun::star::uno::Reference<
347 								::com::sun::star::drawing::XDrawPage >& xPage )
348 									throw(::com::sun::star::uno::RuntimeException);
349 
350 							// XIndexAccess
351 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
352 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
353 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
354 									::com::sun::star::lang::WrappedTargetException,
355 									::com::sun::star::uno::RuntimeException);
356 
357 							// XElementAccess
358 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
359 								throw(::com::sun::star::uno::RuntimeException);
360 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
361 
362 							// XServiceInfo
363 	virtual ::rtl::OUString SAL_CALL getImplementationName()
364 								throw(::com::sun::star::uno::RuntimeException);
365 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
366 								throw(::com::sun::star::uno::RuntimeException);
367 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
368 								throw(::com::sun::star::uno::RuntimeException);
369 };
370 
371 
372 class ScTableSheetsObj : public cppu::WeakImplHelper5<
373 								com::sun::star::sheet::XSpreadsheets,
374                                 com::sun::star::sheet::XCellRangesAccess,
375 								com::sun::star::container::XEnumerationAccess,
376 								com::sun::star::container::XIndexAccess,
377 								com::sun::star::lang::XServiceInfo>,
378 						 public SfxListener
379 {
380 private:
381 	ScDocShell*				pDocShell;
382 
383 	ScTableSheetObj*		GetObjectByIndex_Impl(sal_Int32 nIndex) const;
384 	ScTableSheetObj*		GetObjectByName_Impl(const ::rtl::OUString& aName) const;
385 
386 public:
387 							ScTableSheetsObj(ScDocShell* pDocSh);
388 	virtual					~ScTableSheetsObj();
389 
390 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
391 
392 							// XSpreadsheets
393 	virtual void SAL_CALL	insertNewByName( const ::rtl::OUString& aName, sal_Int16 nPosition )
394 								throw(::com::sun::star::uno::RuntimeException);
395 	virtual void SAL_CALL	moveByName( const ::rtl::OUString& aName, sal_Int16 nDestination )
396 								throw(::com::sun::star::uno::RuntimeException);
397 	virtual void SAL_CALL	copyByName( const ::rtl::OUString& aName,
398 								const ::rtl::OUString& aCopy, sal_Int16 nDestination )
399 									throw(::com::sun::star::uno::RuntimeException);
400 
401                             // XCellRangesAccess
402 
403     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
404         SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet )
405         throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
406 
407     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
408         SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet )
409         throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
410 
411     virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > >
412         SAL_CALL getCellRangesByName( const ::rtl::OUString& aRange )
413         throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
414 
415 							// XNameContainer
416 	virtual void SAL_CALL	insertByName( const ::rtl::OUString& aName,
417 								const ::com::sun::star::uno::Any& aElement )
418 									throw(::com::sun::star::lang::IllegalArgumentException,
419 										::com::sun::star::container::ElementExistException,
420 										::com::sun::star::lang::WrappedTargetException,
421 										::com::sun::star::uno::RuntimeException);
422 	virtual void SAL_CALL	removeByName( const ::rtl::OUString& Name )
423 								throw(::com::sun::star::container::NoSuchElementException,
424 									::com::sun::star::lang::WrappedTargetException,
425 									::com::sun::star::uno::RuntimeException);
426 
427 							// XNameReplace
428 	virtual void SAL_CALL	replaceByName( const ::rtl::OUString& aName,
429 								const ::com::sun::star::uno::Any& aElement )
430 									throw(::com::sun::star::lang::IllegalArgumentException,
431 										::com::sun::star::container::NoSuchElementException,
432 										::com::sun::star::lang::WrappedTargetException,
433 										::com::sun::star::uno::RuntimeException);
434 
435 							// XEnumerationAccess
436 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
437 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
438 
439 							// XElementAccess
440 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
441 								throw(::com::sun::star::uno::RuntimeException);
442 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
443 
444 							// XIndexAccess
445 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
446 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
447 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
448 									::com::sun::star::lang::WrappedTargetException,
449 									::com::sun::star::uno::RuntimeException);
450 
451 							// XNameAccess
452 	virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
453 								throw(::com::sun::star::container::NoSuchElementException,
454 									::com::sun::star::lang::WrappedTargetException,
455 									::com::sun::star::uno::RuntimeException);
456 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
457 								throw(::com::sun::star::uno::RuntimeException);
458 	virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
459 								throw(::com::sun::star::uno::RuntimeException);
460 
461 							// XServiceInfo
462 	virtual ::rtl::OUString SAL_CALL getImplementationName()
463 								throw(::com::sun::star::uno::RuntimeException);
464 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
465 								throw(::com::sun::star::uno::RuntimeException);
466 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
467 								throw(::com::sun::star::uno::RuntimeException);
468 };
469 
470 
471 class ScTableColumnsObj : public cppu::WeakImplHelper5<
472 								com::sun::star::table::XTableColumns,
473 								com::sun::star::container::XEnumerationAccess,
474 								com::sun::star::container::XNameAccess,
475 								com::sun::star::beans::XPropertySet,
476 								com::sun::star::lang::XServiceInfo>,
477 						  public SfxListener
478 {
479 private:
480 	ScDocShell*				pDocShell;
481 	SCTAB					nTab;
482 	SCCOL					nStartCol;
483 	SCCOL					nEndCol;
484 
485 	ScTableColumnObj*		GetObjectByIndex_Impl(sal_Int32 nIndex) const;
486 	ScTableColumnObj*		GetObjectByName_Impl(const ::rtl::OUString& aName) const;
487 
488 public:
489 							ScTableColumnsObj(ScDocShell* pDocSh, SCTAB nT,
490 												SCCOL nSC, SCCOL nEC);
491 	virtual					~ScTableColumnsObj();
492 
493 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
494 
495 							// XTableColumns
496 	virtual void SAL_CALL	insertByIndex( sal_Int32 nIndex, sal_Int32 nCount )
497 								throw(::com::sun::star::uno::RuntimeException);
498 	virtual void SAL_CALL	removeByIndex( sal_Int32 nIndex, sal_Int32 nCount )
499 								throw(::com::sun::star::uno::RuntimeException);
500 
501 							// XNameAccess
502 	virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
503 								throw(::com::sun::star::container::NoSuchElementException,
504 									::com::sun::star::lang::WrappedTargetException,
505 									::com::sun::star::uno::RuntimeException);
506 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
507 								throw(::com::sun::star::uno::RuntimeException);
508 	virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
509 								throw(::com::sun::star::uno::RuntimeException);
510 
511 							// XIndexAccess
512 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
513 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
514 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
515 									::com::sun::star::lang::WrappedTargetException,
516 									::com::sun::star::uno::RuntimeException);
517 
518 							// XEnumerationAccess
519 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
520 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
521 
522 							// XElementAccess
523 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
524 								throw(::com::sun::star::uno::RuntimeException);
525 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
526 
527 							// XPropertySet
528 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
529 							SAL_CALL getPropertySetInfo()
530 								throw(::com::sun::star::uno::RuntimeException);
531 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
532 									const ::com::sun::star::uno::Any& aValue )
533 								throw(::com::sun::star::beans::UnknownPropertyException,
534 									::com::sun::star::beans::PropertyVetoException,
535 									::com::sun::star::lang::IllegalArgumentException,
536 									::com::sun::star::lang::WrappedTargetException,
537 									::com::sun::star::uno::RuntimeException);
538 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
539 									const ::rtl::OUString& PropertyName )
540 								throw(::com::sun::star::beans::UnknownPropertyException,
541 									::com::sun::star::lang::WrappedTargetException,
542 									::com::sun::star::uno::RuntimeException);
543 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
544 									const ::com::sun::star::uno::Reference<
545 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
546 								throw(::com::sun::star::beans::UnknownPropertyException,
547 									::com::sun::star::lang::WrappedTargetException,
548 									::com::sun::star::uno::RuntimeException);
549 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
550 									const ::com::sun::star::uno::Reference<
551 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
552 								throw(::com::sun::star::beans::UnknownPropertyException,
553 									::com::sun::star::lang::WrappedTargetException,
554 									::com::sun::star::uno::RuntimeException);
555 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
556 									const ::com::sun::star::uno::Reference<
557 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
558 								throw(::com::sun::star::beans::UnknownPropertyException,
559 									::com::sun::star::lang::WrappedTargetException,
560 									::com::sun::star::uno::RuntimeException);
561 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
562 									const ::com::sun::star::uno::Reference<
563 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
564 								throw(::com::sun::star::beans::UnknownPropertyException,
565 									::com::sun::star::lang::WrappedTargetException,
566 									::com::sun::star::uno::RuntimeException);
567 
568 							// XServiceInfo
569 	virtual ::rtl::OUString SAL_CALL getImplementationName()
570 								throw(::com::sun::star::uno::RuntimeException);
571 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
572 								throw(::com::sun::star::uno::RuntimeException);
573 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
574 								throw(::com::sun::star::uno::RuntimeException);
575 };
576 
577 
578 class ScTableRowsObj : public cppu::WeakImplHelper4<
579 								com::sun::star::table::XTableRows,
580 								com::sun::star::container::XEnumerationAccess,
581 								com::sun::star::beans::XPropertySet,
582 								com::sun::star::lang::XServiceInfo>,
583 						  public SfxListener
584 {
585 private:
586 	ScDocShell*				pDocShell;
587 	SCTAB					nTab;
588 	SCROW					nStartRow;
589 	SCROW					nEndRow;
590 
591 	ScTableRowObj*			GetObjectByIndex_Impl(sal_Int32 nIndex) const;
592 
593 public:
594 							ScTableRowsObj(ScDocShell* pDocSh, SCTAB nT,
595 												SCROW nSR, SCROW nER);
596 	virtual					~ScTableRowsObj();
597 
598 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
599 
600 							// XTableRows
601 	virtual void SAL_CALL	insertByIndex( sal_Int32 nIndex, sal_Int32 nCount )
602 								throw(::com::sun::star::uno::RuntimeException);
603 	virtual void SAL_CALL	removeByIndex( sal_Int32 nIndex, sal_Int32 nCount )
604 								throw(::com::sun::star::uno::RuntimeException);
605 
606 							// XIndexAccess
607 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
608 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
609 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
610 									::com::sun::star::lang::WrappedTargetException,
611 									::com::sun::star::uno::RuntimeException);
612 
613 							// XEnumerationAccess
614 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
615 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
616 
617 							// XElementAccess
618 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
619 								throw(::com::sun::star::uno::RuntimeException);
620 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
621 
622 							// XPropertySet
623 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
624 							SAL_CALL getPropertySetInfo()
625 								throw(::com::sun::star::uno::RuntimeException);
626 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
627 									const ::com::sun::star::uno::Any& aValue )
628 								throw(::com::sun::star::beans::UnknownPropertyException,
629 									::com::sun::star::beans::PropertyVetoException,
630 									::com::sun::star::lang::IllegalArgumentException,
631 									::com::sun::star::lang::WrappedTargetException,
632 									::com::sun::star::uno::RuntimeException);
633 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
634 									const ::rtl::OUString& PropertyName )
635 								throw(::com::sun::star::beans::UnknownPropertyException,
636 									::com::sun::star::lang::WrappedTargetException,
637 									::com::sun::star::uno::RuntimeException);
638 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
639 									const ::com::sun::star::uno::Reference<
640 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
641 								throw(::com::sun::star::beans::UnknownPropertyException,
642 									::com::sun::star::lang::WrappedTargetException,
643 									::com::sun::star::uno::RuntimeException);
644 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
645 									const ::com::sun::star::uno::Reference<
646 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
647 								throw(::com::sun::star::beans::UnknownPropertyException,
648 									::com::sun::star::lang::WrappedTargetException,
649 									::com::sun::star::uno::RuntimeException);
650 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
651 									const ::com::sun::star::uno::Reference<
652 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
653 								throw(::com::sun::star::beans::UnknownPropertyException,
654 									::com::sun::star::lang::WrappedTargetException,
655 									::com::sun::star::uno::RuntimeException);
656 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
657 									const ::com::sun::star::uno::Reference<
658 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
659 								throw(::com::sun::star::beans::UnknownPropertyException,
660 									::com::sun::star::lang::WrappedTargetException,
661 									::com::sun::star::uno::RuntimeException);
662 
663 							// XServiceInfo
664 	virtual ::rtl::OUString SAL_CALL getImplementationName()
665 								throw(::com::sun::star::uno::RuntimeException);
666 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
667 								throw(::com::sun::star::uno::RuntimeException);
668 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
669 								throw(::com::sun::star::uno::RuntimeException);
670 };
671 
672 
673 class ScSpreadsheetSettingsObj : public cppu::WeakImplHelper2<
674 									com::sun::star::beans::XPropertySet,
675 									com::sun::star::lang::XServiceInfo>,
676 								 public SfxListener
677 {
678 private:
679 	ScDocShell*				pDocShell;
680 
681 public:
682 //UNUSED2008-05             ScSpreadsheetSettingsObj(ScDocShell* pDocSh);
683 	virtual					~ScSpreadsheetSettingsObj();
684 
685 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
686 
687 							// XPropertySet
688 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
689 							SAL_CALL getPropertySetInfo()
690 								throw(::com::sun::star::uno::RuntimeException);
691 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
692 									const ::com::sun::star::uno::Any& aValue )
693 								throw(::com::sun::star::beans::UnknownPropertyException,
694 									::com::sun::star::beans::PropertyVetoException,
695 									::com::sun::star::lang::IllegalArgumentException,
696 									::com::sun::star::lang::WrappedTargetException,
697 									::com::sun::star::uno::RuntimeException);
698 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
699 									const ::rtl::OUString& PropertyName )
700 								throw(::com::sun::star::beans::UnknownPropertyException,
701 									::com::sun::star::lang::WrappedTargetException,
702 									::com::sun::star::uno::RuntimeException);
703 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
704 									const ::com::sun::star::uno::Reference<
705 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
706 								throw(::com::sun::star::beans::UnknownPropertyException,
707 									::com::sun::star::lang::WrappedTargetException,
708 									::com::sun::star::uno::RuntimeException);
709 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
710 									const ::com::sun::star::uno::Reference<
711 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
712 								throw(::com::sun::star::beans::UnknownPropertyException,
713 									::com::sun::star::lang::WrappedTargetException,
714 									::com::sun::star::uno::RuntimeException);
715 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
716 									const ::com::sun::star::uno::Reference<
717 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
718 								throw(::com::sun::star::beans::UnknownPropertyException,
719 									::com::sun::star::lang::WrappedTargetException,
720 									::com::sun::star::uno::RuntimeException);
721 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
722 									const ::com::sun::star::uno::Reference<
723 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
724 								throw(::com::sun::star::beans::UnknownPropertyException,
725 									::com::sun::star::lang::WrappedTargetException,
726 									::com::sun::star::uno::RuntimeException);
727 
728 							// XServiceInfo
729 	virtual ::rtl::OUString SAL_CALL getImplementationName()
730 								throw(::com::sun::star::uno::RuntimeException);
731 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
732 								throw(::com::sun::star::uno::RuntimeException);
733 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
734 								throw(::com::sun::star::uno::RuntimeException);
735 };
736 
737 
738 class ScAnnotationsObj : public cppu::WeakImplHelper3<
739 								com::sun::star::sheet::XSheetAnnotations,
740 								com::sun::star::container::XEnumerationAccess,
741 								com::sun::star::lang::XServiceInfo>,
742 						  public SfxListener
743 {
744 private:
745 	ScDocShell*				pDocShell;
746 	SCTAB					nTab;			// Collection haengt am Sheet
747 
748 	bool					GetAddressByIndex_Impl( sal_Int32 nIndex, ScAddress& rPos ) const;
749 	ScAnnotationObj*		GetObjectByIndex_Impl( sal_Int32 nIndex ) const;
750 
751 public:
752 							ScAnnotationsObj(ScDocShell* pDocSh, SCTAB nT);
753 	virtual					~ScAnnotationsObj();
754 
755 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
756 
757 							// XSheetAnnotations
758 	virtual void SAL_CALL	insertNew( const ::com::sun::star::table::CellAddress& aPosition,
759 								const ::rtl::OUString& aText )
760 									throw(::com::sun::star::uno::RuntimeException);
761 	virtual void SAL_CALL	removeByIndex( sal_Int32 nIndex )
762 								throw(::com::sun::star::uno::RuntimeException);
763 
764 							// XIndexAccess
765 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
766 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
767 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
768 									::com::sun::star::lang::WrappedTargetException,
769 									::com::sun::star::uno::RuntimeException);
770 
771 							// XEnumerationAccess
772 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
773 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
774 
775 							// XElementAccess
776 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
777 								throw(::com::sun::star::uno::RuntimeException);
778 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
779 
780 							// XServiceInfo
781 	virtual ::rtl::OUString SAL_CALL getImplementationName()
782 								throw(::com::sun::star::uno::RuntimeException);
783 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
784 								throw(::com::sun::star::uno::RuntimeException);
785 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
786 								throw(::com::sun::star::uno::RuntimeException);
787 };
788 
789 
790 class ScScenariosObj : public cppu::WeakImplHelper4<
791 								com::sun::star::sheet::XScenarios,
792 								com::sun::star::container::XEnumerationAccess,
793 								com::sun::star::container::XIndexAccess,
794 								com::sun::star::lang::XServiceInfo>,
795 						  public SfxListener
796 {
797 private:
798 	ScDocShell*				pDocShell;
799 	SCTAB					nTab;
800 
801 	sal_Bool					GetScenarioIndex_Impl( const ::rtl::OUString& rName, SCTAB& rIndex );
802 	ScTableSheetObj*		GetObjectByIndex_Impl(sal_Int32 nIndex);
803 	ScTableSheetObj*		GetObjectByName_Impl(const ::rtl::OUString& aName);
804 
805 public:
806 							ScScenariosObj(ScDocShell* pDocSh, SCTAB nT);
807 	virtual					~ScScenariosObj();
808 
809 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
810 
811 							// XScenarios
812 	virtual void SAL_CALL	addNewByName( const ::rtl::OUString& aName,
813 								const ::com::sun::star::uno::Sequence<
814 									::com::sun::star::table::CellRangeAddress >& aRanges,
815 								const ::rtl::OUString& aComment )
816 									throw(::com::sun::star::uno::RuntimeException);
817 	virtual void SAL_CALL	removeByName( const ::rtl::OUString& aName )
818 								throw(::com::sun::star::uno::RuntimeException);
819 
820 							// XNameAccess
821 	virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
822 								throw(::com::sun::star::container::NoSuchElementException,
823 									::com::sun::star::lang::WrappedTargetException,
824 									::com::sun::star::uno::RuntimeException);
825 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
826 								throw(::com::sun::star::uno::RuntimeException);
827 	virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
828 								throw(::com::sun::star::uno::RuntimeException);
829 
830 							// XIndexAccess
831 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
832 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
833 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
834 									::com::sun::star::lang::WrappedTargetException,
835 									::com::sun::star::uno::RuntimeException);
836 
837 							// XEnumerationAccess
838 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
839 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
840 
841 							// XElementAccess
842 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
843 								throw(::com::sun::star::uno::RuntimeException);
844 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
845 
846 							// XServiceInfo
847 	virtual ::rtl::OUString SAL_CALL getImplementationName()
848 								throw(::com::sun::star::uno::RuntimeException);
849 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
850 								throw(::com::sun::star::uno::RuntimeException);
851 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
852 								throw(::com::sun::star::uno::RuntimeException);
853 };
854 
855 
856 
857 
858 #endif
859 
860