xref: /trunk/main/sc/inc/docuno.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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/XLinkAuthorizer.hpp>
35 #include <com/sun/star/document/XLinkTargetSupplier.hpp>
36 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
37 #include <com/sun/star/drawing/XDrawPages.hpp>
38 #include <com/sun/star/sheet/XGoalSeek.hpp>
39 #include <com/sun/star/sheet/XCalculatable.hpp>
40 #include <com/sun/star/sheet/XScenarios.hpp>
41 #include <com/sun/star/sheet/XConsolidatable.hpp>
42 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
43 #include <com/sun/star/sheet/XDocumentAuditing.hpp>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/util/XProtectable.hpp>
46 #include <com/sun/star/container/XEnumerationAccess.hpp>
47 #include <com/sun/star/table/XTableColumns.hpp>
48 #include <com/sun/star/table/XTableRows.hpp>
49 #include <com/sun/star/sheet/XSheetAnnotations.hpp>
50 #include <com/sun/star/beans/XPropertySet.hpp>
51 #include <com/sun/star/sheet/XCellRangesAccess.hpp>
52 #include <com/sun/star/util/XChangesNotifier.hpp>
53 #include <cppuhelper/implbase2.hxx>
54 #include <cppuhelper/implbase3.hxx>
55 #include <cppuhelper/implbase4.hxx>
56 #include <cppuhelper/implbase5.hxx>
57 #include <cppuhelper/interfacecontainer.h>
58 #include <svl/itemprop.hxx>
59 #include "drwlayer.hxx"
60 
61 class ScDocShell;
62 class ScAnnotationObj;
63 class ScMarkData;
64 class ScPrintFuncCache;
65 class ScPrintSelectionStatus;
66 class ScTableColumnObj;
67 class ScTableRowObj;
68 class ScTableSheetObj;
69 class SvxFmDrawPage;
70 class SvxDrawPage;
71 class ScRangeList;
72 class ScPrintUIOptions;
73 class ScSheetSaveData;
74 
75 class SC_DLLPUBLIC ScModelObj : public SfxBaseModel,
76                     public com::sun::star::sheet::XSpreadsheetDocument,
77                     public com::sun::star::document::XActionLockable,
78                     public com::sun::star::sheet::XCalculatable,
79                     public com::sun::star::util::XProtectable,
80                     public com::sun::star::drawing::XDrawPagesSupplier,
81                     public com::sun::star::sheet::XGoalSeek,
82                     public com::sun::star::sheet::XConsolidatable,
83                     public com::sun::star::sheet::XDocumentAuditing,
84                     public com::sun::star::style::XStyleFamiliesSupplier,
85                     public com::sun::star::view::XRenderable,
86                     public com::sun::star::document::XLinkAuthorizer,
87                     public com::sun::star::document::XLinkTargetSupplier,
88                     public com::sun::star::beans::XPropertySet,
89                     public SvxFmMSFactory,  // derived from XMultiServiceFactory
90                     public com::sun::star::lang::XServiceInfo,
91                     public ::com::sun::star::util::XChangesNotifier
92 {
93 private:
94     SfxItemPropertySet      aPropSet;
95     ScDocShell*             pDocShell;
96     ScPrintFuncCache*       pPrintFuncCache;
97     ScPrintUIOptions*       pPrinterOptions;
98     com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> xNumberAgg;
99     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawGradTab;
100     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawHatchTab;
101     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawBitmapTab;
102     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawTrGradTab;
103     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawMarkerTab;
104     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawDashTab;
105     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xChartDataProv;
106     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xObjProvider;
107 
108     ::cppu::OInterfaceContainerHelper maChangesListeners;
109 
110     sal_Bool                    FillRenderMarkData( const com::sun::star::uno::Any& aSelection,
111                                                 const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rOptions,
112                                                 ScMarkData& rMark, ScPrintSelectionStatus& rStatus, String& rPagesStr ) const;
113     com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> GetFormatter();
114     void                    HandleCalculateEvents();
115 
116     rtl::OUString           maBuildId;
117 protected:
GetPropertySet() const118     const SfxItemPropertySet&   GetPropertySet() const { return aPropSet; }
119 
120 public:
121                             ScModelObj(ScDocShell* pDocSh);
122     virtual                 ~ScModelObj();
123 
124     //  create ScModelObj and set at pDocSh (SetBaseModel)
125     static void             CreateAndSet(ScDocShell* pDocSh);
126 
127     ScDocument*             GetDocument() const;
128     SfxObjectShell*         GetEmbeddedObject() const;
129 
130     void                    UpdateAllRowHeights( const ScMarkData* pTabMark = NULL, bool bCalcOutputFactor = false );
131 
132     void                    BeforeXMLLoading();
133     void                    AfterXMLLoading(sal_Bool bRet);
134     ScSheetSaveData*        GetSheetSaveData();
135 
136     void                    RepaintRange( const ScRange& rRange );
137 
138     bool                    HasChangesListeners() const;
139 
140     void                    NotifyChanges( const ::rtl::OUString& rOperation, const ScRangeList& rRanges,
141                                            const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rProperties =
142                                                ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >() );
143 
144     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
145                                 const ::com::sun::star::uno::Type & rType );
146     virtual void SAL_CALL   acquire() throw();
147     virtual void SAL_CALL   release() throw();
148 
149 //? virtual UString         getClassName(void);
150 
151     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
152 
153                             // XSpreadsheetDocument
154     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheets > SAL_CALL
155                             getSheets();
156 
157                                 // XStyleFamiliesSupplier
158     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
159                             getStyleFamilies();
160 
161                             // XRenderable
162     virtual sal_Int32 SAL_CALL getRendererCount( const ::com::sun::star::uno::Any& aSelection,
163                                     const ::com::sun::star::uno::Sequence<
164                                         ::com::sun::star::beans::PropertyValue >& xOptions );
165     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
166                             getRenderer( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection,
167                                     const ::com::sun::star::uno::Sequence<
168                                         ::com::sun::star::beans::PropertyValue >& xOptions );
169     virtual void SAL_CALL   render( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection,
170                                     const ::com::sun::star::uno::Sequence<
171                                         ::com::sun::star::beans::PropertyValue >& xOptions );
172 
173                             //XLinkAuthorizer
174     virtual sal_Bool SAL_CALL authorizeLinks( const ::rtl::OUString& rURL );
175                             // XLinkTargetSupplier
176     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
177                             getLinks();
178 
179                             // XActionLockable
180     virtual sal_Bool SAL_CALL isActionLocked();
181     virtual void SAL_CALL   addActionLock();
182     virtual void SAL_CALL   removeActionLock();
183     virtual void SAL_CALL   setActionLocks( sal_Int16 nLock );
184     virtual sal_Int16 SAL_CALL resetActionLocks();
185 
186         virtual void SAL_CALL   lockControllers();
187         virtual void SAL_CALL   unlockControllers();
188 
189                                 // XCalculatable
190     virtual void SAL_CALL   calculate();
191     virtual void SAL_CALL   calculateAll();
192     virtual sal_Bool SAL_CALL isAutomaticCalculationEnabled();
193     virtual void SAL_CALL   enableAutomaticCalculation( sal_Bool bEnabled );
194 
195                             // XProtectable
196     virtual void SAL_CALL   protect( const ::rtl::OUString& aPassword );
197     virtual void SAL_CALL   unprotect( const ::rtl::OUString& aPassword );
198     virtual sal_Bool SAL_CALL isProtected();
199 
200                             //  XDrawPagesSupplier
201     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > SAL_CALL
202                             getDrawPages();
203 
204     //! XPrintable??
205 
206                             //  XGoalSeek
207     virtual ::com::sun::star::sheet::GoalResult SAL_CALL seekGoal(
208                                 const ::com::sun::star::table::CellAddress& aFormulaPosition,
209                                 const ::com::sun::star::table::CellAddress& aVariablePosition,
210                                 const ::rtl::OUString& aGoalValue );
211 
212                             //  XConsolidatable
213     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XConsolidationDescriptor >
214                             SAL_CALL createConsolidationDescriptor( sal_Bool bEmpty );
215     virtual void SAL_CALL consolidate( const ::com::sun::star::uno::Reference<
216                                 ::com::sun::star::sheet::XConsolidationDescriptor >& xDescriptor );
217 
218                             //  XDocumentAuditing
219     virtual void SAL_CALL   refreshArrows();
220 
221                             //  XViewDataSupplier
222     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData(  );
223 
224                             // XPropertySet
225     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
226                             SAL_CALL getPropertySetInfo();
227     virtual void SAL_CALL   setPropertyValue( const ::rtl::OUString& aPropertyName,
228                                     const ::com::sun::star::uno::Any& aValue );
229     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
230                                     const ::rtl::OUString& PropertyName );
231     virtual void SAL_CALL   addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
232                                     const ::com::sun::star::uno::Reference<
233                                         ::com::sun::star::beans::XPropertyChangeListener >& xListener );
234     virtual void SAL_CALL   removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
235                                     const ::com::sun::star::uno::Reference<
236                                         ::com::sun::star::beans::XPropertyChangeListener >& aListener );
237     virtual void SAL_CALL   addVetoableChangeListener( const ::rtl::OUString& PropertyName,
238                                     const ::com::sun::star::uno::Reference<
239                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener );
240     virtual void SAL_CALL   removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
241                                     const ::com::sun::star::uno::Reference<
242                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener );
243 
244                             // XMultiServiceFactory
245     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
246                             createInstance( const ::rtl::OUString& aServiceSpecifier );
247     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
248                             createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier,
249                                 const ::com::sun::star::uno::Sequence<
250                                     ::com::sun::star::uno::Any >& Arguments );
251     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames();
252 
253                             // XServiceInfo
254     virtual ::rtl::OUString SAL_CALL getImplementationName();
255     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
256     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
257 
258                             // XUnoTunnel
259     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
260                                     sal_Int8 >& aIdentifier );
261 
262     static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
263     static ScModelObj* getImplementation( const com::sun::star::uno::Reference<
264                                     com::sun::star::uno::XInterface> xObj );
265 
266                             // XTypeProvider
267     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes();
268     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId();
269 
270                             // XChangesNotifier
271     virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference<
272                                     ::com::sun::star::util::XChangesListener >& aListener );
273     virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference<
274                                     ::com::sun::star::util::XChangesListener >& aListener );
275 };
276 
277 
278 class ScDrawPagesObj : public cppu::WeakImplHelper2<
279                                 com::sun::star::drawing::XDrawPages,
280                                 com::sun::star::lang::XServiceInfo>,
281                         public SfxListener
282 {
283 private:
284     ScDocShell*             pDocShell;
285 
286 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
287                             GetObjectByIndex_Impl(sal_Int32 nIndex) const;
288 
289 public:
290                             ScDrawPagesObj(ScDocShell* pDocSh);
291     virtual                 ~ScDrawPagesObj();
292 
293     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
294 
295                             // XDrawPages
296     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL
297                             insertNewByIndex( sal_Int32 nIndex );
298     virtual void SAL_CALL   remove( const ::com::sun::star::uno::Reference<
299                                 ::com::sun::star::drawing::XDrawPage >& xPage );
300 
301                             // XIndexAccess
302     virtual sal_Int32 SAL_CALL getCount();
303     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
304 
305                             // XElementAccess
306     virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
307     virtual sal_Bool SAL_CALL hasElements();
308 
309                             // XServiceInfo
310     virtual ::rtl::OUString SAL_CALL getImplementationName();
311     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
312     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
313 };
314 
315 
316 class ScTableSheetsObj : public cppu::WeakImplHelper5<
317                                 com::sun::star::sheet::XSpreadsheets,
318                                 com::sun::star::sheet::XCellRangesAccess,
319                                 com::sun::star::container::XEnumerationAccess,
320                                 com::sun::star::container::XIndexAccess,
321                                 com::sun::star::lang::XServiceInfo>,
322                          public SfxListener
323 {
324 private:
325     ScDocShell*             pDocShell;
326 
327     ScTableSheetObj*        GetObjectByIndex_Impl(sal_Int32 nIndex) const;
328     ScTableSheetObj*        GetObjectByName_Impl(const ::rtl::OUString& aName) const;
329 
330 public:
331                             ScTableSheetsObj(ScDocShell* pDocSh);
332     virtual                 ~ScTableSheetsObj();
333 
334     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
335 
336                             // XSpreadsheets
337     virtual void SAL_CALL   insertNewByName( const ::rtl::OUString& aName, sal_Int16 nPosition );
338     virtual void SAL_CALL   moveByName( const ::rtl::OUString& aName, sal_Int16 nDestination );
339     virtual void SAL_CALL   copyByName( const ::rtl::OUString& aName,
340                                 const ::rtl::OUString& aCopy, sal_Int16 nDestination );
341 
342                             // XCellRangesAccess
343 
344     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
345         SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet );
346 
347     virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
348         SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet );
349 
350     virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > >
351         SAL_CALL getCellRangesByName( const ::rtl::OUString& aRange );
352 
353                             // XNameContainer
354     virtual void SAL_CALL   insertByName( const ::rtl::OUString& aName,
355                                 const ::com::sun::star::uno::Any& aElement );
356     virtual void SAL_CALL   removeByName( const ::rtl::OUString& Name );
357 
358                             // XNameReplace
359     virtual void SAL_CALL   replaceByName( const ::rtl::OUString& aName,
360                                 const ::com::sun::star::uno::Any& aElement );
361 
362                             // XEnumerationAccess
363     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
364                             createEnumeration();
365 
366                             // XElementAccess
367     virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
368     virtual sal_Bool SAL_CALL hasElements();
369 
370                             // XIndexAccess
371     virtual sal_Int32 SAL_CALL getCount();
372     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
373 
374                             // XNameAccess
375     virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName );
376     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames();
377     virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName );
378 
379                             // XServiceInfo
380     virtual ::rtl::OUString SAL_CALL getImplementationName();
381     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
382     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
383 };
384 
385 
386 class ScTableColumnsObj : public cppu::WeakImplHelper5<
387                                 com::sun::star::table::XTableColumns,
388                                 com::sun::star::container::XEnumerationAccess,
389                                 com::sun::star::container::XNameAccess,
390                                 com::sun::star::beans::XPropertySet,
391                                 com::sun::star::lang::XServiceInfo>,
392                           public SfxListener
393 {
394 private:
395     ScDocShell*             pDocShell;
396     SCTAB                   nTab;
397     SCCOL                   nStartCol;
398     SCCOL                   nEndCol;
399 
400     ScTableColumnObj*       GetObjectByIndex_Impl(sal_Int32 nIndex) const;
401     ScTableColumnObj*       GetObjectByName_Impl(const ::rtl::OUString& aName) const;
402 
403 public:
404                             ScTableColumnsObj(ScDocShell* pDocSh, SCTAB nT,
405                                                 SCCOL nSC, SCCOL nEC);
406     virtual                 ~ScTableColumnsObj();
407 
408     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
409 
410                             // XTableColumns
411     virtual void SAL_CALL   insertByIndex( sal_Int32 nIndex, sal_Int32 nCount );
412     virtual void SAL_CALL   removeByIndex( sal_Int32 nIndex, sal_Int32 nCount );
413 
414                             // XNameAccess
415     virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName );
416     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames();
417     virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName );
418 
419                             // XIndexAccess
420     virtual sal_Int32 SAL_CALL getCount();
421     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
422 
423                             // XEnumerationAccess
424     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
425                             createEnumeration();
426 
427                             // XElementAccess
428     virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
429     virtual sal_Bool SAL_CALL hasElements();
430 
431                             // XPropertySet
432     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
433                             SAL_CALL getPropertySetInfo();
434     virtual void SAL_CALL   setPropertyValue( const ::rtl::OUString& aPropertyName,
435                                     const ::com::sun::star::uno::Any& aValue );
436     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
437                                     const ::rtl::OUString& PropertyName );
438     virtual void SAL_CALL   addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
439                                     const ::com::sun::star::uno::Reference<
440                                         ::com::sun::star::beans::XPropertyChangeListener >& xListener );
441     virtual void SAL_CALL   removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
442                                     const ::com::sun::star::uno::Reference<
443                                         ::com::sun::star::beans::XPropertyChangeListener >& aListener );
444     virtual void SAL_CALL   addVetoableChangeListener( const ::rtl::OUString& PropertyName,
445                                     const ::com::sun::star::uno::Reference<
446                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener );
447     virtual void SAL_CALL   removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
448                                     const ::com::sun::star::uno::Reference<
449                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener );
450 
451                             // XServiceInfo
452     virtual ::rtl::OUString SAL_CALL getImplementationName();
453     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
454     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
455 };
456 
457 
458 class ScTableRowsObj : public cppu::WeakImplHelper4<
459                                 com::sun::star::table::XTableRows,
460                                 com::sun::star::container::XEnumerationAccess,
461                                 com::sun::star::beans::XPropertySet,
462                                 com::sun::star::lang::XServiceInfo>,
463                           public SfxListener
464 {
465 private:
466     ScDocShell*             pDocShell;
467     SCTAB                   nTab;
468     SCROW                   nStartRow;
469     SCROW                   nEndRow;
470 
471     ScTableRowObj*          GetObjectByIndex_Impl(sal_Int32 nIndex) const;
472 
473 public:
474                             ScTableRowsObj(ScDocShell* pDocSh, SCTAB nT,
475                                                 SCROW nSR, SCROW nER);
476     virtual                 ~ScTableRowsObj();
477 
478     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
479 
480                             // XTableRows
481     virtual void SAL_CALL   insertByIndex( sal_Int32 nIndex, sal_Int32 nCount );
482     virtual void SAL_CALL   removeByIndex( sal_Int32 nIndex, sal_Int32 nCount );
483 
484                             // XIndexAccess
485     virtual sal_Int32 SAL_CALL getCount();
486     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
487 
488                             // XEnumerationAccess
489     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
490                             createEnumeration();
491 
492                             // XElementAccess
493     virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
494     virtual sal_Bool SAL_CALL hasElements();
495 
496                             // XPropertySet
497     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
498                             SAL_CALL getPropertySetInfo();
499     virtual void SAL_CALL   setPropertyValue( const ::rtl::OUString& aPropertyName,
500                                     const ::com::sun::star::uno::Any& aValue );
501     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
502                                     const ::rtl::OUString& PropertyName );
503     virtual void SAL_CALL   addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
504                                     const ::com::sun::star::uno::Reference<
505                                         ::com::sun::star::beans::XPropertyChangeListener >& xListener );
506     virtual void SAL_CALL   removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
507                                     const ::com::sun::star::uno::Reference<
508                                         ::com::sun::star::beans::XPropertyChangeListener >& aListener );
509     virtual void SAL_CALL   addVetoableChangeListener( const ::rtl::OUString& PropertyName,
510                                     const ::com::sun::star::uno::Reference<
511                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener );
512     virtual void SAL_CALL   removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
513                                     const ::com::sun::star::uno::Reference<
514                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener );
515 
516                             // XServiceInfo
517     virtual ::rtl::OUString SAL_CALL getImplementationName();
518     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
519     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
520 };
521 
522 
523 class ScSpreadsheetSettingsObj : public cppu::WeakImplHelper2<
524                                     com::sun::star::beans::XPropertySet,
525                                     com::sun::star::lang::XServiceInfo>,
526                                  public SfxListener
527 {
528 private:
529     ScDocShell*             pDocShell;
530 
531 public:
532 //UNUSED2008-05             ScSpreadsheetSettingsObj(ScDocShell* pDocSh);
533     virtual                 ~ScSpreadsheetSettingsObj();
534 
535     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
536 
537                             // XPropertySet
538     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
539                             SAL_CALL getPropertySetInfo();
540     virtual void SAL_CALL   setPropertyValue( const ::rtl::OUString& aPropertyName,
541                                     const ::com::sun::star::uno::Any& aValue );
542     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
543                                     const ::rtl::OUString& PropertyName );
544     virtual void SAL_CALL   addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
545                                     const ::com::sun::star::uno::Reference<
546                                         ::com::sun::star::beans::XPropertyChangeListener >& xListener );
547     virtual void SAL_CALL   removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
548                                     const ::com::sun::star::uno::Reference<
549                                         ::com::sun::star::beans::XPropertyChangeListener >& aListener );
550     virtual void SAL_CALL   addVetoableChangeListener( const ::rtl::OUString& PropertyName,
551                                     const ::com::sun::star::uno::Reference<
552                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener );
553     virtual void SAL_CALL   removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
554                                     const ::com::sun::star::uno::Reference<
555                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener );
556 
557                             // XServiceInfo
558     virtual ::rtl::OUString SAL_CALL getImplementationName();
559     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
560     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
561 };
562 
563 
564 class ScAnnotationsObj : public cppu::WeakImplHelper3<
565                                 com::sun::star::sheet::XSheetAnnotations,
566                                 com::sun::star::container::XEnumerationAccess,
567                                 com::sun::star::lang::XServiceInfo>,
568                           public SfxListener
569 {
570 private:
571     ScDocShell*             pDocShell;
572     SCTAB                   nTab;           // Collection haengt am Sheet
573 
574     bool                    GetAddressByIndex_Impl( sal_Int32 nIndex, ScAddress& rPos ) const;
575     ScAnnotationObj*        GetObjectByIndex_Impl( sal_Int32 nIndex ) const;
576 
577 public:
578                             ScAnnotationsObj(ScDocShell* pDocSh, SCTAB nT);
579     virtual                 ~ScAnnotationsObj();
580 
581     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
582 
583                             // XSheetAnnotations
584     virtual void SAL_CALL   insertNew( const ::com::sun::star::table::CellAddress& aPosition,
585                                 const ::rtl::OUString& aText );
586     virtual void SAL_CALL   removeByIndex( sal_Int32 nIndex );
587 
588                             // XIndexAccess
589     virtual sal_Int32 SAL_CALL getCount();
590     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
591 
592                             // XEnumerationAccess
593     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
594                             createEnumeration();
595 
596                             // XElementAccess
597     virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
598     virtual sal_Bool SAL_CALL hasElements();
599 
600                             // XServiceInfo
601     virtual ::rtl::OUString SAL_CALL getImplementationName();
602     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
603     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
604 };
605 
606 
607 class ScScenariosObj : public cppu::WeakImplHelper4<
608                                 com::sun::star::sheet::XScenarios,
609                                 com::sun::star::container::XEnumerationAccess,
610                                 com::sun::star::container::XIndexAccess,
611                                 com::sun::star::lang::XServiceInfo>,
612                           public SfxListener
613 {
614 private:
615     ScDocShell*             pDocShell;
616     SCTAB                   nTab;
617 
618     sal_Bool                    GetScenarioIndex_Impl( const ::rtl::OUString& rName, SCTAB& rIndex );
619     ScTableSheetObj*        GetObjectByIndex_Impl(sal_Int32 nIndex);
620     ScTableSheetObj*        GetObjectByName_Impl(const ::rtl::OUString& aName);
621 
622 public:
623                             ScScenariosObj(ScDocShell* pDocSh, SCTAB nT);
624     virtual                 ~ScScenariosObj();
625 
626     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
627 
628                             // XScenarios
629     virtual void SAL_CALL   addNewByName( const ::rtl::OUString& aName,
630                                 const ::com::sun::star::uno::Sequence<
631                                     ::com::sun::star::table::CellRangeAddress >& aRanges,
632                                 const ::rtl::OUString& aComment );
633     virtual void SAL_CALL   removeByName( const ::rtl::OUString& aName );
634 
635                             // XNameAccess
636     virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName );
637     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames();
638     virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName );
639 
640                             // XIndexAccess
641     virtual sal_Int32 SAL_CALL getCount();
642     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
643 
644                             // XEnumerationAccess
645     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
646                             createEnumeration();
647 
648                             // XElementAccess
649     virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
650     virtual sal_Bool SAL_CALL hasElements();
651 
652                             // XServiceInfo
653     virtual ::rtl::OUString SAL_CALL getImplementationName();
654     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
655     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
656 };
657 
658 
659 
660 
661 #endif
662