bump product version to 7.6.3.2-android
[LibreOffice.git] / sc / inc / docuno.hxx
blob23de1dad63cef47121ed7d5129fa9627c1709525
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 #pragma once
22 #include "address.hxx"
24 #include <sal/types.h>
25 #include <sfx2/sfxbasemodel.hxx>
26 #include <svl/lstner.hxx>
27 #include <svx/fmdmod.hxx>
28 #include <com/sun/star/view/XRenderable.hpp>
29 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
30 #include <com/sun/star/document/XActionLockable.hpp>
31 #include <com/sun/star/document/XLinkTargetSupplier.hpp>
32 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
33 #include <com/sun/star/drawing/XDrawPages.hpp>
34 #include <com/sun/star/sheet/XGoalSeek.hpp>
35 #include <com/sun/star/sheet/XCalculatable.hpp>
36 #include <com/sun/star/sheet/XScenarios.hpp>
37 #include <com/sun/star/sheet/XConsolidatable.hpp>
38 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
39 #include <com/sun/star/sheet/XSpreadsheets2.hpp>
40 #include <com/sun/star/sheet/XDocumentAuditing.hpp>
41 #include <com/sun/star/chart2/XDataProviderAccess.hpp>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/util/XProtectable.hpp>
44 #include <com/sun/star/container/XEnumerationAccess.hpp>
45 #include <com/sun/star/table/XTableColumns.hpp>
46 #include <com/sun/star/table/XTableRows.hpp>
47 #include <com/sun/star/sheet/XSheetAnnotations.hpp>
48 #include <com/sun/star/beans/XPropertySet.hpp>
49 #include <com/sun/star/sheet/XCellRangesAccess.hpp>
50 #include <com/sun/star/sheet/opencl/XOpenCLSelection.hpp>
51 #include <com/sun/star/util/XChangesNotifier.hpp>
52 #include <com/sun/star/uno/XAggregation.hpp>
53 #include <cppuhelper/implbase.hxx>
54 #include <comphelper/interfacecontainer3.hxx>
55 #include <svl/itemprop.hxx>
56 #include <vcl/ITiledRenderable.hxx>
58 namespace com::sun::star::chart2::data { class XDataProvider; }
59 namespace com::sun::star::sheet::opencl { struct OpenCLPlatform; }
61 class ScDocShell;
62 class ScAnnotationObj;
63 class ScMarkData;
64 class ScPrintFuncCache;
65 struct ScPrintState;
66 class ScPrintSelectionStatus;
67 class ScTableColumnObj;
68 class ScTableRowObj;
69 class ScTableSheetObj;
70 class ScRangeList;
71 class ScPrintUIOptions;
72 class ScSheetSaveData;
73 struct ScFormatSaveData;
75 class SC_DLLPUBLIC ScModelObj : public SfxBaseModel,
76 public vcl::ITiledRenderable,
77 public css::sheet::XSpreadsheetDocument,
78 public css::document::XActionLockable,
79 public css::sheet::XCalculatable,
80 public css::util::XProtectable,
81 public css::drawing::XDrawPagesSupplier,
82 public css::sheet::XGoalSeek,
83 public css::sheet::XConsolidatable,
84 public css::sheet::XDocumentAuditing,
85 public css::style::XStyleFamiliesSupplier,
86 public css::view::XRenderable,
87 public css::document::XLinkTargetSupplier,
88 public css::beans::XPropertySet,
89 public SvxFmMSFactory, ///< derived from XMultiServiceFactory
90 public css::lang::XServiceInfo,
91 public css::util::XChangesNotifier,
92 public css::chart2::XDataProviderAccess,
93 public css::sheet::opencl::XOpenCLSelection
95 private:
96 SfxItemPropertySet aPropSet;
97 ScDocShell* pDocShell;
98 std::unique_ptr<ScPrintFuncCache> pPrintFuncCache;
99 std::unique_ptr<ScPrintUIOptions> pPrinterOptions;
100 std::unique_ptr<ScPrintState> m_pPrintState;
101 css::uno::Reference<css::uno::XAggregation> xNumberAgg;
102 css::uno::Reference<css::uno::XInterface> xDrawGradTab;
103 css::uno::Reference<css::uno::XInterface> xDrawHatchTab;
104 css::uno::Reference<css::uno::XInterface> xDrawBitmapTab;
105 css::uno::Reference<css::uno::XInterface> xDrawTrGradTab;
106 css::uno::Reference<css::uno::XInterface> xDrawMarkerTab;
107 css::uno::Reference<css::uno::XInterface> xDrawDashTab;
108 css::uno::Reference<css::uno::XInterface> xChartDataProv;
109 css::uno::Reference<css::uno::XInterface> xObjProvider;
111 ::comphelper::OInterfaceContainerHelper3<css::util::XChangesListener> maChangesListeners;
113 bool FillRenderMarkData( const css::uno::Any& aSelection,
114 const css::uno::Sequence< css::beans::PropertyValue >& rOptions,
115 ScMarkData& rMark, ScPrintSelectionStatus& rStatus, OUString& rPagesStr,
116 bool& rbRenderToGraphic ) const;
117 css::uno::Reference<css::uno::XAggregation> const & GetFormatter();
118 void HandleCalculateEvents();
120 css::uno::Reference<css::uno::XInterface> create(
121 OUString const & aServiceSpecifier,
122 css::uno::Sequence<css::uno::Any> const * arguments);
124 static bool IsOnEvenPage( sal_Int32 nPage ) { return nPage % 2 == 0; };
126 OUString maBuildId;
127 std::vector<sal_Int32> maValidPages;
128 protected:
129 const SfxItemPropertySet& GetPropertySet() const { return aPropSet; }
131 /** abstract SdrModel provider */
132 virtual SdrModel& getSdrModelFromUnoModel() const override;
134 public:
135 ScModelObj(ScDocShell* pDocSh);
136 virtual ~ScModelObj() override;
138 /// create ScModelObj and set at pDocSh (SetBaseModel)
139 static void CreateAndSet(ScDocShell* pDocSh);
141 ScDocument* GetDocument() const;
142 SfxObjectShell* GetEmbeddedObject() const;
144 void UpdateAllRowHeights();
146 void BeforeXMLLoading();
147 void AfterXMLLoading();
148 ScSheetSaveData* GetSheetSaveData();
149 ScFormatSaveData* GetFormatSaveData();
151 void RepaintRange( const ScRange& rRange );
152 void RepaintRange( const ScRangeList& rRange );
154 bool HasChangesListeners() const;
156 void NotifyChanges( const OUString& rOperation, const ScRangeList& rRanges,
157 const css::uno::Sequence< css::beans::PropertyValue >& rProperties );
159 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
160 virtual void SAL_CALL acquire() noexcept override;
161 virtual void SAL_CALL release() noexcept override;
163 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
165 /// XSpreadsheetDocument
166 virtual css::uno::Reference< css::sheet::XSpreadsheets > SAL_CALL
167 getSheets() override;
169 /// XDataProviderAccess
170 virtual ::css::uno::Reference< css::chart2::data::XDataProvider > SAL_CALL
171 createDataProvider() override;
173 /// XStyleFamiliesSupplier
174 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
175 getStyleFamilies() override;
177 /// XRenderable
178 virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection,
179 const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
180 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
181 getRenderer( sal_Int32 nRenderer, const css::uno::Any& aSelection,
182 const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
183 virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& aSelection,
184 const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) override;
186 /// XLinkTargetSupplier
187 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
188 getLinks() override;
190 /// XActionLockable
191 virtual sal_Bool SAL_CALL isActionLocked() override;
192 virtual void SAL_CALL addActionLock() override;
193 virtual void SAL_CALL removeActionLock() override;
194 virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) override;
195 virtual sal_Int16 SAL_CALL resetActionLocks() override;
197 virtual void SAL_CALL lockControllers() override;
198 virtual void SAL_CALL unlockControllers() override;
200 /// XCalculatable
201 virtual void SAL_CALL calculate() override;
202 virtual void SAL_CALL calculateAll() override;
203 virtual sal_Bool SAL_CALL isAutomaticCalculationEnabled() override;
204 virtual void SAL_CALL enableAutomaticCalculation( sal_Bool bEnabled ) override;
206 /// XProtectable
207 virtual void SAL_CALL protect( const OUString& aPassword ) override;
208 virtual void SAL_CALL unprotect( const OUString& aPassword ) override;
209 virtual sal_Bool SAL_CALL isProtected() override;
211 /// XDrawPagesSupplier
212 virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL
213 getDrawPages() override;
215 /// XGoalSeek
216 virtual css::sheet::GoalResult SAL_CALL seekGoal(
217 const css::table::CellAddress& aFormulaPosition,
218 const css::table::CellAddress& aVariablePosition,
219 const OUString& aGoalValue ) override;
221 /// XConsolidatable
222 virtual css::uno::Reference< css::sheet::XConsolidationDescriptor >
223 SAL_CALL createConsolidationDescriptor( sal_Bool bEmpty ) override;
224 virtual void SAL_CALL consolidate( const css::uno::Reference< css::sheet::XConsolidationDescriptor >& xDescriptor ) override;
226 /// XDocumentAuditing
227 virtual void SAL_CALL refreshArrows() override;
229 /// XViewDataSupplier
230 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getViewData( ) override;
232 /// XPropertySet
233 virtual css::uno::Reference< css::beans::XPropertySetInfo >
234 SAL_CALL getPropertySetInfo() override;
235 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
236 const css::uno::Any& aValue ) override;
237 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
238 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
239 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
240 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
241 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
242 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
243 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
244 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
245 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
247 /// XMultiServiceFactory
248 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
249 createInstance( const OUString& aServiceSpecifier ) override;
250 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
251 createInstanceWithArguments( const OUString& ServiceSpecifier,
252 const css::uno::Sequence< css::uno::Any >& Arguments ) override;
253 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override;
255 /// XServiceInfo
256 virtual OUString SAL_CALL getImplementationName() override;
257 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
258 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
260 /// XUnoTunnel
261 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
263 static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
265 /// XTypeProvider
266 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
267 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
269 /// XChangesNotifier
270 virtual void SAL_CALL addChangesListener( const css::uno::Reference< css::util::XChangesListener >& aListener ) override;
271 virtual void SAL_CALL removeChangesListener( const css::uno::Reference< css::util::XChangesListener >& aListener ) override;
273 // XOpenCLSelection
274 virtual sal_Bool SAL_CALL isOpenCLEnabled() override;
276 virtual void SAL_CALL enableOpenCL(sal_Bool bEnable) override;
278 virtual void SAL_CALL enableAutomaticDeviceSelection(sal_Bool bForce) override;
280 virtual void SAL_CALL disableAutomaticDeviceSelection() override;
282 virtual void SAL_CALL selectOpenCLDevice( sal_Int32 platform, sal_Int32 device ) override;
284 virtual sal_Int32 SAL_CALL getPlatformID() override;
286 virtual sal_Int32 SAL_CALL getDeviceID() override;
288 virtual css::uno::Sequence< css::sheet::opencl::OpenCLPlatform >
289 SAL_CALL getOpenCLPlatforms() override;
291 virtual void SAL_CALL enableOpcodeSubsetTest() override;
293 virtual void SAL_CALL disableOpcodeSubsetTest() override;
295 virtual sal_Bool SAL_CALL isOpcodeSubsetTested() override;
297 virtual void SAL_CALL setFormulaCellNumberLimit( sal_Int32 number ) override;
299 virtual sal_Int32 SAL_CALL getFormulaCellNumberLimit() override;
301 /// @see vcl::ITiledRenderable::paintTile().
302 virtual void paintTile( VirtualDevice& rDevice,
303 int nOutputWidth,
304 int nOutputHeight,
305 int nTilePosX,
306 int nTilePosY,
307 tools::Long nTileWidth,
308 tools::Long nTileHeight ) override;
310 /// @see vcl::ITiledRenderable::getDocumentSize().
311 virtual Size getDocumentSize() override;
313 /// @see vcl::ITiledRenderable::getDataArea().
314 virtual Size getDataArea(long nPart) override;
316 /// @see vcl::ITiledRenderable::setPart().
317 virtual void setPart(int nPart, bool bAllowChangeFocus = true) override;
319 /// @see vcl::ITiledRenderable::getPart().
320 virtual int getPart() override;
322 /// @see vcl::ITiledRenderable::getParts().
323 virtual int getParts() override;
325 /// @see vcl::ITiledRenderable::getPartInfo().
326 virtual OUString getPartInfo( int nPart ) override;
328 /// @see vcl::ITiledRenderable::getPartName().
329 virtual OUString getPartName(int nPart) override;
331 /// @see vcl::ITiledRenderable::getPartHash().
332 virtual OUString getPartHash( int nPart ) override;
334 /// @see vcl::ITiledRenderable::getDocWindow().
335 virtual VclPtr<vcl::Window> getDocWindow() override;
337 /// @see vcl::ITiledRenderable::initializeForTiledRendering().
338 virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override;
340 /// @see vcl::ITiledRenderable::postKeyEvent().
341 virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) override;
343 /// @see vcl::ITiledRenderable::postMouseEvent().
344 virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override;
346 /// @see vcl::ITiledRenderable::setTextSelection().
347 virtual void setTextSelection(int nType, int nX, int nY) override;
349 /// @see vcl::ITiledRenderable::getSelection().
350 virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override;
352 /// @see vcl::ITiledRenderable::setGraphicSelection().
353 virtual void setGraphicSelection(int nType, int nX, int nY) override;
355 /// @see lok::Document::resetSelection().
356 virtual void resetSelection() override;
358 /// @see vcl::ITiledRenderable::setClipboard().
359 virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) override;
361 /// @see vcl::ITiledRenderable::isMimeTypeSupported().
362 virtual bool isMimeTypeSupported() override;
364 /// @see vcl::ITiledRenderable::setClientZoom().
365 virtual void setClientZoom(int nTilePixelWidth, int nTilePixelHeight, int nTileTwipWidth, int nTileTwipHeight) override;
367 /// @see vcl::ITiledRenderable::setOutlineState().
368 virtual void setOutlineState(bool bColumn, int nLevel, int nIndex, bool bHidden) override;
370 /// @see vcl::ITiledRenderable::getRowColumnHeaders().
371 virtual void getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::JsonWriter& rJsonWriter) override;
373 /// @see vcl::ITiledRenderable::getSheetGeometryData().
374 virtual OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden,
375 bool bFiltered, bool bGroups) override;
377 /// @see vcl::ITiledRenderable::getCellCursor().
378 virtual void getCellCursor(tools::JsonWriter& rJsonWriter) override;
380 /// @see vcl::ITiledRenderable::getPointer().
381 virtual PointerStyle getPointer() override;
383 /// @see vcl::ITiledRenderable::getTrackedChanges().
384 void getTrackedChanges(tools::JsonWriter&) override;
386 /// @see vcl::ITiledRenderable::setClientVisibleArea().
387 virtual void setClientVisibleArea(const tools::Rectangle& rRectangle) override;
389 /// @see vcl::ITiledRenderable::getPostIts().
390 void getPostIts(tools::JsonWriter& rJsonWriter) override;
392 /// @see vcl::ITiledRenderable::getPostItsPos().
393 void getPostItsPos(tools::JsonWriter& rJsonWriter) override;
395 /// @see vcl::ITiledRenderable::completeFunction().
396 virtual void completeFunction(const OUString& rFunctionName) override;
398 /// @see vcl::ITiledRenderable::getViewRenderState().
399 OString getViewRenderState() override;
402 class ScDrawPagesObj final : public cppu::WeakImplHelper<
403 css::drawing::XDrawPages,
404 css::lang::XServiceInfo>,
405 public SfxListener
407 private:
408 ScDocShell* pDocShell;
410 css::uno::Reference< css::drawing::XDrawPage >
411 GetObjectByIndex_Impl(sal_Int32 nIndex) const;
413 public:
414 ScDrawPagesObj(ScDocShell* pDocSh);
415 virtual ~ScDrawPagesObj() override;
417 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
419 /// XDrawPages
420 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
421 insertNewByIndex( sal_Int32 nIndex ) override;
422 virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XDrawPage >& xPage ) override;
424 /// XIndexAccess
425 virtual sal_Int32 SAL_CALL getCount() override;
426 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
428 /// XElementAccess
429 virtual css::uno::Type SAL_CALL getElementType() override;
430 virtual sal_Bool SAL_CALL hasElements() override;
432 /// XServiceInfo
433 virtual OUString SAL_CALL getImplementationName() override;
434 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
435 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
438 class ScTableSheetsObj final : public cppu::WeakImplHelper<
439 css::sheet::XSpreadsheets2,
440 css::sheet::XCellRangesAccess,
441 css::container::XEnumerationAccess,
442 css::container::XIndexAccess,
443 css::lang::XServiceInfo>,
444 public SfxListener
446 private:
447 ScDocShell* pDocShell;
449 rtl::Reference<ScTableSheetObj> GetObjectByIndex_Impl(sal_Int32 nIndex) const;
450 rtl::Reference<ScTableSheetObj> GetObjectByName_Impl(const OUString& aName) const;
452 public:
453 ScTableSheetsObj(ScDocShell* pDocSh);
454 virtual ~ScTableSheetsObj() override;
456 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
458 /// XSpreadsheets
459 virtual void SAL_CALL insertNewByName( const OUString& aName, sal_Int16 nPosition ) override;
460 virtual void SAL_CALL moveByName( const OUString& aName, sal_Int16 nDestination ) override;
461 virtual void SAL_CALL copyByName( const OUString& aName,
462 const OUString& aCopy, sal_Int16 nDestination ) override;
464 /// XSpreadsheets2
465 virtual sal_Int32 SAL_CALL importSheet(
466 const css::uno::Reference< css::sheet::XSpreadsheetDocument > & xDocSrc,
467 const OUString& srcName,
468 sal_Int32 nDestPosition) override;
470 /// XCellRangesAccess
472 virtual css::uno::Reference< css::table::XCell >
473 SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet ) override;
475 virtual css::uno::Reference< css::table::XCellRange >
476 SAL_CALL getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet ) override;
478 virtual css::uno::Sequence < css::uno::Reference< css::table::XCellRange > >
479 SAL_CALL getCellRangesByName( const OUString& aRange ) override;
481 /// XNameContainer
482 virtual void SAL_CALL insertByName( const OUString& aName,
483 const css::uno::Any& aElement ) override;
484 virtual void SAL_CALL removeByName( const OUString& Name ) override;
486 /// XNameReplace
487 virtual void SAL_CALL replaceByName( const OUString& aName,
488 const css::uno::Any& aElement ) override;
490 /// XEnumerationAccess
491 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
492 createEnumeration() override;
494 /// XElementAccess
495 virtual css::uno::Type SAL_CALL getElementType() override;
496 virtual sal_Bool SAL_CALL hasElements() override;
498 /// XIndexAccess
499 virtual sal_Int32 SAL_CALL getCount() override;
500 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
502 /// XNameAccess
503 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
504 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
505 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
507 /// XServiceInfo
508 virtual OUString SAL_CALL getImplementationName() override;
509 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
510 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
513 class ScTableColumnsObj final : public cppu::WeakImplHelper<
514 css::table::XTableColumns,
515 css::container::XEnumerationAccess,
516 css::container::XNameAccess,
517 css::beans::XPropertySet,
518 css::lang::XServiceInfo>,
519 public SfxListener
521 private:
522 ScDocShell* pDocShell;
523 SCTAB nTab;
524 SCCOL nStartCol;
525 SCCOL nEndCol;
527 rtl::Reference<ScTableColumnObj> GetObjectByIndex_Impl(sal_Int32 nIndex) const;
528 rtl::Reference<ScTableColumnObj> GetObjectByName_Impl(std::u16string_view aName) const;
530 public:
531 ScTableColumnsObj(ScDocShell* pDocSh, SCTAB nT,
532 SCCOL nSC, SCCOL nEC);
533 virtual ~ScTableColumnsObj() override;
535 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
537 /// XTableColumns
538 virtual void SAL_CALL insertByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
539 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
541 /// XNameAccess
542 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
543 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
544 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
546 /// XIndexAccess
547 virtual sal_Int32 SAL_CALL getCount() override;
548 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
550 /// XEnumerationAccess
551 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
552 createEnumeration() override;
554 /// XElementAccess
555 virtual css::uno::Type SAL_CALL getElementType() override;
556 virtual sal_Bool SAL_CALL hasElements() override;
558 /// XPropertySet
559 virtual css::uno::Reference< css::beans::XPropertySetInfo >
560 SAL_CALL getPropertySetInfo() override;
561 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
562 const css::uno::Any& aValue ) override;
563 virtual css::uno::Any SAL_CALL getPropertyValue(
564 const OUString& PropertyName ) override;
565 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
566 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
567 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
568 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
569 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
570 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
571 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
572 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
574 /// XServiceInfo
575 virtual OUString SAL_CALL getImplementationName() override;
576 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
577 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
580 class ScTableRowsObj final : public cppu::WeakImplHelper<
581 css::table::XTableRows,
582 css::container::XEnumerationAccess,
583 css::beans::XPropertySet,
584 css::lang::XServiceInfo>,
585 public SfxListener
587 private:
588 ScDocShell* pDocShell;
589 SCTAB nTab;
590 SCROW nStartRow;
591 SCROW nEndRow;
593 rtl::Reference<ScTableRowObj> GetObjectByIndex_Impl(sal_Int32 nIndex) const;
595 public:
596 ScTableRowsObj(ScDocShell* pDocSh, SCTAB nT,
597 SCROW nSR, SCROW nER);
598 virtual ~ScTableRowsObj() override;
600 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
602 /// XTableRows
603 virtual void SAL_CALL insertByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
604 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex, sal_Int32 nCount ) override;
606 /// XIndexAccess
607 virtual sal_Int32 SAL_CALL getCount() override;
608 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
610 /// XEnumerationAccess
611 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
612 createEnumeration() override;
614 /// XElementAccess
615 virtual css::uno::Type SAL_CALL getElementType() override;
616 virtual sal_Bool SAL_CALL hasElements() override;
618 /// XPropertySet
619 virtual css::uno::Reference< css::beans::XPropertySetInfo >
620 SAL_CALL getPropertySetInfo() override;
621 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
622 const css::uno::Any& aValue ) override;
623 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
624 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
625 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
626 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
627 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
628 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
629 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
630 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
631 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
633 /// XServiceInfo
634 virtual OUString SAL_CALL getImplementationName() override;
635 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
636 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
639 class ScSpreadsheetSettingsObj final : public cppu::WeakImplHelper<
640 css::beans::XPropertySet,
641 css::lang::XServiceInfo>,
642 public SfxListener
644 public:
645 virtual ~ScSpreadsheetSettingsObj() override;
647 /// XPropertySet
648 virtual css::uno::Reference< css::beans::XPropertySetInfo >
649 SAL_CALL getPropertySetInfo() override;
650 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
651 const css::uno::Any& aValue ) override;
652 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
653 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
654 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
655 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
656 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
657 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
658 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
659 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
660 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
662 /// XServiceInfo
663 virtual OUString SAL_CALL getImplementationName() override;
664 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
665 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
668 class SAL_DLLPUBLIC_RTTI ScAnnotationsObj final : public cppu::WeakImplHelper<
669 css::sheet::XSheetAnnotations,
670 css::container::XEnumerationAccess,
671 css::lang::XServiceInfo>,
672 public SfxListener
674 private:
675 ScDocShell* pDocShell;
676 SCTAB nTab; ///< Collection belongs to the sheet
678 bool GetAddressByIndex_Impl( sal_Int32 nIndex, ScAddress& rPos ) const;
679 rtl::Reference<ScAnnotationObj> GetObjectByIndex_Impl( sal_Int32 nIndex ) const;
681 public:
682 ScAnnotationsObj(ScDocShell* pDocSh, SCTAB nT);
683 virtual ~ScAnnotationsObj() override;
685 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
687 ScDocShell* GetDocShell() const { return pDocShell; }
689 /// XSheetAnnotations
690 virtual void SAL_CALL insertNew( const css::table::CellAddress& aPosition,
691 const OUString& aText ) override;
692 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex ) override;
694 /// XIndexAccess
695 virtual sal_Int32 SAL_CALL getCount() override;
696 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
698 /// XEnumerationAccess
699 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
700 createEnumeration() override;
702 /// XElementAccess
703 virtual css::uno::Type SAL_CALL getElementType() override;
704 virtual sal_Bool SAL_CALL hasElements() override;
706 /// XServiceInfo
707 virtual OUString SAL_CALL getImplementationName() override;
708 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
709 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
712 class ScScenariosObj final : public cppu::WeakImplHelper<
713 css::sheet::XScenarios,
714 css::container::XEnumerationAccess,
715 css::container::XIndexAccess,
716 css::lang::XServiceInfo>,
717 public SfxListener
719 private:
720 ScDocShell* pDocShell;
721 SCTAB nTab;
723 bool GetScenarioIndex_Impl( std::u16string_view rName, SCTAB& rIndex );
724 rtl::Reference<ScTableSheetObj> GetObjectByIndex_Impl(sal_Int32 nIndex);
725 rtl::Reference<ScTableSheetObj> GetObjectByName_Impl(std::u16string_view aName);
727 public:
728 ScScenariosObj(ScDocShell* pDocSh, SCTAB nT);
729 virtual ~ScScenariosObj() override;
731 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
733 /// XScenarios
734 virtual void SAL_CALL addNewByName( const OUString& aName,
735 const css::uno::Sequence< css::table::CellRangeAddress >& aRanges,
736 const OUString& aComment ) override;
737 virtual void SAL_CALL removeByName( const OUString& aName ) override;
739 /// XNameAccess
740 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
741 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
742 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
744 /// XIndexAccess
745 virtual sal_Int32 SAL_CALL getCount() override;
746 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
748 /// XEnumerationAccess
749 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
750 createEnumeration() override;
752 /// XElementAccess
753 virtual css::uno::Type SAL_CALL getElementType() override;
754 virtual sal_Bool SAL_CALL hasElements() override;
756 /// XServiceInfo
757 virtual OUString SAL_CALL getImplementationName() override;
758 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
759 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
762 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */