Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_CELLSUNO_HXX
30 : : #define SC_CELLSUNO_HXX
31 : :
32 : : #include "global.hxx" // ScRange, ScAddress
33 : : #include "rangelst.hxx" // ScRangeList
34 : :
35 : : #include <editeng/unotext.hxx>
36 : : #include <formula/grammar.hxx>
37 : : #include <rtl/ref.hxx>
38 : : #include <tools/link.hxx>
39 : : #include <svl/lstner.hxx>
40 : : #include <svl/listener.hxx>
41 : : #include <svl/itemprop.hxx>
42 : : #include <com/sun/star/table/XTableChartsSupplier.hpp>
43 : : #include <com/sun/star/chart/XChartDataArray.hpp>
44 : : #include <com/sun/star/text/XTextFieldsSupplier.hpp>
45 : : #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
46 : : #include <com/sun/star/sheet/XSheetCellRange.hpp>
47 : : #include <com/sun/star/sheet/XFormulaQuery.hpp>
48 : : #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
49 : : #include <com/sun/star/sheet/XSheetOperation.hpp>
50 : : #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
51 : : #include <com/sun/star/sheet/XCellFormatRangesSupplier.hpp>
52 : : #include <com/sun/star/sheet/XUniqueCellFormatRangesSupplier.hpp>
53 : : #include <com/sun/star/sheet/XCellRangesQuery.hpp>
54 : : #include <com/sun/star/sheet/XSheetFilterableEx.hpp>
55 : : #include <com/sun/star/sheet/XSpreadsheet.hpp>
56 : : #include <com/sun/star/sheet/XSheetPageBreak.hpp>
57 : : #include <com/sun/star/sheet/XCellRangeMovement.hpp>
58 : : #include <com/sun/star/text/XText.hpp>
59 : : #include <com/sun/star/sheet/XPrintAreas.hpp>
60 : : #include <com/sun/star/sheet/XSheetLinkable.hpp>
61 : : #include <com/sun/star/sheet/XSubTotalCalculatable.hpp>
62 : : #include <com/sun/star/sheet/XArrayFormulaRange.hpp>
63 : : #include <com/sun/star/sheet/XCellRangeData.hpp>
64 : : #include <com/sun/star/sheet/XCellRangeFormula.hpp>
65 : : #include <com/sun/star/sheet/XCellSeries.hpp>
66 : : #include <com/sun/star/sheet/XMultipleOperation.hpp>
67 : : #include <com/sun/star/sheet/XFormulaTokens.hpp>
68 : : #include <com/sun/star/sheet/XArrayFormulaTokens.hpp>
69 : : #include <com/sun/star/sheet/XCellAddressable.hpp>
70 : : #include <com/sun/star/util/XReplaceable.hpp>
71 : : #include <com/sun/star/util/XIndent.hpp>
72 : : #include <com/sun/star/lang/XServiceInfo.hpp>
73 : : #include <com/sun/star/container/XNameContainer.hpp>
74 : : #include <com/sun/star/util/XMergeable.hpp>
75 : : #include <com/sun/star/table/XAutoFormattable.hpp>
76 : : #include <com/sun/star/util/XSortable.hpp>
77 : : #include <com/sun/star/util/XImportable.hpp>
78 : : #include <com/sun/star/table/XColumnRowRange.hpp>
79 : : #include <com/sun/star/table/XCell2.hpp>
80 : : #include <com/sun/star/table/BorderLine2.hpp>
81 : : #include <com/sun/star/table/TableBorder.hpp>
82 : : #include <com/sun/star/table/TableBorder2.hpp>
83 : : #include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
84 : : #include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
85 : : #include <com/sun/star/sheet/XScenariosSupplier.hpp>
86 : : #include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
87 : : #include <com/sun/star/sheet/XSheetAuditing.hpp>
88 : : #include <com/sun/star/sheet/XSheetOutline.hpp>
89 : : #include <com/sun/star/util/XProtectable.hpp>
90 : : #include <com/sun/star/sheet/XScenario.hpp>
91 : : #include <com/sun/star/sheet/XScenarioEnhanced.hpp>
92 : : #include <com/sun/star/util/XModifyBroadcaster.hpp>
93 : : #include <com/sun/star/beans/XPropertyState.hpp>
94 : : #include <com/sun/star/beans/XMultiPropertySet.hpp>
95 : : #include <com/sun/star/lang/XUnoTunnel.hpp>
96 : : #include <com/sun/star/document/XActionLockable.hpp>
97 : : #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
98 : : #include <com/sun/star/sheet/XExternalSheetName.hpp>
99 : : #include <com/sun/star/document/XEventsSupplier.hpp>
100 : : #include <cppuhelper/implbase2.hxx>
101 : : #include <cppuhelper/implbase3.hxx>
102 : : #include <boost/ptr_container/ptr_vector.hpp>
103 : : #include <boost/scoped_ptr.hpp>
104 : :
105 : : #include <vector>
106 : :
107 : : class ScDocShell;
108 : : class ScMarkData;
109 : : class ScMemChart;
110 : : class ScPrintRangeSaver;
111 : : class ScAttrRectIterator;
112 : : class ScCellRangeObj;
113 : : class ScLinkListener;
114 : : class ScPatternAttr;
115 : : class SvxBoxItem;
116 : : class SvxBoxInfoItem;
117 : : class SvxItemPropertySet;
118 : :
119 : : namespace editeng { class SvxBorderLine; }
120 : :
121 : : class ScLinkListener : public SvtListener
122 : : {
123 : : Link aLink;
124 : : public:
125 : 4785 : ScLinkListener(const Link& rL) : aLink(rL) {}
126 : : virtual ~ScLinkListener();
127 : : virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint );
128 : : };
129 : :
130 : : typedef ::com::sun::star::uno::Reference<
131 : : ::com::sun::star::util::XModifyListener > XModifyListenerRef;
132 : : typedef boost::ptr_vector<XModifyListenerRef> XModifyListenerArr_Impl;
133 : :
134 : :
135 : : // ScCellRangesBase - base class for ScCellRangesObj (with access by index)
136 : : // and ScCellRangeObj (without access by index)
137 : :
138 : : // XServiceInfo is implemented in derived classes
139 : :
140 : : class ScHelperFunctions
141 : : {
142 : : public:
143 : : static const ::editeng::SvxBorderLine* GetBorderLine( ::editeng::SvxBorderLine& rLine, const com::sun::star::table::BorderLine& rStruct );
144 : : static const ::editeng::SvxBorderLine* GetBorderLine( ::editeng::SvxBorderLine& rLine, const com::sun::star::table::BorderLine2& rStruct );
145 : : static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const com::sun::star::table::TableBorder& rBorder );
146 : : static void FillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const com::sun::star::table::TableBorder2& rBorder );
147 : : static void FillBorderLine( com::sun::star::table::BorderLine& rStruct, const ::editeng::SvxBorderLine* pLine );
148 : : static void FillBorderLine( com::sun::star::table::BorderLine2& rStruct, const ::editeng::SvxBorderLine* pLine );
149 : : static void AssignTableBorderToAny( com::sun::star::uno::Any& rAny,
150 : : const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner, bool bInvalidateHorVerDist = false );
151 : : static void AssignTableBorder2ToAny( com::sun::star::uno::Any& rAny,
152 : : const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner, bool bInvalidateHorVerDist = false );
153 : : static void ApplyBorder( ScDocShell* pDocShell, const ScRangeList& rRanges,
154 : : const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner );
155 : : };
156 : :
157 : : namespace ooo
158 : : {
159 : : namespace vba {
160 : : namespace excel {
161 : : class ScVbaCellRangeAccess; // Vba Helper class
162 : : }
163 : : }
164 : : }
165 : :
166 : : class SC_DLLPUBLIC ScCellRangesBase : public com::sun::star::beans::XPropertySet,
167 : : public com::sun::star::beans::XMultiPropertySet,
168 : : public com::sun::star::beans::XPropertyState,
169 : : public com::sun::star::sheet::XSheetOperation,
170 : : public com::sun::star::chart::XChartDataArray,
171 : : public com::sun::star::util::XIndent,
172 : : public com::sun::star::sheet::XCellRangesQuery,
173 : : public com::sun::star::sheet::XFormulaQuery,
174 : : public com::sun::star::util::XReplaceable,
175 : : public com::sun::star::util::XModifyBroadcaster,
176 : : public com::sun::star::lang::XServiceInfo,
177 : : public com::sun::star::lang::XUnoTunnel,
178 : : public com::sun::star::lang::XTypeProvider,
179 : : public com::sun::star::beans::XTolerantMultiPropertySet,
180 : : public cppu::OWeakObject,
181 : : public SfxListener
182 : : {
183 : : friend class ScTabViewObj; // for select()
184 : : friend class ScTableSheetObj; // for createCursorByRange()
185 : : friend class ooo::vba::excel::ScVbaCellRangeAccess;
186 : :
187 : : private:
188 : : const SfxItemPropertySet* pPropSet;
189 : : ScDocShell* pDocShell;
190 : : ScLinkListener* pValueListener;
191 : : ScPatternAttr* pCurrentFlat;
192 : : ScPatternAttr* pCurrentDeep;
193 : : SfxItemSet* pCurrentDataSet;
194 : : SfxItemSet* pNoDfltCurrentDataSet;
195 : : ScMarkData* pMarkData;
196 : : ScRangeList aRanges;
197 : : sal_Int64 nObjectId;
198 : : sal_Bool bChartColAsHdr;
199 : : sal_Bool bChartRowAsHdr;
200 : : sal_Bool bCursorOnly;
201 : : sal_Bool bGotDataChangedHint;
202 : : XModifyListenerArr_Impl aValueListeners;
203 : :
204 : : DECL_LINK( ValueListenerHdl, SfxHint* );
205 : :
206 : : private:
207 : : void PaintRanges_Impl( sal_uInt16 nPart );
208 : : ScRangeListRef GetLimitedChartRanges_Impl( long nDataColumns, long nDataRows ) const;
209 : : void ForceChartListener_Impl();
210 : : ScMemChart* CreateMemChart_Impl() const;
211 : :
212 : : const ScPatternAttr* GetCurrentAttrsFlat();
213 : : const ScPatternAttr* GetCurrentAttrsDeep();
214 : : SfxItemSet* GetCurrentDataSet(bool bNoDflt = false);
215 : : void ForgetMarkData();
216 : : void ForgetCurrentAttrs();
217 : :
218 : : com::sun::star::uno::Reference<com::sun::star::sheet::XSheetCellRanges>
219 : : QueryDifferences_Impl(const com::sun::star::table::CellAddress& aCompare,
220 : : sal_Bool bColumnDiff);
221 : : com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
222 : : Find_Impl(const com::sun::star::uno::Reference<
223 : : com::sun::star::util::XSearchDescriptor>& xDesc,
224 : : const ScAddress* pLastPos);
225 : :
226 : : protected:
227 : : const ScMarkData* GetMarkData();
228 : :
229 : : // GetItemPropertyMap for derived classes must contain all entries, including base class
230 : : virtual const SfxItemPropertyMap& GetItemPropertyMap();
231 : : virtual ::com::sun::star::beans::PropertyState GetOnePropertyState(
232 : : sal_uInt16 nItemWhich, const SfxItemPropertySimpleEntry* pEntry );
233 : : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
234 : : ::com::sun::star::uno::Any& )
235 : : throw(::com::sun::star::uno::RuntimeException);
236 : : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
237 : : const ::com::sun::star::uno::Any& aValue )
238 : : throw(::com::sun::star::lang::IllegalArgumentException,
239 : : ::com::sun::star::uno::RuntimeException);
240 : :
241 : : public:
242 : : ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR);
243 : : ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR);
244 : : virtual ~ScCellRangesBase();
245 : :
246 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
247 : : const ::com::sun::star::uno::Type & rType )
248 : : throw(::com::sun::star::uno::RuntimeException);
249 : : virtual void SAL_CALL acquire() throw();
250 : : virtual void SAL_CALL release() throw();
251 : :
252 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
253 : : virtual void RefChanged();
254 : :
255 : : // from derived classes and by getImplementation
256 : 19639 : ScDocShell* GetDocShell() const { return pDocShell; }
257 : : ScDocument* GetDocument() const;
258 : 6718 : const ScRangeList& GetRangeList() const { return aRanges; }
259 : : void AddRange(const ScRange& rRange, const sal_Bool bMergeRanges);
260 : :
261 : : // arouse object created via service:
262 : : void InitInsertRange(ScDocShell* pDocSh, const ScRange& rR);
263 : :
264 : : void SetNewRange(const ScRange& rNew); // for cursor
265 : : void SetNewRanges(const ScRangeList& rNew);
266 : :
267 : : void SetCursorOnly(sal_Bool bSet);
268 : 0 : sal_Bool IsCursorOnly() const { return bCursorOnly; }
269 : :
270 : : // XSheetOperation
271 : : virtual double SAL_CALL computeFunction( ::com::sun::star::sheet::GeneralFunction nFunction )
272 : : throw(::com::sun::star::uno::Exception,
273 : : ::com::sun::star::uno::RuntimeException);
274 : : virtual void SAL_CALL clearContents( sal_Int32 nContentFlags )
275 : : throw(::com::sun::star::uno::RuntimeException);
276 : :
277 : : // XPropertySet
278 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
279 : : SAL_CALL getPropertySetInfo()
280 : : throw(::com::sun::star::uno::RuntimeException);
281 : : virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
282 : : const ::com::sun::star::uno::Any& aValue )
283 : : throw(::com::sun::star::beans::UnknownPropertyException,
284 : : ::com::sun::star::beans::PropertyVetoException,
285 : : ::com::sun::star::lang::IllegalArgumentException,
286 : : ::com::sun::star::lang::WrappedTargetException,
287 : : ::com::sun::star::uno::RuntimeException);
288 : : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
289 : : const ::rtl::OUString& PropertyName )
290 : : throw(::com::sun::star::beans::UnknownPropertyException,
291 : : ::com::sun::star::lang::WrappedTargetException,
292 : : ::com::sun::star::uno::RuntimeException);
293 : : virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
294 : : const ::com::sun::star::uno::Reference<
295 : : ::com::sun::star::beans::XPropertyChangeListener >& xListener )
296 : : throw(::com::sun::star::beans::UnknownPropertyException,
297 : : ::com::sun::star::lang::WrappedTargetException,
298 : : ::com::sun::star::uno::RuntimeException);
299 : : virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
300 : : const ::com::sun::star::uno::Reference<
301 : : ::com::sun::star::beans::XPropertyChangeListener >& aListener )
302 : : throw(::com::sun::star::beans::UnknownPropertyException,
303 : : ::com::sun::star::lang::WrappedTargetException,
304 : : ::com::sun::star::uno::RuntimeException);
305 : : virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName,
306 : : const ::com::sun::star::uno::Reference<
307 : : ::com::sun::star::beans::XVetoableChangeListener >& aListener )
308 : : throw(::com::sun::star::beans::UnknownPropertyException,
309 : : ::com::sun::star::lang::WrappedTargetException,
310 : : ::com::sun::star::uno::RuntimeException);
311 : : virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
312 : : const ::com::sun::star::uno::Reference<
313 : : ::com::sun::star::beans::XVetoableChangeListener >& aListener )
314 : : throw(::com::sun::star::beans::UnknownPropertyException,
315 : : ::com::sun::star::lang::WrappedTargetException,
316 : : ::com::sun::star::uno::RuntimeException);
317 : :
318 : : // XMultiPropertySet
319 : : virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
320 : : const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
321 : : throw (::com::sun::star::beans::PropertyVetoException,
322 : : ::com::sun::star::lang::IllegalArgumentException,
323 : : ::com::sun::star::lang::WrappedTargetException,
324 : : ::com::sun::star::uno::RuntimeException);
325 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL
326 : : getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
327 : : throw (::com::sun::star::uno::RuntimeException);
328 : : virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
329 : : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
330 : : throw (::com::sun::star::uno::RuntimeException);
331 : : virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
332 : : throw (::com::sun::star::uno::RuntimeException);
333 : : virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
334 : : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
335 : : throw (::com::sun::star::uno::RuntimeException);
336 : :
337 : : // XTolerantMultiPropertySet
338 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL
339 : : setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
340 : : const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
341 : : throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
342 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL
343 : : getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
344 : : throw (::com::sun::star::uno::RuntimeException);
345 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL
346 : : getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
347 : : throw (::com::sun::star::uno::RuntimeException);
348 : :
349 : : // XPropertyState
350 : : virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(
351 : : const ::rtl::OUString& PropertyName )
352 : : throw(::com::sun::star::beans::UnknownPropertyException,
353 : : ::com::sun::star::uno::RuntimeException);
354 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL
355 : : getPropertyStates( const ::com::sun::star::uno::Sequence<
356 : : ::rtl::OUString >& aPropertyName )
357 : : throw(::com::sun::star::beans::UnknownPropertyException,
358 : : ::com::sun::star::uno::RuntimeException);
359 : : virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName )
360 : : throw(::com::sun::star::beans::UnknownPropertyException,
361 : : ::com::sun::star::uno::RuntimeException);
362 : : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
363 : : const ::rtl::OUString& aPropertyName )
364 : : throw(::com::sun::star::beans::UnknownPropertyException,
365 : : ::com::sun::star::lang::WrappedTargetException,
366 : : ::com::sun::star::uno::RuntimeException);
367 : :
368 : : // XIndent
369 : : virtual void SAL_CALL decrementIndent() throw(::com::sun::star::uno::RuntimeException);
370 : : virtual void SAL_CALL incrementIndent() throw(::com::sun::star::uno::RuntimeException);
371 : :
372 : : // XChartData
373 : : virtual void SAL_CALL addChartDataChangeEventListener(
374 : : const ::com::sun::star::uno::Reference<
375 : : ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
376 : : throw(::com::sun::star::uno::RuntimeException);
377 : : virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference<
378 : : ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
379 : : throw(::com::sun::star::uno::RuntimeException);
380 : : virtual double SAL_CALL getNotANumber() throw(::com::sun::star::uno::RuntimeException);
381 : : virtual sal_Bool SAL_CALL isNotANumber( double nNumber )
382 : : throw(::com::sun::star::uno::RuntimeException);
383 : :
384 : : // XChartDataArray
385 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL
386 : : getData() throw(::com::sun::star::uno::RuntimeException);
387 : : virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence<
388 : : ::com::sun::star::uno::Sequence< double > >& aData )
389 : : throw(::com::sun::star::uno::RuntimeException);
390 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions()
391 : : throw(::com::sun::star::uno::RuntimeException);
392 : : virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence<
393 : : ::rtl::OUString >& aRowDescriptions )
394 : : throw(::com::sun::star::uno::RuntimeException);
395 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions()
396 : : throw(::com::sun::star::uno::RuntimeException);
397 : : virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence<
398 : : ::rtl::OUString >& aColumnDescriptions )
399 : : throw(::com::sun::star::uno::RuntimeException);
400 : :
401 : : // XCellRangesQuery
402 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
403 : : queryVisibleCells() throw(::com::sun::star::uno::RuntimeException);
404 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
405 : : queryEmptyCells() throw(::com::sun::star::uno::RuntimeException);
406 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
407 : : queryContentCells( sal_Int16 nContentFlags )
408 : : throw(::com::sun::star::uno::RuntimeException);
409 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
410 : : queryFormulaCells( sal_Int32 nResultFlags )
411 : : throw(::com::sun::star::uno::RuntimeException);
412 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
413 : : queryColumnDifferences(
414 : : const ::com::sun::star::table::CellAddress& aCompare )
415 : : throw(::com::sun::star::uno::RuntimeException);
416 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
417 : : queryRowDifferences(
418 : : const ::com::sun::star::table::CellAddress& aCompare )
419 : : throw(::com::sun::star::uno::RuntimeException);
420 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
421 : : queryIntersection(
422 : : const ::com::sun::star::table::CellRangeAddress& aRange )
423 : : throw(::com::sun::star::uno::RuntimeException);
424 : :
425 : : // XFormulaQuery
426 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
427 : : queryDependents( sal_Bool bRecursive )
428 : : throw(::com::sun::star::uno::RuntimeException);
429 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
430 : : queryPrecedents( sal_Bool bRecursive )
431 : : throw(::com::sun::star::uno::RuntimeException);
432 : :
433 : : // XSearchable
434 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > SAL_CALL
435 : : createSearchDescriptor()
436 : : throw(::com::sun::star::uno::RuntimeException);
437 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
438 : : findAll( const ::com::sun::star::uno::Reference<
439 : : ::com::sun::star::util::XSearchDescriptor >& xDesc )
440 : : throw(::com::sun::star::uno::RuntimeException);
441 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
442 : : findFirst( const ::com::sun::star::uno::Reference<
443 : : ::com::sun::star::util::XSearchDescriptor >& xDesc )
444 : : throw(::com::sun::star::uno::RuntimeException);
445 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
446 : : findNext( const ::com::sun::star::uno::Reference<
447 : : ::com::sun::star::uno::XInterface >& xStartAt,
448 : : const ::com::sun::star::uno::Reference<
449 : : ::com::sun::star::util::XSearchDescriptor >& xDesc )
450 : : throw(::com::sun::star::uno::RuntimeException);
451 : :
452 : : // XReplaceable
453 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XReplaceDescriptor > SAL_CALL
454 : : createReplaceDescriptor() throw(::com::sun::star::uno::RuntimeException);
455 : : virtual sal_Int32 SAL_CALL replaceAll( const ::com::sun::star::uno::Reference<
456 : : ::com::sun::star::util::XSearchDescriptor >& xDesc )
457 : : throw(::com::sun::star::uno::RuntimeException);
458 : :
459 : : // XModifyBroadcaster
460 : : virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference<
461 : : ::com::sun::star::util::XModifyListener >& aListener )
462 : : throw (::com::sun::star::uno::RuntimeException);
463 : : virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference<
464 : : ::com::sun::star::util::XModifyListener >& aListener )
465 : : throw (::com::sun::star::uno::RuntimeException);
466 : :
467 : : // XServiceInfo
468 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
469 : : throw(::com::sun::star::uno::RuntimeException);
470 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
471 : : throw(::com::sun::star::uno::RuntimeException);
472 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
473 : : throw(::com::sun::star::uno::RuntimeException);
474 : :
475 : : // XUnoTunnel
476 : : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
477 : : sal_Int8 >& aIdentifier )
478 : : throw(::com::sun::star::uno::RuntimeException);
479 : :
480 : : static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
481 : : static ScCellRangesBase* getImplementation( const com::sun::star::uno::Reference<
482 : : com::sun::star::uno::XInterface> xObj );
483 : :
484 : : // XTypeProvider
485 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
486 : : throw(::com::sun::star::uno::RuntimeException);
487 : : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
488 : : throw(::com::sun::star::uno::RuntimeException);
489 : : };
490 : :
491 : :
492 : : class SC_DLLPUBLIC ScCellRangesObj : public ScCellRangesBase,
493 : : public com::sun::star::sheet::XSheetCellRangeContainer,
494 : : public com::sun::star::container::XNameContainer,
495 : : public com::sun::star::container::XEnumerationAccess
496 : : {
497 : : private:
498 : : struct Impl;
499 : : ::boost::scoped_ptr<Impl> m_pImpl;
500 : :
501 : : ScCellRangeObj* GetObjectByIndex_Impl(sal_Int32 nIndex) const;
502 : :
503 : : public:
504 : : ScCellRangesObj(ScDocShell* pDocSh, const ScRangeList& rR);
505 : : virtual ~ScCellRangesObj();
506 : :
507 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
508 : : const ::com::sun::star::uno::Type & rType )
509 : : throw(::com::sun::star::uno::RuntimeException);
510 : : virtual void SAL_CALL acquire() throw();
511 : : virtual void SAL_CALL release() throw();
512 : :
513 : : virtual void RefChanged();
514 : :
515 : : // XSheetCellRanges
516 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL
517 : : getCells() throw(::com::sun::star::uno::RuntimeException);
518 : : virtual ::rtl::OUString SAL_CALL getRangeAddressesAsString()
519 : : throw(::com::sun::star::uno::RuntimeException);
520 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
521 : : getRangeAddresses() throw(::com::sun::star::uno::RuntimeException);
522 : :
523 : : // XSheetCellRangeContainer
524 : : virtual void SAL_CALL addRangeAddress( const ::com::sun::star::table::CellRangeAddress& rRange,
525 : : sal_Bool bMergeRanges )
526 : : throw(::com::sun::star::uno::RuntimeException);
527 : : virtual void SAL_CALL removeRangeAddress( const ::com::sun::star::table::CellRangeAddress& rRange )
528 : : throw(::com::sun::star::container::NoSuchElementException,
529 : : ::com::sun::star::uno::RuntimeException);
530 : : virtual void SAL_CALL addRangeAddresses( const ::com::sun::star::uno::Sequence<
531 : : ::com::sun::star::table::CellRangeAddress >& rRanges,
532 : : sal_Bool bMergeRanges )
533 : : throw(::com::sun::star::uno::RuntimeException);
534 : : virtual void SAL_CALL removeRangeAddresses( const ::com::sun::star::uno::Sequence<
535 : : ::com::sun::star::table::CellRangeAddress >& rRanges )
536 : : throw(::com::sun::star::container::NoSuchElementException,
537 : : ::com::sun::star::uno::RuntimeException);
538 : :
539 : : // XNameContainer
540 : : virtual void SAL_CALL insertByName( const ::rtl::OUString& aName,
541 : : const ::com::sun::star::uno::Any& aElement )
542 : : throw(::com::sun::star::lang::IllegalArgumentException,
543 : : ::com::sun::star::container::ElementExistException,
544 : : ::com::sun::star::lang::WrappedTargetException,
545 : : ::com::sun::star::uno::RuntimeException);
546 : : virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
547 : : throw(::com::sun::star::container::NoSuchElementException,
548 : : ::com::sun::star::lang::WrappedTargetException,
549 : : ::com::sun::star::uno::RuntimeException);
550 : :
551 : : // XNameReplace
552 : : virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName,
553 : : const ::com::sun::star::uno::Any& aElement )
554 : : throw(::com::sun::star::lang::IllegalArgumentException,
555 : : ::com::sun::star::container::NoSuchElementException,
556 : : ::com::sun::star::lang::WrappedTargetException,
557 : : ::com::sun::star::uno::RuntimeException);
558 : :
559 : : // XNameAccess
560 : : virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
561 : : throw(::com::sun::star::container::NoSuchElementException,
562 : : ::com::sun::star::lang::WrappedTargetException,
563 : : ::com::sun::star::uno::RuntimeException);
564 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
565 : : throw(::com::sun::star::uno::RuntimeException);
566 : : virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
567 : : throw(::com::sun::star::uno::RuntimeException);
568 : :
569 : : // XIndexAccess
570 : : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
571 : : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
572 : : throw(::com::sun::star::lang::IndexOutOfBoundsException,
573 : : ::com::sun::star::lang::WrappedTargetException,
574 : : ::com::sun::star::uno::RuntimeException);
575 : :
576 : : // XElementAccess
577 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
578 : : throw(::com::sun::star::uno::RuntimeException);
579 : : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
580 : :
581 : : // XEnumerationAccess
582 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
583 : : createEnumeration() throw(::com::sun::star::uno::RuntimeException);
584 : :
585 : : // XServiceInfo
586 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
587 : : throw(::com::sun::star::uno::RuntimeException);
588 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
589 : : throw(::com::sun::star::uno::RuntimeException);
590 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
591 : : throw(::com::sun::star::uno::RuntimeException);
592 : :
593 : : // XTypeProvider
594 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
595 : : throw(::com::sun::star::uno::RuntimeException);
596 : : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
597 : : throw(::com::sun::star::uno::RuntimeException);
598 : : };
599 : :
600 : :
601 : : class SC_DLLPUBLIC ScCellRangeObj : public ScCellRangesBase,
602 : : public com::sun::star::sheet::XCellRangeAddressable,
603 : : public com::sun::star::sheet::XSheetCellRange,
604 : : public com::sun::star::sheet::XArrayFormulaRange,
605 : : public com::sun::star::sheet::XArrayFormulaTokens,
606 : : public com::sun::star::sheet::XCellRangeData,
607 : : public com::sun::star::sheet::XCellRangeFormula,
608 : : public com::sun::star::sheet::XMultipleOperation,
609 : : public com::sun::star::util::XMergeable,
610 : : public com::sun::star::sheet::XCellSeries,
611 : : public com::sun::star::table::XAutoFormattable,
612 : : public com::sun::star::util::XSortable,
613 : : public com::sun::star::sheet::XSheetFilterableEx,
614 : : public com::sun::star::sheet::XSubTotalCalculatable,
615 : : public com::sun::star::util::XImportable,
616 : : public com::sun::star::sheet::XCellFormatRangesSupplier,
617 : : public com::sun::star::sheet::XUniqueCellFormatRangesSupplier,
618 : : public com::sun::star::table::XColumnRowRange
619 : : {
620 : : private:
621 : : const SfxItemPropertySet* pRangePropSet;
622 : : ScRange aRange;
623 : :
624 : : protected:
625 : 48 : const ScRange& GetRange() const { return aRange; }
626 : : virtual const SfxItemPropertyMap& GetItemPropertyMap();
627 : : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
628 : : ::com::sun::star::uno::Any& )
629 : : throw(::com::sun::star::uno::RuntimeException);
630 : : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
631 : : const ::com::sun::star::uno::Any& aValue )
632 : : throw(::com::sun::star::lang::IllegalArgumentException,
633 : : ::com::sun::star::uno::RuntimeException);
634 : :
635 : : ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
636 : : GetCellByPosition_Impl( sal_Int32 nColumn, sal_Int32 nRow )
637 : : throw(::com::sun::star::lang::IndexOutOfBoundsException,
638 : : ::com::sun::star::uno::RuntimeException);
639 : :
640 : : void SetArrayFormula_Impl( const rtl::OUString& rFormula,
641 : : const rtl::OUString& rFormulaNmsp,
642 : : const formula::FormulaGrammar::Grammar eGrammar )
643 : : throw(::com::sun::star::uno::RuntimeException);
644 : :
645 : : public:
646 : : ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR);
647 : : virtual ~ScCellRangeObj();
648 : :
649 : : // uses ObjectShell from document, if set (returns NULL otherwise)
650 : : static com::sun::star::uno::Reference<com::sun::star::table::XCellRange>
651 : : CreateRangeFromDoc( ScDocument* pDoc, const ScRange& rR );
652 : :
653 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
654 : : const ::com::sun::star::uno::Type & rType )
655 : : throw(::com::sun::star::uno::RuntimeException);
656 : : virtual void SAL_CALL acquire() throw();
657 : : virtual void SAL_CALL release() throw();
658 : :
659 : : virtual void RefChanged();
660 : :
661 : : // via getImplementation()
662 : : virtual void SetArrayFormulaWithGrammar( const ::rtl::OUString& rFormula,
663 : : const ::rtl::OUString& rFormulaNmsp,
664 : : const formula::FormulaGrammar::Grammar )
665 : : throw(::com::sun::star::uno::RuntimeException);
666 : :
667 : : // XCellRangeAddressable
668 : : virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getRangeAddress()
669 : : throw(::com::sun::star::uno::RuntimeException);
670 : :
671 : : // XSheetCellRange
672 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > SAL_CALL
673 : : getSpreadsheet() throw(::com::sun::star::uno::RuntimeException);
674 : :
675 : : // XArrayFormulaRange
676 : : virtual ::rtl::OUString SAL_CALL getArrayFormula() throw(::com::sun::star::uno::RuntimeException);
677 : : virtual void SAL_CALL setArrayFormula( const ::rtl::OUString& aFormula )
678 : : throw(::com::sun::star::uno::RuntimeException);
679 : :
680 : : // XArrayFormulaTokens
681 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getArrayTokens()
682 : : throw (::com::sun::star::uno::RuntimeException);
683 : : virtual void SAL_CALL setArrayTokens( const ::com::sun::star::uno::Sequence<
684 : : ::com::sun::star::sheet::FormulaToken >& aTokens )
685 : : throw (::com::sun::star::uno::RuntimeException);
686 : :
687 : : // XCellRangeData
688 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence<
689 : : ::com::sun::star::uno::Any > > SAL_CALL getDataArray()
690 : : throw(::com::sun::star::uno::RuntimeException);
691 : : virtual void SAL_CALL setDataArray( const ::com::sun::star::uno::Sequence<
692 : : ::com::sun::star::uno::Sequence<
693 : : ::com::sun::star::uno::Any > >& aArray )
694 : : throw(::com::sun::star::uno::RuntimeException);
695 : :
696 : : // XCellRangeFormula
697 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence<
698 : : ::rtl::OUString > > SAL_CALL getFormulaArray()
699 : : throw (::com::sun::star::uno::RuntimeException);
700 : : virtual void SAL_CALL setFormulaArray( const ::com::sun::star::uno::Sequence<
701 : : ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aArray )
702 : : throw (::com::sun::star::uno::RuntimeException);
703 : :
704 : : // XMultipleOperation
705 : : virtual void SAL_CALL setTableOperation(
706 : : const ::com::sun::star::table::CellRangeAddress& aFormulaRange,
707 : : ::com::sun::star::sheet::TableOperationMode nMode,
708 : : const ::com::sun::star::table::CellAddress& aColumnCell,
709 : : const ::com::sun::star::table::CellAddress& aRowCell )
710 : : throw(::com::sun::star::uno::RuntimeException);
711 : :
712 : : // XMergeable
713 : : virtual void SAL_CALL merge( sal_Bool bMerge ) throw(::com::sun::star::uno::RuntimeException);
714 : : virtual sal_Bool SAL_CALL getIsMerged() throw(::com::sun::star::uno::RuntimeException);
715 : :
716 : : // XCellSeries
717 : : virtual void SAL_CALL fillSeries( ::com::sun::star::sheet::FillDirection nFillDirection,
718 : : ::com::sun::star::sheet::FillMode nFillMode,
719 : : ::com::sun::star::sheet::FillDateMode nFillDateMode,
720 : : double fStep, double fEndValue )
721 : : throw(::com::sun::star::uno::RuntimeException);
722 : : virtual void SAL_CALL fillAuto( ::com::sun::star::sheet::FillDirection nFillDirection,
723 : : sal_Int32 nSourceCount )
724 : : throw(::com::sun::star::uno::RuntimeException);
725 : :
726 : : // XAutoFormattable
727 : : virtual void SAL_CALL autoFormat( const ::rtl::OUString& aName )
728 : : throw(::com::sun::star::lang::IllegalArgumentException,
729 : : ::com::sun::star::uno::RuntimeException);
730 : :
731 : : // XSortable
732 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
733 : : createSortDescriptor() throw(::com::sun::star::uno::RuntimeException);
734 : : virtual void SAL_CALL sort( const ::com::sun::star::uno::Sequence<
735 : : ::com::sun::star::beans::PropertyValue >& xDescriptor )
736 : : throw(::com::sun::star::uno::RuntimeException);
737 : :
738 : : // XSheetFilterableEx
739 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
740 : : createFilterDescriptorByObject( const ::com::sun::star::uno::Reference<
741 : : ::com::sun::star::sheet::XSheetFilterable >& xObject )
742 : : throw(::com::sun::star::uno::RuntimeException);
743 : :
744 : : // XSheetFilterable
745 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
746 : : createFilterDescriptor( sal_Bool bEmpty )
747 : : throw(::com::sun::star::uno::RuntimeException);
748 : : virtual void SAL_CALL filter( const ::com::sun::star::uno::Reference<
749 : : ::com::sun::star::sheet::XSheetFilterDescriptor >& xDescriptor )
750 : : throw(::com::sun::star::uno::RuntimeException);
751 : :
752 : : // XSubTotalCalculatable
753 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSubTotalDescriptor > SAL_CALL
754 : : createSubTotalDescriptor( sal_Bool bEmpty )
755 : : throw(::com::sun::star::uno::RuntimeException);
756 : : virtual void SAL_CALL applySubTotals( const ::com::sun::star::uno::Reference<
757 : : ::com::sun::star::sheet::XSubTotalDescriptor >& xDescriptor,
758 : : sal_Bool bReplace ) throw(::com::sun::star::uno::RuntimeException);
759 : : virtual void SAL_CALL removeSubTotals() throw(::com::sun::star::uno::RuntimeException);
760 : :
761 : : // XImportable
762 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
763 : : createImportDescriptor( sal_Bool bEmpty )
764 : : throw(::com::sun::star::uno::RuntimeException);
765 : : virtual void SAL_CALL doImport( const ::com::sun::star::uno::Sequence<
766 : : ::com::sun::star::beans::PropertyValue >& aDescriptor )
767 : : throw(::com::sun::star::uno::RuntimeException);
768 : :
769 : : // XCellFormatRangesSupplier
770 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
771 : : getCellFormatRanges() throw(::com::sun::star::uno::RuntimeException);
772 : :
773 : : // XUniqueCellFormatRangesSupplier
774 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL
775 : : getUniqueCellFormatRanges() throw(::com::sun::star::uno::RuntimeException);
776 : :
777 : : // XColumnRowRange
778 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableColumns > SAL_CALL
779 : : getColumns() throw(::com::sun::star::uno::RuntimeException);
780 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL
781 : : getRows() throw(::com::sun::star::uno::RuntimeException);
782 : :
783 : : // XCellRange
784 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL
785 : : getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow )
786 : : throw(::com::sun::star::lang::IndexOutOfBoundsException,
787 : : ::com::sun::star::uno::RuntimeException);
788 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
789 : : getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
790 : : sal_Int32 nRight, sal_Int32 nBottom )
791 : : throw(::com::sun::star::lang::IndexOutOfBoundsException,
792 : : ::com::sun::star::uno::RuntimeException);
793 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
794 : : getCellRangeByName( const ::rtl::OUString& aRange )
795 : : throw(::com::sun::star::uno::RuntimeException);
796 : : ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
797 : : getCellRangeByName( const ::rtl::OUString& aRange, const ScAddress::Details& rDetails )
798 : : throw(::com::sun::star::uno::RuntimeException);
799 : :
800 : : // XPropertySet overloaded due to Range-Properties
801 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
802 : : SAL_CALL getPropertySetInfo()
803 : : throw(::com::sun::star::uno::RuntimeException);
804 : :
805 : : // XServiceInfo
806 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
807 : : throw(::com::sun::star::uno::RuntimeException);
808 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
809 : : throw(::com::sun::star::uno::RuntimeException);
810 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
811 : : throw(::com::sun::star::uno::RuntimeException);
812 : :
813 : : // XTypeProvider
814 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
815 : : throw(::com::sun::star::uno::RuntimeException);
816 : : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
817 : : throw(::com::sun::star::uno::RuntimeException);
818 : : };
819 : :
820 : :
821 : : //! really derive cell from range?
822 : :
823 : : class SC_DLLPUBLIC ScCellObj : public ScCellRangeObj,
824 : : public com::sun::star::text::XText,
825 : : public com::sun::star::container::XEnumerationAccess,
826 : : public com::sun::star::table::XCell2,
827 : : public com::sun::star::sheet::XFormulaTokens,
828 : : public com::sun::star::sheet::XCellAddressable,
829 : : public com::sun::star::sheet::XSheetAnnotationAnchor,
830 : : public com::sun::star::text::XTextFieldsSupplier,
831 : : public com::sun::star::document::XActionLockable
832 : : {
833 : : private:
834 : : rtl::Reference<SvxUnoText> mxUnoText;
835 : : const SfxItemPropertySet* pCellPropSet;
836 : : ScAddress aCellPos;
837 : : sal_Int16 nActionLockCount;
838 : :
839 : : private:
840 : : String GetInputString_Impl(sal_Bool bEnglish) const;
841 : : String GetOutputString_Impl() const;
842 : : void SetString_Impl(const String& rString, sal_Bool bInterpret, sal_Bool bEnglish);
843 : : double GetValue_Impl() const;
844 : : void SetValue_Impl(double fValue);
845 : : com::sun::star::table::CellContentType GetResultType_Impl();
846 : :
847 : : protected:
848 : : virtual const SfxItemPropertyMap& GetItemPropertyMap();
849 : : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
850 : : ::com::sun::star::uno::Any& )
851 : : throw(::com::sun::star::uno::RuntimeException);
852 : : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
853 : : const ::com::sun::star::uno::Any& aValue )
854 : : throw(::com::sun::star::lang::IllegalArgumentException,
855 : : ::com::sun::star::uno::RuntimeException);
856 : :
857 : : public:
858 : : static const SvxItemPropertySet* GetEditPropertySet();
859 : : static const SfxItemPropertyMap& GetCellPropertyMap();
860 : :
861 : : ScCellObj(ScDocShell* pDocSh, const ScAddress& rP);
862 : : virtual ~ScCellObj();
863 : :
864 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
865 : : const ::com::sun::star::uno::Type & rType )
866 : : throw(::com::sun::star::uno::RuntimeException);
867 : : virtual void SAL_CALL acquire() throw();
868 : : virtual void SAL_CALL release() throw();
869 : :
870 : : virtual void RefChanged();
871 : :
872 : : SvxUnoText& GetUnoText();
873 : :
874 : : // XML import needs to set results at formula cells,
875 : : // not meant for any other purpose.
876 : 3 : const ScAddress& GetPosition() const { return aCellPos; }
877 : :
878 : : void InputEnglishString( const ::rtl::OUString& rText );
879 : :
880 : : // XText
881 : : virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference<
882 : : ::com::sun::star::text::XTextRange >& xRange,
883 : : const ::com::sun::star::uno::Reference<
884 : : ::com::sun::star::text::XTextContent >& xContent,
885 : : sal_Bool bAbsorb )
886 : : throw(::com::sun::star::lang::IllegalArgumentException,
887 : : ::com::sun::star::uno::RuntimeException);
888 : : virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference<
889 : : ::com::sun::star::text::XTextContent >& xContent )
890 : : throw(::com::sun::star::container::NoSuchElementException,
891 : : ::com::sun::star::uno::RuntimeException);
892 : :
893 : : // XSimpleText
894 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
895 : : createTextCursor() throw(::com::sun::star::uno::RuntimeException);
896 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
897 : : createTextCursorByRange( const ::com::sun::star::uno::Reference<
898 : : ::com::sun::star::text::XTextRange >& aTextPosition )
899 : : throw(::com::sun::star::uno::RuntimeException);
900 : : virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference<
901 : : ::com::sun::star::text::XTextRange >& xRange,
902 : : const ::rtl::OUString& aString, sal_Bool bAbsorb )
903 : : throw(::com::sun::star::uno::RuntimeException);
904 : : virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference<
905 : : ::com::sun::star::text::XTextRange >& xRange,
906 : : sal_Int16 nControlCharacter, sal_Bool bAbsorb )
907 : : throw(::com::sun::star::lang::IllegalArgumentException,
908 : : ::com::sun::star::uno::RuntimeException);
909 : :
910 : : // XTextRange
911 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL
912 : : getText() throw(::com::sun::star::uno::RuntimeException);
913 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
914 : : getStart() throw(::com::sun::star::uno::RuntimeException);
915 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
916 : : getEnd() throw(::com::sun::star::uno::RuntimeException);
917 : : virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
918 : : virtual void SAL_CALL setString( const ::rtl::OUString& aString )
919 : : throw(::com::sun::star::uno::RuntimeException);
920 : :
921 : : // XEnumerationAccess
922 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
923 : : createEnumeration() throw(::com::sun::star::uno::RuntimeException);
924 : :
925 : : // XElementAccess
926 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
927 : : throw(::com::sun::star::uno::RuntimeException);
928 : : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
929 : :
930 : : // XCell
931 : : virtual ::rtl::OUString SAL_CALL getFormula() throw(::com::sun::star::uno::RuntimeException);
932 : : virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula )
933 : : throw(::com::sun::star::uno::RuntimeException);
934 : : virtual void SAL_CALL setFormulaResult( double nValue )
935 : : throw(::com::sun::star::uno::RuntimeException);
936 : : virtual void SAL_CALL setFormulaString( const ::rtl::OUString& aFormula )
937 : : throw(::com::sun::star::uno::RuntimeException);
938 : : virtual double SAL_CALL getValue() throw(::com::sun::star::uno::RuntimeException);
939 : : virtual void SAL_CALL setValue( double nValue ) throw(::com::sun::star::uno::RuntimeException);
940 : : virtual ::com::sun::star::table::CellContentType SAL_CALL getType()
941 : : throw(::com::sun::star::uno::RuntimeException);
942 : : virtual sal_Int32 SAL_CALL getError() throw(::com::sun::star::uno::RuntimeException);
943 : :
944 : : // XFormulaTokens
945 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getTokens()
946 : : throw (::com::sun::star::uno::RuntimeException);
947 : : virtual void SAL_CALL setTokens( const ::com::sun::star::uno::Sequence<
948 : : ::com::sun::star::sheet::FormulaToken >& aTokens )
949 : : throw (::com::sun::star::uno::RuntimeException);
950 : :
951 : : // XCellAddressable
952 : : virtual ::com::sun::star::table::CellAddress SAL_CALL getCellAddress()
953 : : throw(::com::sun::star::uno::RuntimeException);
954 : :
955 : : // XSheetAnnotationAnchor
956 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetAnnotation > SAL_CALL
957 : : getAnnotation() throw(::com::sun::star::uno::RuntimeException);
958 : :
959 : : // XTextFieldsSupplier
960 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL
961 : : getTextFields() throw(::com::sun::star::uno::RuntimeException);
962 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
963 : : getTextFieldMasters() throw(::com::sun::star::uno::RuntimeException);
964 : :
965 : : // XPropertySet overloaded due to cell properties
966 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
967 : : SAL_CALL getPropertySetInfo()
968 : : throw(::com::sun::star::uno::RuntimeException);
969 : :
970 : : // XServiceInfo
971 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
972 : : throw(::com::sun::star::uno::RuntimeException);
973 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
974 : : throw(::com::sun::star::uno::RuntimeException);
975 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
976 : : throw(::com::sun::star::uno::RuntimeException);
977 : :
978 : : // XTypeProvider
979 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
980 : : throw(::com::sun::star::uno::RuntimeException);
981 : : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
982 : : throw(::com::sun::star::uno::RuntimeException);
983 : :
984 : : // XActionLockable
985 : : virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException);
986 : : virtual void SAL_CALL addActionLock() throw(::com::sun::star::uno::RuntimeException);
987 : : virtual void SAL_CALL removeActionLock() throw(::com::sun::star::uno::RuntimeException);
988 : : virtual void SAL_CALL setActionLocks( sal_Int16 nLock )
989 : : throw(::com::sun::star::uno::RuntimeException);
990 : : virtual sal_Int16 SAL_CALL resetActionLocks() throw(::com::sun::star::uno::RuntimeException);
991 : :
992 : : static String GetOutputString_Impl(ScDocument* pDoc, const ScAddress& aPos);
993 : : };
994 : :
995 : :
996 : : class ScTableSheetObj : public ScCellRangeObj,
997 : : public com::sun::star::sheet::XSpreadsheet,
998 : : public com::sun::star::container::XNamed,
999 : : public com::sun::star::sheet::XSheetPageBreak,
1000 : : public com::sun::star::sheet::XCellRangeMovement,
1001 : : public com::sun::star::table::XTableChartsSupplier,
1002 : : public com::sun::star::sheet::XDataPilotTablesSupplier,
1003 : : public com::sun::star::sheet::XScenariosSupplier,
1004 : : public com::sun::star::sheet::XSheetAnnotationsSupplier,
1005 : : public com::sun::star::drawing::XDrawPageSupplier,
1006 : : public com::sun::star::sheet::XPrintAreas,
1007 : : public com::sun::star::sheet::XSheetLinkable,
1008 : : public com::sun::star::sheet::XSheetAuditing,
1009 : : public com::sun::star::sheet::XSheetOutline,
1010 : : public com::sun::star::util::XProtectable,
1011 : : public com::sun::star::sheet::XScenario,
1012 : : public com::sun::star::sheet::XScenarioEnhanced,
1013 : : public com::sun::star::sheet::XExternalSheetName,
1014 : : public com::sun::star::document::XEventsSupplier
1015 : : {
1016 : : friend class ScTableSheetsObj; // for insertByName()
1017 : :
1018 : : private:
1019 : : const SfxItemPropertySet* pSheetPropSet;
1020 : :
1021 : : SCTAB GetTab_Impl() const;
1022 : : void PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges );
1023 : :
1024 : : protected:
1025 : : virtual const SfxItemPropertyMap& GetItemPropertyMap();
1026 : : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1027 : : ::com::sun::star::uno::Any& )
1028 : : throw(::com::sun::star::uno::RuntimeException);
1029 : : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1030 : : const ::com::sun::star::uno::Any& aValue )
1031 : : throw(::com::sun::star::lang::IllegalArgumentException,
1032 : : ::com::sun::star::uno::RuntimeException);
1033 : :
1034 : : public:
1035 : : ScTableSheetObj(ScDocShell* pDocSh, SCTAB nTab);
1036 : : virtual ~ScTableSheetObj();
1037 : :
1038 : : void InitInsertSheet(ScDocShell* pDocSh, SCTAB nTab);
1039 : :
1040 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
1041 : : const ::com::sun::star::uno::Type & rType )
1042 : : throw(::com::sun::star::uno::RuntimeException);
1043 : : virtual void SAL_CALL acquire() throw();
1044 : : virtual void SAL_CALL release() throw();
1045 : :
1046 : : // XSpreadsheet
1047 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellCursor >
1048 : : SAL_CALL createCursor() throw(::com::sun::star::uno::RuntimeException);
1049 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellCursor > SAL_CALL
1050 : : createCursorByRange( const ::com::sun::star::uno::Reference<
1051 : : ::com::sun::star::sheet::XSheetCellRange >& aRange )
1052 : : throw(::com::sun::star::uno::RuntimeException);
1053 : :
1054 : : // XSheetCellRange
1055 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > SAL_CALL
1056 : : getSpreadsheet() throw(::com::sun::star::uno::RuntimeException);
1057 : :
1058 : : // XCellRange
1059 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > SAL_CALL
1060 : : getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow )
1061 : : throw(::com::sun::star::lang::IndexOutOfBoundsException,
1062 : : ::com::sun::star::uno::RuntimeException);
1063 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
1064 : : getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop,
1065 : : sal_Int32 nRight, sal_Int32 nBottom )
1066 : : throw(::com::sun::star::lang::IndexOutOfBoundsException,
1067 : : ::com::sun::star::uno::RuntimeException);
1068 : : using ScCellRangeObj::getCellRangeByName;
1069 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
1070 : : getCellRangeByName( const ::rtl::OUString& aRange )
1071 : : throw(::com::sun::star::uno::RuntimeException);
1072 : :
1073 : : // XNamed
1074 : : virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
1075 : : virtual void SAL_CALL setName( const ::rtl::OUString& aName )
1076 : : throw(::com::sun::star::uno::RuntimeException);
1077 : :
1078 : : // XSheetPageBreak
1079 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TablePageBreakData > SAL_CALL
1080 : : getColumnPageBreaks() throw(::com::sun::star::uno::RuntimeException);
1081 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TablePageBreakData > SAL_CALL
1082 : : getRowPageBreaks() throw(::com::sun::star::uno::RuntimeException);
1083 : : virtual void SAL_CALL removeAllManualPageBreaks() throw(::com::sun::star::uno::RuntimeException);
1084 : :
1085 : : // XCellRangeMovement
1086 : : virtual void SAL_CALL insertCells( const ::com::sun::star::table::CellRangeAddress& aRange,
1087 : : ::com::sun::star::sheet::CellInsertMode nMode )
1088 : : throw(::com::sun::star::uno::RuntimeException);
1089 : : virtual void SAL_CALL removeRange( const ::com::sun::star::table::CellRangeAddress& aRange,
1090 : : ::com::sun::star::sheet::CellDeleteMode nMode )
1091 : : throw(::com::sun::star::uno::RuntimeException);
1092 : : virtual void SAL_CALL moveRange( const ::com::sun::star::table::CellAddress& aDestination,
1093 : : const ::com::sun::star::table::CellRangeAddress& aSource )
1094 : : throw(::com::sun::star::uno::RuntimeException);
1095 : : virtual void SAL_CALL copyRange( const ::com::sun::star::table::CellAddress& aDestination,
1096 : : const ::com::sun::star::table::CellRangeAddress& aSource )
1097 : : throw(::com::sun::star::uno::RuntimeException);
1098 : :
1099 : : // XTableChartsSupplier
1100 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableCharts > SAL_CALL
1101 : : getCharts() throw(::com::sun::star::uno::RuntimeException);
1102 : :
1103 : : // XDataPilotTablesSupplier
1104 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDataPilotTables > SAL_CALL
1105 : : getDataPilotTables() throw(::com::sun::star::uno::RuntimeException);
1106 : :
1107 : : // XScenariosSupplier
1108 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XScenarios > SAL_CALL
1109 : : getScenarios() throw(::com::sun::star::uno::RuntimeException);
1110 : :
1111 : : // XSheetAnnotationsSupplier
1112 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetAnnotations > SAL_CALL
1113 : : getAnnotations() throw(::com::sun::star::uno::RuntimeException);
1114 : :
1115 : : // XDrawPageSupplier
1116 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL
1117 : : getDrawPage() throw(::com::sun::star::uno::RuntimeException);
1118 : :
1119 : : // XPrintAreas
1120 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
1121 : : getPrintAreas() throw(::com::sun::star::uno::RuntimeException);
1122 : : virtual void SAL_CALL setPrintAreas( const ::com::sun::star::uno::Sequence<
1123 : : ::com::sun::star::table::CellRangeAddress >& aPrintAreas )
1124 : : throw(::com::sun::star::uno::RuntimeException);
1125 : : virtual sal_Bool SAL_CALL getPrintTitleColumns() throw(::com::sun::star::uno::RuntimeException);
1126 : : virtual void SAL_CALL setPrintTitleColumns( sal_Bool bPrintTitleColumns )
1127 : : throw(::com::sun::star::uno::RuntimeException);
1128 : : virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getTitleColumns()
1129 : : throw(::com::sun::star::uno::RuntimeException);
1130 : : virtual void SAL_CALL setTitleColumns(
1131 : : const ::com::sun::star::table::CellRangeAddress& aTitleColumns )
1132 : : throw(::com::sun::star::uno::RuntimeException);
1133 : : virtual sal_Bool SAL_CALL getPrintTitleRows() throw(::com::sun::star::uno::RuntimeException);
1134 : : virtual void SAL_CALL setPrintTitleRows( sal_Bool bPrintTitleRows )
1135 : : throw(::com::sun::star::uno::RuntimeException);
1136 : : virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getTitleRows()
1137 : : throw(::com::sun::star::uno::RuntimeException);
1138 : : virtual void SAL_CALL setTitleRows(
1139 : : const ::com::sun::star::table::CellRangeAddress& aTitleRows )
1140 : : throw(::com::sun::star::uno::RuntimeException);
1141 : :
1142 : : // XSheetLinkable
1143 : : virtual ::com::sun::star::sheet::SheetLinkMode SAL_CALL getLinkMode()
1144 : : throw(::com::sun::star::uno::RuntimeException);
1145 : : virtual void SAL_CALL setLinkMode( ::com::sun::star::sheet::SheetLinkMode nLinkMode )
1146 : : throw(::com::sun::star::uno::RuntimeException);
1147 : : virtual ::rtl::OUString SAL_CALL getLinkUrl() throw(::com::sun::star::uno::RuntimeException);
1148 : : virtual void SAL_CALL setLinkUrl( const ::rtl::OUString& aLinkUrl )
1149 : : throw(::com::sun::star::uno::RuntimeException);
1150 : : virtual ::rtl::OUString SAL_CALL getLinkSheetName() throw(::com::sun::star::uno::RuntimeException);
1151 : : virtual void SAL_CALL setLinkSheetName( const ::rtl::OUString& aLinkSheetName )
1152 : : throw(::com::sun::star::uno::RuntimeException);
1153 : : virtual void SAL_CALL link( const ::rtl::OUString& aUrl,
1154 : : const ::rtl::OUString& aSheetName,
1155 : : const ::rtl::OUString& aFilterName,
1156 : : const ::rtl::OUString& aFilterOptions,
1157 : : ::com::sun::star::sheet::SheetLinkMode nMode )
1158 : : throw(::com::sun::star::uno::RuntimeException);
1159 : :
1160 : : // XSheetAuditing
1161 : : virtual sal_Bool SAL_CALL hideDependents( const ::com::sun::star::table::CellAddress& aPosition )
1162 : : throw(::com::sun::star::uno::RuntimeException);
1163 : : virtual sal_Bool SAL_CALL hidePrecedents( const ::com::sun::star::table::CellAddress& aPosition )
1164 : : throw(::com::sun::star::uno::RuntimeException);
1165 : : virtual sal_Bool SAL_CALL showDependents( const ::com::sun::star::table::CellAddress& aPosition )
1166 : : throw(::com::sun::star::uno::RuntimeException);
1167 : : virtual sal_Bool SAL_CALL showPrecedents( const ::com::sun::star::table::CellAddress& aPosition )
1168 : : throw(::com::sun::star::uno::RuntimeException);
1169 : : virtual sal_Bool SAL_CALL showErrors( const ::com::sun::star::table::CellAddress& aPosition )
1170 : : throw(::com::sun::star::uno::RuntimeException);
1171 : : virtual sal_Bool SAL_CALL showInvalid() throw(::com::sun::star::uno::RuntimeException);
1172 : : virtual void SAL_CALL clearArrows() throw(::com::sun::star::uno::RuntimeException);
1173 : :
1174 : : // XSheetOutline
1175 : : virtual void SAL_CALL group( const ::com::sun::star::table::CellRangeAddress& aRange,
1176 : : ::com::sun::star::table::TableOrientation nOrientation )
1177 : : throw(::com::sun::star::uno::RuntimeException);
1178 : : virtual void SAL_CALL ungroup( const ::com::sun::star::table::CellRangeAddress& aRange,
1179 : : ::com::sun::star::table::TableOrientation nOrientation )
1180 : : throw(::com::sun::star::uno::RuntimeException);
1181 : : virtual void SAL_CALL autoOutline( const ::com::sun::star::table::CellRangeAddress& aRange )
1182 : : throw(::com::sun::star::uno::RuntimeException);
1183 : : virtual void SAL_CALL clearOutline() throw(::com::sun::star::uno::RuntimeException);
1184 : : virtual void SAL_CALL hideDetail( const ::com::sun::star::table::CellRangeAddress& aRange )
1185 : : throw(::com::sun::star::uno::RuntimeException);
1186 : : virtual void SAL_CALL showDetail( const ::com::sun::star::table::CellRangeAddress& aRange )
1187 : : throw(::com::sun::star::uno::RuntimeException);
1188 : : virtual void SAL_CALL showLevel( sal_Int16 nLevel,
1189 : : ::com::sun::star::table::TableOrientation nOrientation )
1190 : : throw(::com::sun::star::uno::RuntimeException);
1191 : :
1192 : : // XProtectable
1193 : : virtual void SAL_CALL protect( const ::rtl::OUString& aPassword )
1194 : : throw(::com::sun::star::uno::RuntimeException);
1195 : : virtual void SAL_CALL unprotect( const ::rtl::OUString& aPassword )
1196 : : throw(::com::sun::star::lang::IllegalArgumentException,
1197 : : ::com::sun::star::uno::RuntimeException);
1198 : : virtual sal_Bool SAL_CALL isProtected() throw(::com::sun::star::uno::RuntimeException);
1199 : :
1200 : : // XScenario
1201 : : virtual sal_Bool SAL_CALL getIsScenario() throw(::com::sun::star::uno::RuntimeException);
1202 : : virtual ::rtl::OUString SAL_CALL getScenarioComment() throw(::com::sun::star::uno::RuntimeException);
1203 : : virtual void SAL_CALL setScenarioComment( const ::rtl::OUString& aScenarioComment )
1204 : : throw(::com::sun::star::uno::RuntimeException);
1205 : : virtual void SAL_CALL addRanges( const ::com::sun::star::uno::Sequence<
1206 : : ::com::sun::star::table::CellRangeAddress >& aRanges )
1207 : : throw(::com::sun::star::uno::RuntimeException);
1208 : : virtual void SAL_CALL apply() throw(::com::sun::star::uno::RuntimeException);
1209 : : // XScenarioEnhanced
1210 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
1211 : : getRanges( )
1212 : : throw(::com::sun::star::uno::RuntimeException);
1213 : :
1214 : : // XExternalSheetName
1215 : : virtual void SAL_CALL setExternalName( const ::rtl::OUString& aUrl, const ::rtl::OUString& aSheetName )
1216 : : throw (::com::sun::star::container::ElementExistException,
1217 : : ::com::sun::star::uno::RuntimeException);
1218 : :
1219 : : // XEventsSupplier
1220 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents()
1221 : : throw (::com::sun::star::uno::RuntimeException);
1222 : :
1223 : : // XPropertySet overloaded due to sheet properties
1224 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1225 : : SAL_CALL getPropertySetInfo()
1226 : : throw(::com::sun::star::uno::RuntimeException);
1227 : :
1228 : : // XServiceInfo
1229 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1230 : : throw(::com::sun::star::uno::RuntimeException);
1231 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1232 : : throw(::com::sun::star::uno::RuntimeException);
1233 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1234 : : throw(::com::sun::star::uno::RuntimeException);
1235 : :
1236 : : // XUnoTunnel
1237 : : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
1238 : : sal_Int8 >& aIdentifier )
1239 : : throw(::com::sun::star::uno::RuntimeException);
1240 : :
1241 : : static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
1242 : : static ScTableSheetObj* getImplementation( const com::sun::star::uno::Reference<
1243 : : com::sun::star::uno::XInterface> xObj );
1244 : :
1245 : : // XTypeProvider
1246 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
1247 : : throw(::com::sun::star::uno::RuntimeException);
1248 : : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
1249 : : throw(::com::sun::star::uno::RuntimeException);
1250 : : };
1251 : :
1252 : :
1253 : : class ScTableColumnObj : public ScCellRangeObj,
1254 : : public com::sun::star::container::XNamed
1255 : : {
1256 : : private:
1257 : : const SfxItemPropertySet* pColPropSet;
1258 : :
1259 : : protected:
1260 : : virtual const SfxItemPropertyMap& GetItemPropertyMap();
1261 : : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1262 : : ::com::sun::star::uno::Any& )
1263 : : throw(::com::sun::star::uno::RuntimeException);
1264 : : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1265 : : const ::com::sun::star::uno::Any& aValue )
1266 : : throw(::com::sun::star::lang::IllegalArgumentException,
1267 : : ::com::sun::star::uno::RuntimeException);
1268 : :
1269 : : public:
1270 : : ScTableColumnObj(ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab);
1271 : : virtual ~ScTableColumnObj();
1272 : :
1273 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
1274 : : const ::com::sun::star::uno::Type & rType )
1275 : : throw(::com::sun::star::uno::RuntimeException);
1276 : : virtual void SAL_CALL acquire() throw();
1277 : : virtual void SAL_CALL release() throw();
1278 : :
1279 : : // XNamed
1280 : : virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
1281 : : virtual void SAL_CALL setName( const ::rtl::OUString& aName )
1282 : : throw(::com::sun::star::uno::RuntimeException);
1283 : :
1284 : : // XPropertySet overloaded due to column properties
1285 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1286 : : SAL_CALL getPropertySetInfo()
1287 : : throw(::com::sun::star::uno::RuntimeException);
1288 : :
1289 : : // XServiceInfo
1290 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1291 : : throw(::com::sun::star::uno::RuntimeException);
1292 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1293 : : throw(::com::sun::star::uno::RuntimeException);
1294 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1295 : : throw(::com::sun::star::uno::RuntimeException);
1296 : :
1297 : : // XTypeProvider
1298 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
1299 : : throw(::com::sun::star::uno::RuntimeException);
1300 : : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
1301 : : throw(::com::sun::star::uno::RuntimeException);
1302 : : };
1303 : :
1304 : :
1305 : : class ScTableRowObj : public ScCellRangeObj
1306 : : {
1307 : : private:
1308 : : const SfxItemPropertySet* pRowPropSet;
1309 : :
1310 : : protected:
1311 : : virtual const SfxItemPropertyMap& GetItemPropertyMap();
1312 : : virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1313 : : ::com::sun::star::uno::Any& )
1314 : : throw(::com::sun::star::uno::RuntimeException);
1315 : : virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
1316 : : const ::com::sun::star::uno::Any& aValue )
1317 : : throw(::com::sun::star::lang::IllegalArgumentException,
1318 : : ::com::sun::star::uno::RuntimeException);
1319 : :
1320 : : public:
1321 : : ScTableRowObj(ScDocShell* pDocSh, SCROW nRow, SCTAB nTab);
1322 : : virtual ~ScTableRowObj();
1323 : :
1324 : : // XPropertySet overloaded due to row properties
1325 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
1326 : : SAL_CALL getPropertySetInfo()
1327 : : throw(::com::sun::star::uno::RuntimeException);
1328 : :
1329 : : // XServiceInfo
1330 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1331 : : throw(::com::sun::star::uno::RuntimeException);
1332 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1333 : : throw(::com::sun::star::uno::RuntimeException);
1334 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1335 : : throw(::com::sun::star::uno::RuntimeException);
1336 : : };
1337 : :
1338 : :
1339 : : class ScCellsObj : public cppu::WeakImplHelper2<
1340 : : com::sun::star::container::XEnumerationAccess,
1341 : : com::sun::star::lang::XServiceInfo >,
1342 : : public SfxListener
1343 : : {
1344 : : private:
1345 : : ScDocShell* pDocShell;
1346 : : ScRangeList aRanges;
1347 : :
1348 : : public:
1349 : : ScCellsObj(ScDocShell* pDocSh, const ScRangeList& rR);
1350 : : virtual ~ScCellsObj();
1351 : :
1352 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1353 : :
1354 : : // XEnumerationAccess
1355 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1356 : : createEnumeration() throw(::com::sun::star::uno::RuntimeException);
1357 : :
1358 : : // XElementAccess
1359 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1360 : : throw(::com::sun::star::uno::RuntimeException);
1361 : : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
1362 : :
1363 : : // XServiceInfo
1364 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1365 : : throw(::com::sun::star::uno::RuntimeException);
1366 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1367 : : throw(::com::sun::star::uno::RuntimeException);
1368 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1369 : : throw(::com::sun::star::uno::RuntimeException);
1370 : : };
1371 : :
1372 : :
1373 : : class ScCellsEnumeration : public cppu::WeakImplHelper2<
1374 : : com::sun::star::container::XEnumeration,
1375 : : com::sun::star::lang::XServiceInfo >,
1376 : : public SfxListener
1377 : : {
1378 : : private:
1379 : : ScDocShell* pDocShell;
1380 : : ScRangeList aRanges;
1381 : : ScAddress aPos;
1382 : : ScMarkData* pMark;
1383 : : sal_Bool bAtEnd;
1384 : :
1385 : : private:
1386 : : void Advance_Impl();
1387 : : void CheckPos_Impl();
1388 : :
1389 : : public:
1390 : : ScCellsEnumeration(ScDocShell* pDocSh, const ScRangeList& rR);
1391 : : virtual ~ScCellsEnumeration();
1392 : :
1393 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1394 : :
1395 : : // XEnumeration
1396 : : virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException);
1397 : : virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1398 : : throw(::com::sun::star::container::NoSuchElementException,
1399 : : ::com::sun::star::lang::WrappedTargetException,
1400 : : ::com::sun::star::uno::RuntimeException);
1401 : :
1402 : : // XServiceInfo
1403 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1404 : : throw(::com::sun::star::uno::RuntimeException);
1405 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1406 : : throw(::com::sun::star::uno::RuntimeException);
1407 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1408 : : throw(::com::sun::star::uno::RuntimeException);
1409 : : };
1410 : :
1411 : : class ScCellFormatsObj : public cppu::WeakImplHelper3<
1412 : : com::sun::star::container::XIndexAccess,
1413 : : com::sun::star::container::XEnumerationAccess,
1414 : : com::sun::star::lang::XServiceInfo >,
1415 : : public SfxListener
1416 : : {
1417 : : private:
1418 : : ScDocShell* pDocShell;
1419 : : ScRange aTotalRange;
1420 : :
1421 : : private:
1422 : : ScCellRangeObj* GetObjectByIndex_Impl(long nIndex) const;
1423 : :
1424 : : public:
1425 : : ScCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
1426 : : virtual ~ScCellFormatsObj();
1427 : :
1428 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1429 : :
1430 : : // XIndexAccess
1431 : : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
1432 : : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
1433 : : throw(::com::sun::star::lang::IndexOutOfBoundsException,
1434 : : ::com::sun::star::lang::WrappedTargetException,
1435 : : ::com::sun::star::uno::RuntimeException);
1436 : :
1437 : : // XEnumerationAccess
1438 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1439 : : createEnumeration() throw(::com::sun::star::uno::RuntimeException);
1440 : :
1441 : : // XElementAccess
1442 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1443 : : throw(::com::sun::star::uno::RuntimeException);
1444 : : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
1445 : :
1446 : : // XServiceInfo
1447 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1448 : : throw(::com::sun::star::uno::RuntimeException);
1449 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1450 : : throw(::com::sun::star::uno::RuntimeException);
1451 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1452 : : throw(::com::sun::star::uno::RuntimeException);
1453 : : };
1454 : :
1455 : :
1456 : : class ScCellFormatsEnumeration : public cppu::WeakImplHelper2<
1457 : : com::sun::star::container::XEnumeration,
1458 : : com::sun::star::lang::XServiceInfo >,
1459 : : public SfxListener
1460 : : {
1461 : : private:
1462 : : ScDocShell* pDocShell;
1463 : : SCTAB nTab;
1464 : : ScAttrRectIterator* pIter;
1465 : : ScRange aNext;
1466 : : sal_Bool bAtEnd;
1467 : : sal_Bool bDirty;
1468 : :
1469 : : private:
1470 : : void Advance_Impl();
1471 : : ScCellRangeObj* NextObject_Impl();
1472 : :
1473 : : public:
1474 : : ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScRange& rR);
1475 : : virtual ~ScCellFormatsEnumeration();
1476 : :
1477 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1478 : :
1479 : : // XEnumeration
1480 : : virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException);
1481 : : virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1482 : : throw(::com::sun::star::container::NoSuchElementException,
1483 : : ::com::sun::star::lang::WrappedTargetException,
1484 : : ::com::sun::star::uno::RuntimeException);
1485 : :
1486 : : // XServiceInfo
1487 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1488 : : throw(::com::sun::star::uno::RuntimeException);
1489 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1490 : : throw(::com::sun::star::uno::RuntimeException);
1491 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1492 : : throw(::com::sun::star::uno::RuntimeException);
1493 : : };
1494 : :
1495 : : typedef std::vector< ScRangeList > ScMyRangeLists;
1496 : :
1497 : : class ScUniqueCellFormatsObj : public cppu::WeakImplHelper3<
1498 : : com::sun::star::container::XIndexAccess,
1499 : : com::sun::star::container::XEnumerationAccess,
1500 : : com::sun::star::lang::XServiceInfo >,
1501 : : public SfxListener
1502 : : {
1503 : : private:
1504 : : ScDocShell* pDocShell;
1505 : : ScRange aTotalRange;
1506 : : ScMyRangeLists aRangeLists;
1507 : :
1508 : : private:
1509 : : void GetObjects_Impl();
1510 : :
1511 : : public:
1512 : : ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR);
1513 : : virtual ~ScUniqueCellFormatsObj();
1514 : :
1515 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1516 : :
1517 : : // XIndexAccess
1518 : : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
1519 : : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
1520 : : throw(::com::sun::star::lang::IndexOutOfBoundsException,
1521 : : ::com::sun::star::lang::WrappedTargetException,
1522 : : ::com::sun::star::uno::RuntimeException);
1523 : :
1524 : : // XEnumerationAccess
1525 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
1526 : : createEnumeration() throw(::com::sun::star::uno::RuntimeException);
1527 : :
1528 : : // XElementAccess
1529 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
1530 : : throw(::com::sun::star::uno::RuntimeException);
1531 : : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
1532 : :
1533 : : // XServiceInfo
1534 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1535 : : throw(::com::sun::star::uno::RuntimeException);
1536 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1537 : : throw(::com::sun::star::uno::RuntimeException);
1538 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1539 : : throw(::com::sun::star::uno::RuntimeException);
1540 : : };
1541 : :
1542 : : class ScUniqueCellFormatsEnumeration : public cppu::WeakImplHelper2<
1543 : : com::sun::star::container::XEnumeration,
1544 : : com::sun::star::lang::XServiceInfo >,
1545 : : public SfxListener
1546 : : {
1547 : : private:
1548 : : ScMyRangeLists aRangeLists;
1549 : : ScDocShell* pDocShell;
1550 : : sal_Int32 nCurrentPosition;
1551 : :
1552 : : public:
1553 : : ScUniqueCellFormatsEnumeration(ScDocShell* pDocShell, const ScMyRangeLists& rRangeLists);
1554 : : virtual ~ScUniqueCellFormatsEnumeration();
1555 : :
1556 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
1557 : :
1558 : : // XEnumeration
1559 : : virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException);
1560 : : virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
1561 : : throw(::com::sun::star::container::NoSuchElementException,
1562 : : ::com::sun::star::lang::WrappedTargetException,
1563 : : ::com::sun::star::uno::RuntimeException);
1564 : :
1565 : : // XServiceInfo
1566 : : virtual ::rtl::OUString SAL_CALL getImplementationName()
1567 : : throw(::com::sun::star::uno::RuntimeException);
1568 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
1569 : : throw(::com::sun::star::uno::RuntimeException);
1570 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
1571 : : throw(::com::sun::star::uno::RuntimeException);
1572 : : };
1573 : :
1574 : :
1575 : : #endif
1576 : :
1577 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|