nss: upgrade to release 3.73
[LibreOffice.git] / sc / inc / docuno.hxx
blob44fdc3463aede2bb3c908d038524ab66a0f04947
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_DOCUNO_HXX
21 #define INCLUDED_SC_INC_DOCUNO_HXX
23 #include "address.hxx"
25 #include <sal/types.h>
26 #include <sfx2/sfxbasemodel.hxx>
27 #include <svl/lstner.hxx>
28 #include <svx/fmdmod.hxx>
29 #include <com/sun/star/view/XRenderable.hpp>
30 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
31 #include <com/sun/star/document/XActionLockable.hpp>
32 #include <com/sun/star/document/XLinkTargetSupplier.hpp>
33 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
34 #include <com/sun/star/drawing/XDrawPages.hpp>
35 #include <com/sun/star/sheet/XGoalSeek.hpp>
36 #include <com/sun/star/sheet/XCalculatable.hpp>
37 #include <com/sun/star/sheet/XScenarios.hpp>
38 #include <com/sun/star/sheet/XConsolidatable.hpp>
39 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
40 #include <com/sun/star/sheet/XSpreadsheets2.hpp>
41 #include <com/sun/star/sheet/XDocumentAuditing.hpp>
42 #include <com/sun/star/chart2/XDataProviderAccess.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/sheet/opencl/XOpenCLSelection.hpp>
52 #include <com/sun/star/util/XChangesNotifier.hpp>
53 #include <com/sun/star/uno/XAggregation.hpp>
54 #include <cppuhelper/implbase.hxx>
55 #include <comphelper/interfacecontainer2.hxx>
56 #include <svl/itemprop.hxx>
57 #include <vcl/ITiledRenderable.hxx>
59 namespace com::sun::star::chart2::data { class XDataProvider; }
60 namespace com::sun::star::sheet::opencl { struct OpenCLPlatform; }
62 class ScDocShell;
63 class ScAnnotationObj;
64 class ScMarkData;
65 class ScPrintFuncCache;
66 struct ScPrintState;
67 class ScPrintSelectionStatus;
68 class ScTableColumnObj;
69 class ScTableRowObj;
70 class ScTableSheetObj;
71 class ScRangeList;
72 class ScPrintUIOptions;
73 class ScSheetSaveData;
74 struct ScFormatSaveData;
76 class SC_DLLPUBLIC ScModelObj : public SfxBaseModel,
77 public vcl::ITiledRenderable,
78 public css::sheet::XSpreadsheetDocument,
79 public css::document::XActionLockable,
80 public css::sheet::XCalculatable,
81 public css::util::XProtectable,
82 public css::drawing::XDrawPagesSupplier,
83 public css::sheet::XGoalSeek,
84 public css::sheet::XConsolidatable,
85 public css::sheet::XDocumentAuditing,
86 public css::style::XStyleFamiliesSupplier,
87 public css::view::XRenderable,
88 public css::document::XLinkTargetSupplier,
89 public css::beans::XPropertySet,
90 public SvxFmMSFactory, ///< derived from XMultiServiceFactory
91 public css::lang::XServiceInfo,
92 public css::util::XChangesNotifier,
93 public css::chart2::XDataProviderAccess,
94 public css::sheet::opencl::XOpenCLSelection
96 private:
97 SfxItemPropertySet aPropSet;
98 ScDocShell* pDocShell;
99 std::unique_ptr<ScPrintFuncCache> pPrintFuncCache;
100 std::unique_ptr<ScPrintUIOptions> pPrinterOptions;
101 std::unique_ptr<ScPrintState> m_pPrintState;
102 css::uno::Reference<css::uno::XAggregation> xNumberAgg;
103 css::uno::Reference<css::uno::XInterface> xDrawGradTab;
104 css::uno::Reference<css::uno::XInterface> xDrawHatchTab;
105 css::uno::Reference<css::uno::XInterface> xDrawBitmapTab;
106 css::uno::Reference<css::uno::XInterface> xDrawTrGradTab;
107 css::uno::Reference<css::uno::XInterface> xDrawMarkerTab;
108 css::uno::Reference<css::uno::XInterface> xDrawDashTab;
109 css::uno::Reference<css::uno::XInterface> xChartDataProv;
110 css::uno::Reference<css::uno::XInterface> xObjProvider;
112 ::comphelper::OInterfaceContainerHelper2 maChangesListeners;
114 bool FillRenderMarkData( const css::uno::Any& aSelection,
115 const css::uno::Sequence< css::beans::PropertyValue >& rOptions,
116 ScMarkData& rMark, ScPrintSelectionStatus& rStatus, OUString& rPagesStr,
117 bool& rbRenderToGraphic ) const;
118 css::uno::Reference<css::uno::XAggregation> const & GetFormatter();
119 void HandleCalculateEvents();
121 css::uno::Reference<css::uno::XInterface> create(
122 OUString const & aServiceSpecifier,
123 css::uno::Sequence<css::uno::Any> const * arguments);
125 static bool IsOnEvenPage( sal_Int32 nPage ) { return nPage % 2 == 0; };
127 OUString maBuildId;
128 std::vector<sal_Int32> maValidPages;
129 protected:
130 const SfxItemPropertySet& GetPropertySet() const { return aPropSet; }
132 /** abstract SdrModel provider */
133 virtual SdrModel& getSdrModelFromUnoModel() const override;
135 public:
136 ScModelObj(ScDocShell* pDocSh);
137 virtual ~ScModelObj() override;
139 /// create ScModelObj and set at pDocSh (SetBaseModel)
140 static void CreateAndSet(ScDocShell* pDocSh);
142 ScDocument* GetDocument() const;
143 SfxObjectShell* GetEmbeddedObject() const;
145 void UpdateAllRowHeights();
147 void BeforeXMLLoading();
148 void AfterXMLLoading();
149 ScSheetSaveData* GetSheetSaveData();
150 ScFormatSaveData* GetFormatSaveData();
152 void RepaintRange( const ScRange& rRange );
153 void RepaintRange( const ScRangeList& rRange );
155 bool HasChangesListeners() const;
157 void NotifyChanges( const OUString& rOperation, const ScRangeList& rRanges,
158 const css::uno::Sequence< css::beans::PropertyValue >& rProperties );
160 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
161 virtual void SAL_CALL acquire() throw() override;
162 virtual void SAL_CALL release() throw() override;
164 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
166 /// XSpreadsheetDocument
167 virtual css::uno::Reference< css::sheet::XSpreadsheets > SAL_CALL
168 getSheets() override;
170 /// XDataProviderAccess
171 virtual ::css::uno::Reference< css::chart2::data::XDataProvider > SAL_CALL
172 createDataProvider() override;
174 /// XStyleFamiliesSupplier
175 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
176 getStyleFamilies() override;
178 /// XRenderable
179 virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection,
180 const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
181 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
182 getRenderer( sal_Int32 nRenderer, const css::uno::Any& aSelection,
183 const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
184 virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& aSelection,
185 const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
187 /// XLinkTargetSupplier
188 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
189 getLinks() override;
191 /// XActionLockable
192 virtual sal_Bool SAL_CALL isActionLocked() override;
193 virtual void SAL_CALL addActionLock() override;
194 virtual void SAL_CALL removeActionLock() override;
195 virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) override;
196 virtual sal_Int16 SAL_CALL resetActionLocks() override;
198 virtual void SAL_CALL lockControllers() override;
199 virtual void SAL_CALL unlockControllers() override;
201 /// XCalculatable
202 virtual void SAL_CALL calculate() override;
203 virtual void SAL_CALL calculateAll() override;
204 virtual sal_Bool SAL_CALL isAutomaticCalculationEnabled() override;
205 virtual void SAL_CALL enableAutomaticCalculation( sal_Bool bEnabled ) override;
207 /// XProtectable
208 virtual void SAL_CALL protect( const OUString& aPassword ) override;
209 virtual void SAL_CALL unprotect( const OUString& aPassword ) override;
210 virtual sal_Bool SAL_CALL isProtected() override;
212 /// XDrawPagesSupplier
213 virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL
214 getDrawPages() override;
216 /// XGoalSeek
217 virtual css::sheet::GoalResult SAL_CALL seekGoal(
218 const css::table::CellAddress& aFormulaPosition,
219 const css::table::CellAddress& aVariablePosition,
220 const OUString& aGoalValue ) override;
222 /// XConsolidatable
223 virtual css::uno::Reference< css::sheet::XConsolidationDescriptor >
224 SAL_CALL createConsolidationDescriptor( sal_Bool bEmpty ) override;
225 virtual void SAL_CALL consolidate( const css::uno::Reference< css::sheet::XConsolidationDescriptor >& xDescriptor ) override;
227 /// XDocumentAuditing
228 virtual void SAL_CALL refreshArrows() override;
230 /// XViewDataSupplier
231 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getViewData( ) override;
233 /// XPropertySet
234 virtual css::uno::Reference< css::beans::XPropertySetInfo >
235 SAL_CALL getPropertySetInfo() override;
236 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
237 const css::uno::Any& aValue ) override;
238 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
239 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
240 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
241 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
242 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
243 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
244 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
245 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
246 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
248 /// XMultiServiceFactory
249 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
250 createInstance( const OUString& aServiceSpecifier ) override;
251 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
252 createInstanceWithArguments( const OUString& ServiceSpecifier,
253 const css::uno::Sequence< css::uno::Any >& Arguments ) override;
254 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override;
256 /// XServiceInfo
257 virtual OUString SAL_CALL getImplementationName() override;
258 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
259 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
261 /// XUnoTunnel
262 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
264 static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
266 /// XTypeProvider
267 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
268 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
270 /// XChangesNotifier
271 virtual void SAL_CALL addChangesListener( const css::uno::Reference< css::util::XChangesListener >& aListener ) override;
272 virtual void SAL_CALL removeChangesListener( const css::uno::Reference< css::util::XChangesListener >& aListener ) override;
274 // XOpenCLSelection
275 virtual sal_Bool SAL_CALL isOpenCLEnabled() override;
277 virtual void SAL_CALL enableOpenCL(sal_Bool bEnable) override;
279 virtual void SAL_CALL enableAutomaticDeviceSelection(sal_Bool bForce) override;
281 virtual void SAL_CALL disableAutomaticDeviceSelection() override;
283 virtual void SAL_CALL selectOpenCLDevice( sal_Int32 platform, sal_Int32 device ) override;
285 virtual sal_Int32 SAL_CALL getPlatformID() override;
287 virtual sal_Int32 SAL_CALL getDeviceID() override;
289 virtual css::uno::Sequence< css::sheet::opencl::OpenCLPlatform >
290 SAL_CALL getOpenCLPlatforms() override;
292 virtual void SAL_CALL enableOpcodeSubsetTest() override;
294 virtual void SAL_CALL disableOpcodeSubsetTest() override;
296 virtual sal_Bool SAL_CALL isOpcodeSubsetTested() override;
298 virtual void SAL_CALL setFormulaCellNumberLimit( sal_Int32 number ) override;
300 virtual sal_Int32 SAL_CALL getFormulaCellNumberLimit() override;
302 /// @see vcl::ITiledRenderable::paintTile().
303 virtual void paintTile( VirtualDevice& rDevice,
304 int nOutputWidth,
305 int nOutputHeight,
306 int nTilePosX,
307 int nTilePosY,
308 tools::Long nTileWidth,
309 tools::Long nTileHeight ) override;
311 /// @see vcl::ITiledRenderable::getDocumentSize().
312 virtual Size getDocumentSize() override;
314 /// @see vcl::ITiledRenderable::setPart().
315 virtual void setPart(int nPart) override;
317 /// @see vcl::ITiledRenderable::getPart().
318 virtual int getPart() override;
320 /// @see vcl::ITiledRenderable::getParts().
321 virtual int getParts() override;
323 /// @see vcl::ITiledRenderable::getPartInfo().
324 virtual OUString getPartInfo( int nPart ) override;
326 /// @see vcl::ITiledRenderable::getPartName().
327 virtual OUString getPartName(int nPart) override;
329 /// @see vcl::ITiledRenderable::getPartHash().
330 virtual OUString getPartHash( int nPart ) override;
332 /// @see vcl::ITiledRenderable::getDocWindow().
333 virtual VclPtr<vcl::Window> getDocWindow() override;
335 /// @see vcl::ITiledRenderable::initializeForTiledRendering().
336 virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override;
338 /// @see vcl::ITiledRenderable::postKeyEvent().
339 virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) override;
341 /// @see vcl::ITiledRenderable::postMouseEvent().
342 virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override;
344 /// @see vcl::ITiledRenderable::setTextSelection().
345 virtual void setTextSelection(int nType, int nX, int nY) override;
347 /// @see vcl::ITiledRenderable::getSelection().
348 virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override;
350 /// @see vcl::ITiledRenderable::setGraphicSelection().
351 virtual void setGraphicSelection(int nType, int nX, int nY) override;
353 /// @see lok::Document::resetSelection().
354 virtual void resetSelection() override;
356 /// @see vcl::ITiledRenderable::setClipboard().
357 virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) override;
359 /// @see vcl::ITiledRenderable::isMimeTypeSupported().
360 virtual bool isMimeTypeSupported() override;
362 /// @see vcl::ITiledRenderable::setClientZoom().
363 virtual void setClientZoom(int nTilePixelWidth, int nTilePixelHeight, int nTileTwipWidth, int nTileTwipHeight) override;
365 /// @see vcl::ITiledRenderable::setOutlineState().
366 virtual void setOutlineState(bool bColumn, int nLevel, int nIndex, bool bHidden) override;
368 /// @see vcl::ITiledRenderable::getRowColumnHeaders().
369 virtual void getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::JsonWriter& rJsonWriter) override;
371 /// @see vcl::ITiledRenderable::getSheetGeometryData().
372 virtual OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden,
373 bool bFiltered, bool bGroups) override;
375 /// @see vcl::ITiledRenderable::getCellCursor().
376 virtual void getCellCursor(tools::JsonWriter& rJsonWriter) override;
378 /// @see vcl::ITiledRenderable::getPointer().
379 virtual PointerStyle getPointer() override;
381 /// @see vcl::ITiledRenderable::getTrackedChanges().
382 void getTrackedChanges(tools::JsonWriter&) override;
384 /// @see vcl::ITiledRenderable::setClientVisibleArea().
385 virtual void setClientVisibleArea(const tools::Rectangle& rRectangle) override;
387 /// @see vcl::ITiledRenderable::getPostIts().
388 void getPostIts(tools::JsonWriter& rJsonWriter) override;
390 /// @see vcl::ITiledRenderable::getPostItsPos().
391 void getPostItsPos(tools::JsonWriter& rJsonWriter) override;
393 /// @see vcl::ITiledRenderable::completeFunction().
394 virtual void completeFunction(const OUString& rFunctionName) override;
397 class ScDrawPagesObj final : public cppu::WeakImplHelper<
398 css::drawing::XDrawPages,
399 css::lang::XServiceInfo>,
400 public SfxListener
402 private:
403 ScDocShell* pDocShell;
405 css::uno::Reference< css::drawing::XDrawPage >
406 GetObjectByIndex_Impl(sal_Int32 nIndex) const;
408 public:
409 ScDrawPagesObj(ScDocShell* pDocSh);
410 virtual ~ScDrawPagesObj() override;
412 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
414 /// XDrawPages
415 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
416 insertNewByIndex( sal_Int32 nIndex ) override;
417 virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XDrawPage >& xPage ) override;
419 /// XIndexAccess
420 virtual sal_Int32 SAL_CALL getCount() override;
421 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
423 /// XElementAccess
424 virtual css::uno::Type SAL_CALL getElementType() override;
425 virtual sal_Bool SAL_CALL hasElements() override;
427 /// XServiceInfo
428 virtual OUString SAL_CALL getImplementationName() override;
429 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
430 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
433 class ScTableSheetsObj final : public cppu::WeakImplHelper<
434 css::sheet::XSpreadsheets2,
435 css::sheet::XCellRangesAccess,
436 css::container::XEnumerationAccess,
437 css::container::XIndexAccess,
438 css::lang::XServiceInfo>,
439 public SfxListener
441 private:
442 ScDocShell* pDocShell;
444 ScTableSheetObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const;
445 ScTableSheetObj* GetObjectByName_Impl(const OUString& aName) const;
447 public:
448 ScTableSheetsObj(ScDocShell* pDocSh);
449 virtual ~ScTableSheetsObj() override;
451 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
453 /// XSpreadsheets
454 virtual void SAL_CALL insertNewByName( const OUString& aName, sal_Int16 nPosition ) override;
455 virtual void SAL_CALL moveByName( const OUString& aName, sal_Int16 nDestination ) override;
456 virtual void SAL_CALL copyByName( const OUString& aName,
457 const OUString& aCopy, sal_Int16 nDestination ) override;
459 /// XSpreadsheets2
460 virtual sal_Int32 SAL_CALL importSheet(
461 const css::uno::Reference< css::sheet::XSpreadsheetDocument > & xDocSrc,
462 const OUString& srcName,
463 sal_Int32 nDestPosition) override;
465 /// XCellRangesAccess
467 virtual css::uno::Reference< css::table::XCell >
468 SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet ) override;
470 virtual css::uno::Reference< css::table::XCellRange >
471 SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet ) override;
473 virtual css::uno::Sequence < css::uno::Reference< css::table::XCellRange > >
474 SAL_CALL getCellRangesByName( const OUString& aRange ) override;
476 /// XNameContainer
477 virtual void SAL_CALL insertByName( const OUString& aName,
478 const css::uno::Any& aElement ) override;
479 virtual void SAL_CALL removeByName( const OUString& Name ) override;
481 /// XNameReplace
482 virtual void SAL_CALL replaceByName( const OUString& aName,
483 const css::uno::Any& aElement ) override;
485 /// XEnumerationAccess
486 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
487 createEnumeration() override;
489 /// XElementAccess
490 virtual css::uno::Type SAL_CALL getElementType() override;
491 virtual sal_Bool SAL_CALL hasElements() override;
493 /// XIndexAccess
494 virtual sal_Int32 SAL_CALL getCount() override;
495 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
497 /// XNameAccess
498 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
499 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
500 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
502 /// XServiceInfo
503 virtual OUString SAL_CALL getImplementationName() override;
504 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
505 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
508 class ScTableColumnsObj final : public cppu::WeakImplHelper<
509 css::table::XTableColumns,
510 css::container::XEnumerationAccess,
511 css::container::XNameAccess,
512 css::beans::XPropertySet,
513 css::lang::XServiceInfo>,
514 public SfxListener
516 private:
517 ScDocShell* pDocShell;
518 SCTAB nTab;
519 SCCOL nStartCol;
520 SCCOL nEndCol;
522 ScTableColumnObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const;
523 ScTableColumnObj* GetObjectByName_Impl(const OUString& aName) const;
525 public:
526 ScTableColumnsObj(ScDocShell* pDocSh, SCTAB nT,
527 SCCOL nSC, SCCOL nEC);
528 virtual ~ScTableColumnsObj() override;
530 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
532 /// XTableColumns
533 virtual void SAL_CALL insertByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
534 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
536 /// XNameAccess
537 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
538 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
539 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
541 /// XIndexAccess
542 virtual sal_Int32 SAL_CALL getCount() override;
543 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
545 /// XEnumerationAccess
546 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
547 createEnumeration() override;
549 /// XElementAccess
550 virtual css::uno::Type SAL_CALL getElementType() override;
551 virtual sal_Bool SAL_CALL hasElements() override;
553 /// XPropertySet
554 virtual css::uno::Reference< css::beans::XPropertySetInfo >
555 SAL_CALL getPropertySetInfo() override;
556 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
557 const css::uno::Any& aValue ) override;
558 virtual css::uno::Any SAL_CALL getPropertyValue(
559 const OUString& PropertyName ) override;
560 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
561 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
562 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
563 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
564 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
565 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
566 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
567 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
569 /// XServiceInfo
570 virtual OUString SAL_CALL getImplementationName() override;
571 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
572 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
575 class ScTableRowsObj final : public cppu::WeakImplHelper<
576 css::table::XTableRows,
577 css::container::XEnumerationAccess,
578 css::beans::XPropertySet,
579 css::lang::XServiceInfo>,
580 public SfxListener
582 private:
583 ScDocShell* pDocShell;
584 SCTAB nTab;
585 SCROW nStartRow;
586 SCROW nEndRow;
588 ScTableRowObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const;
590 public:
591 ScTableRowsObj(ScDocShell* pDocSh, SCTAB nT,
592 SCROW nSR, SCROW nER);
593 virtual ~ScTableRowsObj() override;
595 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
597 /// XTableRows
598 virtual void SAL_CALL insertByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
599 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
601 /// XIndexAccess
602 virtual sal_Int32 SAL_CALL getCount() override;
603 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
605 /// XEnumerationAccess
606 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
607 createEnumeration() override;
609 /// XElementAccess
610 virtual css::uno::Type SAL_CALL getElementType() override;
611 virtual sal_Bool SAL_CALL hasElements() override;
613 /// XPropertySet
614 virtual css::uno::Reference< css::beans::XPropertySetInfo >
615 SAL_CALL getPropertySetInfo() override;
616 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
617 const css::uno::Any& aValue ) override;
618 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
619 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
620 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
621 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
622 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
623 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
624 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
625 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
626 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
628 /// XServiceInfo
629 virtual OUString SAL_CALL getImplementationName() override;
630 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
631 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
634 class ScSpreadsheetSettingsObj final : public cppu::WeakImplHelper<
635 css::beans::XPropertySet,
636 css::lang::XServiceInfo>,
637 public SfxListener
639 public:
640 virtual ~ScSpreadsheetSettingsObj() override;
642 /// XPropertySet
643 virtual css::uno::Reference< css::beans::XPropertySetInfo >
644 SAL_CALL getPropertySetInfo() override;
645 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
646 const css::uno::Any& aValue ) override;
647 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
648 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
649 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
650 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
651 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
652 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
653 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
654 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
655 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
657 /// XServiceInfo
658 virtual OUString SAL_CALL getImplementationName() override;
659 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
660 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
663 class SAL_DLLPUBLIC_RTTI ScAnnotationsObj final : public cppu::WeakImplHelper<
664 css::sheet::XSheetAnnotations,
665 css::container::XEnumerationAccess,
666 css::lang::XServiceInfo>,
667 public SfxListener
669 private:
670 ScDocShell* pDocShell;
671 SCTAB nTab; ///< Collection belongs to the sheet
673 bool GetAddressByIndex_Impl( sal_Int32 nIndex, ScAddress& rPos ) const;
674 ScAnnotationObj* GetObjectByIndex_Impl( sal_Int32 nIndex ) const;
676 public:
677 ScAnnotationsObj(ScDocShell* pDocSh, SCTAB nT);
678 virtual ~ScAnnotationsObj() override;
680 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
682 ScDocShell* GetDocShell() const { return pDocShell; }
684 /// XSheetAnnotations
685 virtual void SAL_CALL insertNew( const css::table::CellAddress& aPosition,
686 const OUString& aText ) override;
687 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex ) override;
689 /// XIndexAccess
690 virtual sal_Int32 SAL_CALL getCount() override;
691 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
693 /// XEnumerationAccess
694 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
695 createEnumeration() override;
697 /// XElementAccess
698 virtual css::uno::Type SAL_CALL getElementType() override;
699 virtual sal_Bool SAL_CALL hasElements() override;
701 /// XServiceInfo
702 virtual OUString SAL_CALL getImplementationName() override;
703 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
704 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
707 class ScScenariosObj final : public cppu::WeakImplHelper<
708 css::sheet::XScenarios,
709 css::container::XEnumerationAccess,
710 css::container::XIndexAccess,
711 css::lang::XServiceInfo>,
712 public SfxListener
714 private:
715 ScDocShell* pDocShell;
716 SCTAB nTab;
718 bool GetScenarioIndex_Impl( const OUString& rName, SCTAB& rIndex );
719 ScTableSheetObj* GetObjectByIndex_Impl(sal_Int32 nIndex);
720 ScTableSheetObj* GetObjectByName_Impl(const OUString& aName);
722 public:
723 ScScenariosObj(ScDocShell* pDocSh, SCTAB nT);
724 virtual ~ScScenariosObj() override;
726 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
728 /// XScenarios
729 virtual void SAL_CALL addNewByName( const OUString& aName,
730 const css::uno::Sequence< css::table::CellRangeAddress >& aRanges,
731 const OUString& aComment ) override;
732 virtual void SAL_CALL removeByName( const OUString& aName ) override;
734 /// XNameAccess
735 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
736 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
737 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
739 /// XIndexAccess
740 virtual sal_Int32 SAL_CALL getCount() override;
741 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
743 /// XEnumerationAccess
744 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
745 createEnumeration() override;
747 /// XElementAccess
748 virtual css::uno::Type SAL_CALL getElementType() override;
749 virtual sal_Bool SAL_CALL hasElements() override;
751 /// XServiceInfo
752 virtual OUString SAL_CALL getImplementationName() override;
753 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
754 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
757 #endif
759 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */