1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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"
24 #include <sfx2/sfxbasemodel.hxx>
25 #include <svl/lstner.hxx>
26 #include <svx/fmdmod.hxx>
27 #include <com/sun/star/view/XRenderable.hpp>
28 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
29 #include <com/sun/star/document/XActionLockable.hpp>
30 #include <com/sun/star/document/XLinkTargetSupplier.hpp>
31 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
32 #include <com/sun/star/drawing/XDrawPages.hpp>
33 #include <com/sun/star/sheet/XGoalSeek.hpp>
34 #include <com/sun/star/sheet/XCalculatable.hpp>
35 #include <com/sun/star/sheet/XScenarios.hpp>
36 #include <com/sun/star/sheet/XConsolidatable.hpp>
37 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
38 #include <com/sun/star/sheet/XSpreadsheets2.hpp>
39 #include <com/sun/star/sheet/XDocumentAuditing.hpp>
40 #include <com/sun/star/chart2/XDataProviderAccess.hpp>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <com/sun/star/util/XProtectable.hpp>
43 #include <com/sun/star/container/XEnumerationAccess.hpp>
44 #include <com/sun/star/table/XTableColumns.hpp>
45 #include <com/sun/star/table/XTableRows.hpp>
46 #include <com/sun/star/sheet/XSheetAnnotations.hpp>
47 #include <com/sun/star/beans/XPropertySet.hpp>
48 #include <com/sun/star/sheet/XCellRangesAccess.hpp>
49 #include <com/sun/star/sheet/opencl/XOpenCLSelection.hpp>
50 #include <com/sun/star/util/XChangesNotifier.hpp>
51 #include <com/sun/star/uno/XAggregation.hpp>
52 #include <cppuhelper/implbase.hxx>
53 #include <comphelper/interfacecontainer2.hxx>
54 #include <svl/itemprop.hxx>
55 #include <vcl/ITiledRenderable.hxx>
57 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ namespace data
{ class XDataProvider
; } } } } }
58 namespace com
{ namespace sun
{ namespace star
{ namespace sheet
{ namespace opencl
{ struct OpenCLPlatform
; } } } } }
61 class ScAnnotationObj
;
63 class ScPrintFuncCache
;
65 class ScPrintSelectionStatus
;
66 class ScTableColumnObj
;
68 class ScTableSheetObj
;
70 class ScPrintUIOptions
;
71 class ScSheetSaveData
;
72 struct ScFormatSaveData
;
74 class SC_DLLPUBLIC ScModelObj
: public SfxBaseModel
,
75 public vcl::ITiledRenderable
,
76 public css::sheet::XSpreadsheetDocument
,
77 public css::document::XActionLockable
,
78 public css::sheet::XCalculatable
,
79 public css::util::XProtectable
,
80 public css::drawing::XDrawPagesSupplier
,
81 public css::sheet::XGoalSeek
,
82 public css::sheet::XConsolidatable
,
83 public css::sheet::XDocumentAuditing
,
84 public css::style::XStyleFamiliesSupplier
,
85 public css::view::XRenderable
,
86 public css::document::XLinkTargetSupplier
,
87 public css::beans::XPropertySet
,
88 public SvxFmMSFactory
, ///< derived from XMultiServiceFactory
89 public css::lang::XServiceInfo
,
90 public css::util::XChangesNotifier
,
91 public css::chart2::XDataProviderAccess
,
92 public css::sheet::opencl::XOpenCLSelection
95 SfxItemPropertySet
const aPropSet
;
96 ScDocShell
* pDocShell
;
97 std::unique_ptr
<ScPrintFuncCache
> pPrintFuncCache
;
98 std::unique_ptr
<ScPrintUIOptions
> pPrinterOptions
;
99 std::unique_ptr
<ScPrintState
> m_pPrintState
;
100 css::uno::Reference
<css::uno::XAggregation
> xNumberAgg
;
101 css::uno::Reference
<css::uno::XInterface
> xDrawGradTab
;
102 css::uno::Reference
<css::uno::XInterface
> xDrawHatchTab
;
103 css::uno::Reference
<css::uno::XInterface
> xDrawBitmapTab
;
104 css::uno::Reference
<css::uno::XInterface
> xDrawTrGradTab
;
105 css::uno::Reference
<css::uno::XInterface
> xDrawMarkerTab
;
106 css::uno::Reference
<css::uno::XInterface
> xDrawDashTab
;
107 css::uno::Reference
<css::uno::XInterface
> xChartDataProv
;
108 css::uno::Reference
<css::uno::XInterface
> xObjProvider
;
110 ::comphelper::OInterfaceContainerHelper2 maChangesListeners
;
112 bool FillRenderMarkData( const css::uno::Any
& aSelection
,
113 const css::uno::Sequence
< css::beans::PropertyValue
>& rOptions
,
114 ScMarkData
& rMark
, ScPrintSelectionStatus
& rStatus
, OUString
& rPagesStr
,
115 bool& rbRenderToGraphic
) const;
116 css::uno::Reference
<css::uno::XAggregation
> const & GetFormatter();
117 void HandleCalculateEvents();
119 css::uno::Reference
<css::uno::XInterface
> create(
120 OUString
const & aServiceSpecifier
,
121 css::uno::Sequence
<css::uno::Any
> const * arguments
);
123 static bool IsOnEvenPage( sal_Int32 nPage
) { return nPage
% 2 == 0; };
126 std::vector
<sal_Int32
> maValidPages
;
128 const SfxItemPropertySet
& GetPropertySet() const { return aPropSet
; }
130 /** abstract SdrModel provider */
131 virtual SdrModel
& getSdrModelFromUnoModel() const override
;
134 ScModelObj(ScDocShell
* pDocSh
);
135 virtual ~ScModelObj() override
;
137 /// create ScModelObj and set at pDocSh (SetBaseModel)
138 static void CreateAndSet(ScDocShell
* pDocSh
);
140 ScDocument
* GetDocument() const;
141 SfxObjectShell
* GetEmbeddedObject() const;
143 void UpdateAllRowHeights();
145 void BeforeXMLLoading();
146 void AfterXMLLoading();
147 ScSheetSaveData
* GetSheetSaveData();
148 ScFormatSaveData
* GetFormatSaveData();
150 void RepaintRange( const ScRange
& rRange
);
151 void RepaintRange( const ScRangeList
& rRange
);
153 bool HasChangesListeners() const;
155 void NotifyChanges( const OUString
& rOperation
, const ScRangeList
& rRanges
,
156 const css::uno::Sequence
< css::beans::PropertyValue
>& rProperties
);
158 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
159 virtual void SAL_CALL
acquire() throw() override
;
160 virtual void SAL_CALL
release() throw() override
;
162 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
164 /// XSpreadsheetDocument
165 virtual css::uno::Reference
< css::sheet::XSpreadsheets
> SAL_CALL
166 getSheets() override
;
168 /// XDataProviderAccess
169 virtual ::css::uno::Reference
< css::chart2::data::XDataProvider
> SAL_CALL
170 createDataProvider() override
;
172 /// XStyleFamiliesSupplier
173 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
174 getStyleFamilies() override
;
177 virtual sal_Int32 SAL_CALL
getRendererCount( const css::uno::Any
& aSelection
,
178 const css::uno::Sequence
< css::beans::PropertyValue
>& xOptions
) override
;
179 virtual css::uno::Sequence
< css::beans::PropertyValue
> SAL_CALL
180 getRenderer( sal_Int32 nRenderer
, const css::uno::Any
& aSelection
,
181 const css::uno::Sequence
< css::beans::PropertyValue
>& xOptions
) override
;
182 virtual void SAL_CALL
render( sal_Int32 nRenderer
, const css::uno::Any
& aSelection
,
183 const css::uno::Sequence
< css::beans::PropertyValue
>& xOptions
) override
;
185 /// XLinkTargetSupplier
186 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
190 virtual sal_Bool SAL_CALL
isActionLocked() override
;
191 virtual void SAL_CALL
addActionLock() override
;
192 virtual void SAL_CALL
removeActionLock() override
;
193 virtual void SAL_CALL
setActionLocks( sal_Int16 nLock
) override
;
194 virtual sal_Int16 SAL_CALL
resetActionLocks() override
;
196 virtual void SAL_CALL
lockControllers() override
;
197 virtual void SAL_CALL
unlockControllers() override
;
200 virtual void SAL_CALL
calculate() override
;
201 virtual void SAL_CALL
calculateAll() override
;
202 virtual sal_Bool SAL_CALL
isAutomaticCalculationEnabled() override
;
203 virtual void SAL_CALL
enableAutomaticCalculation( sal_Bool bEnabled
) override
;
206 virtual void SAL_CALL
protect( const OUString
& aPassword
) override
;
207 virtual void SAL_CALL
unprotect( const OUString
& aPassword
) override
;
208 virtual sal_Bool SAL_CALL
isProtected() override
;
210 /// XDrawPagesSupplier
211 virtual css::uno::Reference
< css::drawing::XDrawPages
> SAL_CALL
212 getDrawPages() override
;
215 virtual css::sheet::GoalResult SAL_CALL
seekGoal(
216 const css::table::CellAddress
& aFormulaPosition
,
217 const css::table::CellAddress
& aVariablePosition
,
218 const OUString
& aGoalValue
) override
;
221 virtual css::uno::Reference
< css::sheet::XConsolidationDescriptor
>
222 SAL_CALL
createConsolidationDescriptor( sal_Bool bEmpty
) override
;
223 virtual void SAL_CALL
consolidate( const css::uno::Reference
< css::sheet::XConsolidationDescriptor
>& xDescriptor
) override
;
225 /// XDocumentAuditing
226 virtual void SAL_CALL
refreshArrows() override
;
228 /// XViewDataSupplier
229 virtual css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getViewData( ) override
;
232 virtual css::uno::Reference
< css::beans::XPropertySetInfo
>
233 SAL_CALL
getPropertySetInfo() override
;
234 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
,
235 const css::uno::Any
& aValue
) override
;
236 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
237 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
,
238 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
239 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
,
240 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
241 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
,
242 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
243 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
,
244 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
246 /// XMultiServiceFactory
247 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
248 createInstance( const OUString
& aServiceSpecifier
) override
;
249 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
250 createInstanceWithArguments( const OUString
& ServiceSpecifier
,
251 const css::uno::Sequence
< css::uno::Any
>& Arguments
) override
;
252 virtual css::uno::Sequence
< OUString
> SAL_CALL
getAvailableServiceNames() override
;
255 virtual OUString SAL_CALL
getImplementationName() override
;
256 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
257 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
260 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
262 static const css::uno::Sequence
<sal_Int8
>& getUnoTunnelId();
265 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
266 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
269 virtual void SAL_CALL
addChangesListener( const css::uno::Reference
< css::util::XChangesListener
>& aListener
) override
;
270 virtual void SAL_CALL
removeChangesListener( const css::uno::Reference
< css::util::XChangesListener
>& aListener
) override
;
273 virtual sal_Bool SAL_CALL
isOpenCLEnabled() override
;
275 virtual void SAL_CALL
enableOpenCL(sal_Bool bEnable
) override
;
277 virtual void SAL_CALL
enableAutomaticDeviceSelection(sal_Bool bForce
) override
;
279 virtual void SAL_CALL
disableAutomaticDeviceSelection() override
;
281 virtual void SAL_CALL
selectOpenCLDevice( sal_Int32 platform
, sal_Int32 device
) override
;
283 virtual sal_Int32 SAL_CALL
getPlatformID() override
;
285 virtual sal_Int32 SAL_CALL
getDeviceID() override
;
287 virtual css::uno::Sequence
< css::sheet::opencl::OpenCLPlatform
>
288 SAL_CALL
getOpenCLPlatforms() override
;
290 virtual void SAL_CALL
enableOpcodeSubsetTest() override
;
292 virtual void SAL_CALL
disableOpcodeSubsetTest() override
;
294 virtual sal_Bool SAL_CALL
isOpcodeSubsetTested() override
;
296 virtual void SAL_CALL
setFormulaCellNumberLimit( sal_Int32 number
) override
;
298 virtual sal_Int32 SAL_CALL
getFormulaCellNumberLimit() override
;
300 /// @see vcl::ITiledRenderable::paintTile().
301 virtual void paintTile( VirtualDevice
& rDevice
,
307 long nTileHeight
) override
;
309 /// @see vcl::ITiledRenderable::getDocumentSize().
310 virtual Size
getDocumentSize() override
;
312 /// @see vcl::ITiledRenderable::setPart().
313 virtual void setPart(int nPart
) override
;
315 /// @see vcl::ITiledRenderable::getPart().
316 virtual int getPart() override
;
318 /// @see vcl::ITiledRenderable::getParts().
319 virtual int getParts() override
;
321 /// @see vcl::ITiledRenderable::getPartInfo().
322 virtual OUString
getPartInfo( int nPart
) override
;
324 /// @see vcl::ITiledRenderable::getPartName().
325 virtual OUString
getPartName(int nPart
) override
;
327 /// @see vcl::ITiledRenderable::getPartHash().
328 virtual OUString
getPartHash( int nPart
) override
;
330 /// @see vcl::ITiledRenderable::getDocWindow().
331 virtual VclPtr
<vcl::Window
> getDocWindow() override
;
333 /// @see vcl::ITiledRenderable::initializeForTiledRendering().
334 virtual void initializeForTiledRendering(const css::uno::Sequence
<css::beans::PropertyValue
>& rArguments
) override
;
336 /// @see vcl::ITiledRenderable::postKeyEvent().
337 virtual void postKeyEvent(int nType
, int nCharCode
, int nKeyCode
) override
;
339 /// @see vcl::ITiledRenderable::postMouseEvent().
340 virtual void postMouseEvent(int nType
, int nX
, int nY
, int nCount
, int nButtons
, int nModifier
) override
;
342 /// @see vcl::ITiledRenderable::setTextSelection().
343 virtual void setTextSelection(int nType
, int nX
, int nY
) override
;
345 /// @see vcl::ITiledRenderable::getSelection().
346 virtual css::uno::Reference
<css::datatransfer::XTransferable
> getSelection() override
;
348 /// @see vcl::ITiledRenderable::setGraphicSelection().
349 virtual void setGraphicSelection(int nType
, int nX
, int nY
) override
;
351 /// @see lok::Document::resetSelection().
352 virtual void resetSelection() override
;
354 /// @see vcl::ITiledRenderable::setClipboard().
355 virtual void setClipboard(const css::uno::Reference
<css::datatransfer::clipboard::XClipboard
>& xClipboard
) override
;
357 /// @see vcl::ITiledRenderable::isMimeTypeSupported().
358 virtual bool isMimeTypeSupported() override
;
360 /// @see vcl::ITiledRenderable::setClientZoom().
361 virtual void setClientZoom(int nTilePixelWidth
, int nTilePixelHeight
, int nTileTwipWidth
, int nTileTwipHeight
) override
;
363 /// @see vcl::ITiledRenderable::setOutlineState().
364 virtual void setOutlineState(bool bColumn
, int nLevel
, int nIndex
, bool bHidden
) override
;
366 /// @see vcl::ITiledRenderable::getRowColumnHeaders().
367 virtual OUString
getRowColumnHeaders(const tools::Rectangle
& rRectangle
) override
;
369 /// @see vcl::ITiledRenderable::getSheetGeometryData().
370 virtual OString
getSheetGeometryData(bool bColumns
, bool bRows
, bool bSizes
, bool bHidden
,
371 bool bFiltered
, bool bGroups
) override
;
373 /// @see vcl::ITiledRenderable::getCellCursor().
374 virtual OString
getCellCursor() override
;
376 /// @see vcl::ITiledRenderable::getPointer().
377 virtual PointerStyle
getPointer() override
;
379 /// @see vcl::ITiledRenderable::getTrackedChanges().
380 void getTrackedChanges(tools::JsonWriter
&) override
;
382 /// @see vcl::ITiledRenderable::setClientVisibleArea().
383 virtual void setClientVisibleArea(const tools::Rectangle
& rRectangle
) override
;
385 /// @see vcl::ITiledRenderable::getPostIts().
386 OUString
getPostIts() override
;
388 /// @see vcl::ITiledRenderable::getPostItsPos().
389 OUString
getPostItsPos() override
;
391 /// @see vcl::ITiledRenderable::completeFunction().
392 virtual void completeFunction(const OUString
& rFunctionName
) override
;
395 class ScDrawPagesObj final
: public cppu::WeakImplHelper
<
396 css::drawing::XDrawPages
,
397 css::lang::XServiceInfo
>,
401 ScDocShell
* pDocShell
;
403 css::uno::Reference
< css::drawing::XDrawPage
>
404 GetObjectByIndex_Impl(sal_Int32 nIndex
) const;
407 ScDrawPagesObj(ScDocShell
* pDocSh
);
408 virtual ~ScDrawPagesObj() override
;
410 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
413 virtual css::uno::Reference
< css::drawing::XDrawPage
> SAL_CALL
414 insertNewByIndex( sal_Int32 nIndex
) override
;
415 virtual void SAL_CALL
remove( const css::uno::Reference
< css::drawing::XDrawPage
>& xPage
) override
;
418 virtual sal_Int32 SAL_CALL
getCount() override
;
419 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
422 virtual css::uno::Type SAL_CALL
getElementType() override
;
423 virtual sal_Bool SAL_CALL
hasElements() override
;
426 virtual OUString SAL_CALL
getImplementationName() override
;
427 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
428 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
431 class ScTableSheetsObj final
: public cppu::WeakImplHelper
<
432 css::sheet::XSpreadsheets2
,
433 css::sheet::XCellRangesAccess
,
434 css::container::XEnumerationAccess
,
435 css::container::XIndexAccess
,
436 css::lang::XServiceInfo
>,
440 ScDocShell
* pDocShell
;
442 ScTableSheetObj
* GetObjectByIndex_Impl(sal_Int32 nIndex
) const;
443 ScTableSheetObj
* GetObjectByName_Impl(const OUString
& aName
) const;
446 ScTableSheetsObj(ScDocShell
* pDocSh
);
447 virtual ~ScTableSheetsObj() override
;
449 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
452 virtual void SAL_CALL
insertNewByName( const OUString
& aName
, sal_Int16 nPosition
) override
;
453 virtual void SAL_CALL
moveByName( const OUString
& aName
, sal_Int16 nDestination
) override
;
454 virtual void SAL_CALL
copyByName( const OUString
& aName
,
455 const OUString
& aCopy
, sal_Int16 nDestination
) override
;
458 virtual sal_Int32 SAL_CALL
importSheet(
459 const css::uno::Reference
< css::sheet::XSpreadsheetDocument
> & xDocSrc
,
460 const OUString
& srcName
,
461 sal_Int32 nDestPosition
) override
;
463 /// XCellRangesAccess
465 virtual css::uno::Reference
< css::table::XCell
>
466 SAL_CALL
getCellByPosition( sal_Int32 nColumn
, sal_Int32 nRow
, sal_Int32 nSheet
) override
;
468 virtual css::uno::Reference
< css::table::XCellRange
>
469 SAL_CALL
getCellRangeByPosition( sal_Int32 nLeft
, sal_Int32 nTop
, sal_Int32 nRight
, sal_Int32 nBottom
, sal_Int32 nSheet
) override
;
471 virtual css::uno::Sequence
< css::uno::Reference
< css::table::XCellRange
> >
472 SAL_CALL
getCellRangesByName( const OUString
& aRange
) override
;
475 virtual void SAL_CALL
insertByName( const OUString
& aName
,
476 const css::uno::Any
& aElement
) override
;
477 virtual void SAL_CALL
removeByName( const OUString
& Name
) override
;
480 virtual void SAL_CALL
replaceByName( const OUString
& aName
,
481 const css::uno::Any
& aElement
) override
;
483 /// XEnumerationAccess
484 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
485 createEnumeration() override
;
488 virtual css::uno::Type SAL_CALL
getElementType() override
;
489 virtual sal_Bool SAL_CALL
hasElements() override
;
492 virtual sal_Int32 SAL_CALL
getCount() override
;
493 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
496 virtual css::uno::Any SAL_CALL
getByName( const OUString
& aName
) override
;
497 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames() override
;
498 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
) override
;
501 virtual OUString SAL_CALL
getImplementationName() override
;
502 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
503 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
506 class ScTableColumnsObj final
: public cppu::WeakImplHelper
<
507 css::table::XTableColumns
,
508 css::container::XEnumerationAccess
,
509 css::container::XNameAccess
,
510 css::beans::XPropertySet
,
511 css::lang::XServiceInfo
>,
515 ScDocShell
* pDocShell
;
517 SCCOL
const nStartCol
;
520 ScTableColumnObj
* GetObjectByIndex_Impl(sal_Int32 nIndex
) const;
521 ScTableColumnObj
* GetObjectByName_Impl(const OUString
& aName
) const;
524 ScTableColumnsObj(ScDocShell
* pDocSh
, SCTAB nT
,
525 SCCOL nSC
, SCCOL nEC
);
526 virtual ~ScTableColumnsObj() override
;
528 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
531 virtual void SAL_CALL
insertByIndex( sal_Int32 nIndex
, sal_Int32 nCount
) override
;
532 virtual void SAL_CALL
removeByIndex( sal_Int32 nIndex
, sal_Int32 nCount
) override
;
535 virtual css::uno::Any SAL_CALL
getByName( const OUString
& aName
) override
;
536 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames() override
;
537 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
) override
;
540 virtual sal_Int32 SAL_CALL
getCount() override
;
541 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
543 /// XEnumerationAccess
544 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
545 createEnumeration() override
;
548 virtual css::uno::Type SAL_CALL
getElementType() override
;
549 virtual sal_Bool SAL_CALL
hasElements() override
;
552 virtual css::uno::Reference
< css::beans::XPropertySetInfo
>
553 SAL_CALL
getPropertySetInfo() override
;
554 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
,
555 const css::uno::Any
& aValue
) override
;
556 virtual css::uno::Any SAL_CALL
getPropertyValue(
557 const OUString
& PropertyName
) override
;
558 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
,
559 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
560 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
,
561 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
562 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
,
563 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
564 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
,
565 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
568 virtual OUString SAL_CALL
getImplementationName() override
;
569 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
570 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
573 class ScTableRowsObj final
: public cppu::WeakImplHelper
<
574 css::table::XTableRows
,
575 css::container::XEnumerationAccess
,
576 css::beans::XPropertySet
,
577 css::lang::XServiceInfo
>,
581 ScDocShell
* pDocShell
;
583 SCROW
const nStartRow
;
586 ScTableRowObj
* GetObjectByIndex_Impl(sal_Int32 nIndex
) const;
589 ScTableRowsObj(ScDocShell
* pDocSh
, SCTAB nT
,
590 SCROW nSR
, SCROW nER
);
591 virtual ~ScTableRowsObj() override
;
593 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
596 virtual void SAL_CALL
insertByIndex( sal_Int32 nIndex
, sal_Int32 nCount
) override
;
597 virtual void SAL_CALL
removeByIndex( sal_Int32 nIndex
, sal_Int32 nCount
) override
;
600 virtual sal_Int32 SAL_CALL
getCount() override
;
601 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
603 /// XEnumerationAccess
604 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
605 createEnumeration() override
;
608 virtual css::uno::Type SAL_CALL
getElementType() override
;
609 virtual sal_Bool SAL_CALL
hasElements() override
;
612 virtual css::uno::Reference
< css::beans::XPropertySetInfo
>
613 SAL_CALL
getPropertySetInfo() override
;
614 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
,
615 const css::uno::Any
& aValue
) override
;
616 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
617 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
,
618 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
619 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
,
620 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
621 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
,
622 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
623 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
,
624 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
627 virtual OUString SAL_CALL
getImplementationName() override
;
628 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
629 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
632 class ScSpreadsheetSettingsObj final
: public cppu::WeakImplHelper
<
633 css::beans::XPropertySet
,
634 css::lang::XServiceInfo
>,
638 virtual ~ScSpreadsheetSettingsObj() override
;
641 virtual css::uno::Reference
< css::beans::XPropertySetInfo
>
642 SAL_CALL
getPropertySetInfo() override
;
643 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
,
644 const css::uno::Any
& aValue
) override
;
645 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
646 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
,
647 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
648 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
,
649 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
650 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
,
651 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
652 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
,
653 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
656 virtual OUString SAL_CALL
getImplementationName() override
;
657 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
658 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
661 class ScAnnotationsObj final
: public cppu::WeakImplHelper
<
662 css::sheet::XSheetAnnotations
,
663 css::container::XEnumerationAccess
,
664 css::lang::XServiceInfo
>,
668 ScDocShell
* pDocShell
;
669 SCTAB
const nTab
; ///< Collection belongs to the sheet
671 bool GetAddressByIndex_Impl( sal_Int32 nIndex
, ScAddress
& rPos
) const;
672 ScAnnotationObj
* GetObjectByIndex_Impl( sal_Int32 nIndex
) const;
675 ScAnnotationsObj(ScDocShell
* pDocSh
, SCTAB nT
);
676 virtual ~ScAnnotationsObj() override
;
678 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
680 ScDocShell
* GetDocShell() const { return pDocShell
; }
682 /// XSheetAnnotations
683 virtual void SAL_CALL
insertNew( const css::table::CellAddress
& aPosition
,
684 const OUString
& aText
) override
;
685 virtual void SAL_CALL
removeByIndex( sal_Int32 nIndex
) override
;
688 virtual sal_Int32 SAL_CALL
getCount() override
;
689 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
691 /// XEnumerationAccess
692 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
693 createEnumeration() override
;
696 virtual css::uno::Type SAL_CALL
getElementType() override
;
697 virtual sal_Bool SAL_CALL
hasElements() override
;
700 virtual OUString SAL_CALL
getImplementationName() override
;
701 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
702 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
705 class ScScenariosObj final
: public cppu::WeakImplHelper
<
706 css::sheet::XScenarios
,
707 css::container::XEnumerationAccess
,
708 css::container::XIndexAccess
,
709 css::lang::XServiceInfo
>,
713 ScDocShell
* pDocShell
;
716 bool GetScenarioIndex_Impl( const OUString
& rName
, SCTAB
& rIndex
);
717 ScTableSheetObj
* GetObjectByIndex_Impl(sal_Int32 nIndex
);
718 ScTableSheetObj
* GetObjectByName_Impl(const OUString
& aName
);
721 ScScenariosObj(ScDocShell
* pDocSh
, SCTAB nT
);
722 virtual ~ScScenariosObj() override
;
724 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
727 virtual void SAL_CALL
addNewByName( const OUString
& aName
,
728 const css::uno::Sequence
< css::table::CellRangeAddress
>& aRanges
,
729 const OUString
& aComment
) override
;
730 virtual void SAL_CALL
removeByName( const OUString
& aName
) override
;
733 virtual css::uno::Any SAL_CALL
getByName( const OUString
& aName
) override
;
734 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames() override
;
735 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
) override
;
738 virtual sal_Int32 SAL_CALL
getCount() override
;
739 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
741 /// XEnumerationAccess
742 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
743 createEnumeration() override
;
746 virtual css::uno::Type SAL_CALL
getElementType() override
;
747 virtual sal_Bool SAL_CALL
hasElements() override
;
750 virtual OUString SAL_CALL
getImplementationName() override
;
751 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
752 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
757 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */