Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / inc / linkuno.hxx
blobb5788e8e7706ec783df6d96ee6bc9bf754b60913
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SC_LINKUNO_HXX
21 #define SC_LINKUNO_HXX
23 #include <svl/lstner.hxx>
24 #include <svl/itemprop.hxx>
25 #include <com/sun/star/sheet/XDDELink.hpp>
26 #include <com/sun/star/sheet/XDDELinkResults.hpp>
27 #include <com/sun/star/sheet/XDDELinks.hpp>
28 #include <com/sun/star/sheet/XExternalDocLink.hpp>
29 #include <com/sun/star/sheet/XExternalDocLinks.hpp>
30 #include <com/sun/star/sheet/XExternalSheetCache.hpp>
31 #include <com/sun/star/sheet/XAreaLink.hpp>
32 #include <com/sun/star/sheet/XAreaLinks.hpp>
33 #include <com/sun/star/util/XRefreshable.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/container/XEnumerationAccess.hpp>
37 #include <com/sun/star/container/XNameAccess.hpp>
38 #include <com/sun/star/container/XIndexAccess.hpp>
39 #include <com/sun/star/container/XNamed.hpp>
40 #include <cppuhelper/implbase1.hxx>
41 #include <cppuhelper/implbase3.hxx>
42 #include <cppuhelper/implbase4.hxx>
43 #include <cppuhelper/implbase5.hxx>
45 #include "externalrefmgr.hxx"
47 #include <boost/unordered_map.hpp>
48 #include <boost/ptr_container/ptr_vector.hpp>
50 class ScDocShell;
51 class ScTableLink;
53 typedef ::com::sun::star::uno::Reference<
54 ::com::sun::star::util::XRefreshListener > XRefreshListenerRef;
55 typedef boost::ptr_vector<XRefreshListenerRef> XRefreshListenerArr_Impl;
59 class ScSheetLinkObj : public cppu::WeakImplHelper4<
60 com::sun::star::container::XNamed,
61 com::sun::star::util::XRefreshable,
62 com::sun::star::beans::XPropertySet,
63 com::sun::star::lang::XServiceInfo >,
64 public SfxListener
66 private:
67 SfxItemPropertySet aPropSet;
68 ScDocShell* pDocShell;
69 OUString aFileName;
70 XRefreshListenerArr_Impl aRefreshListeners;
72 ScTableLink* GetLink_Impl() const;
73 void Refreshed_Impl();
74 void ModifyRefreshDelay_Impl( sal_Int32 nRefresh );
76 public:
77 ScSheetLinkObj(ScDocShell* pDocSh, const OUString& rName);
78 virtual ~ScSheetLinkObj();
80 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
82 // XNamed
83 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
84 virtual void SAL_CALL setName( const OUString& aName )
85 throw(::com::sun::star::uno::RuntimeException);
87 // XRefreshable
88 virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException);
89 virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference<
90 ::com::sun::star::util::XRefreshListener >& l )
91 throw(::com::sun::star::uno::RuntimeException);
92 virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference<
93 ::com::sun::star::util::XRefreshListener >& l )
94 throw(::com::sun::star::uno::RuntimeException);
96 // XPropertySet
97 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
98 SAL_CALL getPropertySetInfo( )
99 throw(::com::sun::star::uno::RuntimeException);
100 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
101 const ::com::sun::star::uno::Any& aValue )
102 throw(::com::sun::star::beans::UnknownPropertyException,
103 ::com::sun::star::beans::PropertyVetoException,
104 ::com::sun::star::lang::IllegalArgumentException,
105 ::com::sun::star::lang::WrappedTargetException,
106 ::com::sun::star::uno::RuntimeException);
107 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
108 const OUString& PropertyName )
109 throw(::com::sun::star::beans::UnknownPropertyException,
110 ::com::sun::star::lang::WrappedTargetException,
111 ::com::sun::star::uno::RuntimeException);
112 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
113 const ::com::sun::star::uno::Reference<
114 ::com::sun::star::beans::XPropertyChangeListener >& xListener )
115 throw(::com::sun::star::beans::UnknownPropertyException,
116 ::com::sun::star::lang::WrappedTargetException,
117 ::com::sun::star::uno::RuntimeException);
118 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
119 const ::com::sun::star::uno::Reference<
120 ::com::sun::star::beans::XPropertyChangeListener >& aListener )
121 throw(::com::sun::star::beans::UnknownPropertyException,
122 ::com::sun::star::lang::WrappedTargetException,
123 ::com::sun::star::uno::RuntimeException);
124 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
125 const ::com::sun::star::uno::Reference<
126 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
127 throw(::com::sun::star::beans::UnknownPropertyException,
128 ::com::sun::star::lang::WrappedTargetException,
129 ::com::sun::star::uno::RuntimeException);
130 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
131 const ::com::sun::star::uno::Reference<
132 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
133 throw(::com::sun::star::beans::UnknownPropertyException,
134 ::com::sun::star::lang::WrappedTargetException,
135 ::com::sun::star::uno::RuntimeException);
137 // aus get/setPropertyValue gerufen:
138 OUString getFileName(void) const;
139 void setFileName(const OUString& FileName);
140 OUString getFilter(void) const;
141 void setFilter(const OUString& Filter);
142 OUString getFilterOptions(void) const;
143 void setFilterOptions(const OUString& FilterOptions);
144 sal_Int32 getRefreshDelay(void) const;
145 void setRefreshDelay(sal_Int32 nRefreshDelay);
147 // XServiceInfo
148 virtual OUString SAL_CALL getImplementationName()
149 throw(::com::sun::star::uno::RuntimeException);
150 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
151 throw(::com::sun::star::uno::RuntimeException);
152 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
153 throw(::com::sun::star::uno::RuntimeException);
157 class ScSheetLinksObj : public cppu::WeakImplHelper4<
158 com::sun::star::container::XNameAccess,
159 com::sun::star::container::XEnumerationAccess,
160 com::sun::star::container::XIndexAccess,
161 com::sun::star::lang::XServiceInfo >,
162 public SfxListener
164 private:
165 ScDocShell* pDocShell;
167 ScSheetLinkObj* GetObjectByIndex_Impl(sal_Int32 nIndex);
168 ScSheetLinkObj* GetObjectByName_Impl(const OUString& aName);
170 public:
171 ScSheetLinksObj(ScDocShell* pDocSh);
172 virtual ~ScSheetLinksObj();
174 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
176 // XNameAccess
177 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
178 throw(::com::sun::star::container::NoSuchElementException,
179 ::com::sun::star::lang::WrappedTargetException,
180 ::com::sun::star::uno::RuntimeException);
181 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
182 throw(::com::sun::star::uno::RuntimeException);
183 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
184 throw(::com::sun::star::uno::RuntimeException);
186 // XIndexAccess
187 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
188 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
189 throw(::com::sun::star::lang::IndexOutOfBoundsException,
190 ::com::sun::star::lang::WrappedTargetException,
191 ::com::sun::star::uno::RuntimeException);
193 // XEnumerationAccess
194 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
195 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
197 // XElementAccess
198 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
199 throw(::com::sun::star::uno::RuntimeException);
200 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
202 // XServiceInfo
203 virtual OUString SAL_CALL getImplementationName()
204 throw(::com::sun::star::uno::RuntimeException);
205 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
206 throw(::com::sun::star::uno::RuntimeException);
207 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
208 throw(::com::sun::star::uno::RuntimeException);
212 class ScAreaLinkObj : public cppu::WeakImplHelper4<
213 com::sun::star::sheet::XAreaLink,
214 com::sun::star::util::XRefreshable,
215 com::sun::star::beans::XPropertySet,
216 com::sun::star::lang::XServiceInfo >,
217 public SfxListener
219 private:
220 SfxItemPropertySet aPropSet;
221 ScDocShell* pDocShell;
222 size_t nPos;
223 XRefreshListenerArr_Impl aRefreshListeners;
225 void Modify_Impl( const OUString* pNewFile, const OUString* pNewFilter,
226 const OUString* pNewOptions, const OUString* pNewSource,
227 const com::sun::star::table::CellRangeAddress* pNewDest );
228 void ModifyRefreshDelay_Impl( sal_Int32 nRefresh );
229 void Refreshed_Impl();
231 public:
232 ScAreaLinkObj(ScDocShell* pDocSh, size_t nP);
233 virtual ~ScAreaLinkObj();
235 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
237 // XRefreshable
238 virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException);
239 virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference<
240 ::com::sun::star::util::XRefreshListener >& l )
241 throw(::com::sun::star::uno::RuntimeException);
242 virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference<
243 ::com::sun::star::util::XRefreshListener >& l )
244 throw(::com::sun::star::uno::RuntimeException);
246 // XPropertySet
247 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
248 SAL_CALL getPropertySetInfo( )
249 throw(::com::sun::star::uno::RuntimeException);
250 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
251 const ::com::sun::star::uno::Any& aValue )
252 throw(::com::sun::star::beans::UnknownPropertyException,
253 ::com::sun::star::beans::PropertyVetoException,
254 ::com::sun::star::lang::IllegalArgumentException,
255 ::com::sun::star::lang::WrappedTargetException,
256 ::com::sun::star::uno::RuntimeException);
257 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
258 const OUString& PropertyName )
259 throw(::com::sun::star::beans::UnknownPropertyException,
260 ::com::sun::star::lang::WrappedTargetException,
261 ::com::sun::star::uno::RuntimeException);
262 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
263 const ::com::sun::star::uno::Reference<
264 ::com::sun::star::beans::XPropertyChangeListener >& xListener )
265 throw(::com::sun::star::beans::UnknownPropertyException,
266 ::com::sun::star::lang::WrappedTargetException,
267 ::com::sun::star::uno::RuntimeException);
268 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
269 const ::com::sun::star::uno::Reference<
270 ::com::sun::star::beans::XPropertyChangeListener >& aListener )
271 throw(::com::sun::star::beans::UnknownPropertyException,
272 ::com::sun::star::lang::WrappedTargetException,
273 ::com::sun::star::uno::RuntimeException);
274 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
275 const ::com::sun::star::uno::Reference<
276 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
277 throw(::com::sun::star::beans::UnknownPropertyException,
278 ::com::sun::star::lang::WrappedTargetException,
279 ::com::sun::star::uno::RuntimeException);
280 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
281 const ::com::sun::star::uno::Reference<
282 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
283 throw(::com::sun::star::beans::UnknownPropertyException,
284 ::com::sun::star::lang::WrappedTargetException,
285 ::com::sun::star::uno::RuntimeException);
287 // called from get/setPropertyValue:
288 OUString getFileName(void) const;
289 void setFileName(const OUString& FileName);
290 OUString getFilter(void) const;
291 void setFilter(const OUString& Filter);
292 OUString getFilterOptions(void) const;
293 void setFilterOptions(const OUString& FilterOptions);
294 sal_Int32 getRefreshDelay(void) const;
295 void setRefreshDelay(sal_Int32 nRefreshDelay);
297 // XAreaLink
298 virtual OUString SAL_CALL getSourceArea() throw(::com::sun::star::uno::RuntimeException);
299 virtual void SAL_CALL setSourceArea( const OUString& aSourceArea )
300 throw(::com::sun::star::uno::RuntimeException);
301 virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getDestArea()
302 throw(::com::sun::star::uno::RuntimeException);
303 virtual void SAL_CALL setDestArea( const ::com::sun::star::table::CellRangeAddress& aDestArea )
304 throw(::com::sun::star::uno::RuntimeException);
306 // XServiceInfo
307 virtual OUString SAL_CALL getImplementationName()
308 throw(::com::sun::star::uno::RuntimeException);
309 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
310 throw(::com::sun::star::uno::RuntimeException);
311 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
312 throw(::com::sun::star::uno::RuntimeException);
316 class ScAreaLinksObj : public cppu::WeakImplHelper3<
317 com::sun::star::sheet::XAreaLinks,
318 com::sun::star::container::XEnumerationAccess,
319 com::sun::star::lang::XServiceInfo >,
320 public SfxListener
322 private:
323 ScDocShell* pDocShell;
325 ScAreaLinkObj* GetObjectByIndex_Impl(sal_Int32 nIndex);
327 public:
328 ScAreaLinksObj(ScDocShell* pDocSh);
329 virtual ~ScAreaLinksObj();
331 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
333 // XAreaLinks
334 virtual void SAL_CALL insertAtPosition( const ::com::sun::star::table::CellAddress& aDestPos,
335 const OUString& aFileName,
336 const OUString& aSourceArea,
337 const OUString& aFilter,
338 const OUString& aFilterOptions )
339 throw(::com::sun::star::uno::RuntimeException);
340 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex )
341 throw(::com::sun::star::uno::RuntimeException);
343 // XIndexAccess
344 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
345 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
346 throw(::com::sun::star::lang::IndexOutOfBoundsException,
347 ::com::sun::star::lang::WrappedTargetException,
348 ::com::sun::star::uno::RuntimeException);
350 // XEnumerationAccess
351 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
352 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
354 // XElementAccess
355 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
356 throw(::com::sun::star::uno::RuntimeException);
357 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
359 // XServiceInfo
360 virtual OUString SAL_CALL getImplementationName()
361 throw(::com::sun::star::uno::RuntimeException);
362 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
363 throw(::com::sun::star::uno::RuntimeException);
364 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
365 throw(::com::sun::star::uno::RuntimeException);
369 //! order of XNamed and DDELink changed to avoid "duplicate comdat" symbols
371 class ScDDELinkObj : public cppu::WeakImplHelper5<
372 com::sun::star::sheet::XDDELink,
373 com::sun::star::container::XNamed,
374 com::sun::star::util::XRefreshable,
375 com::sun::star::sheet::XDDELinkResults,
376 com::sun::star::lang::XServiceInfo >,
377 public SfxListener
379 private:
380 ScDocShell* pDocShell;
381 OUString aAppl;
382 OUString aTopic;
383 OUString aItem;
384 XRefreshListenerArr_Impl aRefreshListeners;
386 void Refreshed_Impl();
388 public:
389 ScDDELinkObj(ScDocShell* pDocSh, const OUString& rA,
390 const OUString& rT, const OUString& rI);
391 virtual ~ScDDELinkObj();
393 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
395 // XNamed
396 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
397 virtual void SAL_CALL setName( const OUString& aName )
398 throw(::com::sun::star::uno::RuntimeException);
400 // XDDELink
401 virtual OUString SAL_CALL getApplication() throw(::com::sun::star::uno::RuntimeException);
402 virtual OUString SAL_CALL getTopic() throw(::com::sun::star::uno::RuntimeException);
403 virtual OUString SAL_CALL getItem() throw(::com::sun::star::uno::RuntimeException);
405 // XRefreshable
406 virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException);
407 virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference<
408 ::com::sun::star::util::XRefreshListener >& l )
409 throw(::com::sun::star::uno::RuntimeException);
410 virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference<
411 ::com::sun::star::util::XRefreshListener >& l )
412 throw(::com::sun::star::uno::RuntimeException);
414 // XDDELinkResults
415 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >
416 SAL_CALL getResults( )
417 throw (::com::sun::star::uno::RuntimeException);
418 virtual void SAL_CALL setResults(
419 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aResults )
420 throw (::com::sun::star::uno::RuntimeException);
422 // XServiceInfo
423 virtual OUString SAL_CALL getImplementationName()
424 throw(::com::sun::star::uno::RuntimeException);
425 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
426 throw(::com::sun::star::uno::RuntimeException);
427 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
428 throw(::com::sun::star::uno::RuntimeException);
432 class ScDDELinksObj : public cppu::WeakImplHelper4<
433 com::sun::star::container::XEnumerationAccess,
434 com::sun::star::container::XIndexAccess,
435 com::sun::star::sheet::XDDELinks,
436 com::sun::star::lang::XServiceInfo >,
437 public SfxListener
439 private:
440 ScDocShell* pDocShell;
442 ScDDELinkObj* GetObjectByIndex_Impl(sal_Int32 nIndex);
443 ScDDELinkObj* GetObjectByName_Impl(const OUString& aName);
445 public:
446 ScDDELinksObj(ScDocShell* pDocSh);
447 virtual ~ScDDELinksObj();
449 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
451 // XNameAccess
452 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
453 throw(::com::sun::star::container::NoSuchElementException,
454 ::com::sun::star::lang::WrappedTargetException,
455 ::com::sun::star::uno::RuntimeException);
456 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
457 throw(::com::sun::star::uno::RuntimeException);
458 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
459 throw(::com::sun::star::uno::RuntimeException);
461 // XIndexAccess
462 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
463 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
464 throw(::com::sun::star::lang::IndexOutOfBoundsException,
465 ::com::sun::star::lang::WrappedTargetException,
466 ::com::sun::star::uno::RuntimeException);
468 // XEnumerationAccess
469 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
470 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
472 // XElementAccess
473 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
474 throw(::com::sun::star::uno::RuntimeException);
475 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
477 // XDDELinks
478 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDDELink > SAL_CALL addDDELink(
479 const OUString& aApplication, const OUString& aTopic,
480 const OUString& aItem, ::com::sun::star::sheet::DDELinkMode nMode )
481 throw (::com::sun::star::uno::RuntimeException);
483 // XServiceInfo
484 virtual OUString SAL_CALL getImplementationName()
485 throw(::com::sun::star::uno::RuntimeException);
486 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
487 throw(::com::sun::star::uno::RuntimeException);
488 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
489 throw(::com::sun::star::uno::RuntimeException);
492 class ScExternalSheetCacheObj : public cppu::WeakImplHelper1< ::com::sun::star::sheet::XExternalSheetCache >
494 public:
495 explicit ScExternalSheetCacheObj(ScExternalRefCache::TableTypeRef pTable, size_t nIndex);
496 ~ScExternalSheetCacheObj();
498 // XExternalSheetCache
499 virtual void SAL_CALL setCellValue(
500 sal_Int32 nCol, sal_Int32 nRow, const ::com::sun::star::uno::Any& rAny)
501 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
503 virtual ::com::sun::star::uno::Any SAL_CALL getCellValue(sal_Int32 nCol, sal_Int32 nRow)
504 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
506 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getAllRows()
507 throw (::com::sun::star::uno::RuntimeException);
509 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getAllColumns(sal_Int32 nRow)
510 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
512 // Attributes
513 virtual sal_Int32 SAL_CALL getTokenIndex()
514 throw (::com::sun::star::uno::RuntimeException);
516 private:
517 ScExternalSheetCacheObj();
518 ScExternalSheetCacheObj(const ScExternalSheetCacheObj&);
520 private:
521 ScExternalRefCache::TableTypeRef mpTable;
522 size_t mnIndex;
525 class ScExternalDocLinkObj : public cppu::WeakImplHelper1< ::com::sun::star::sheet::XExternalDocLink >
527 public:
528 ScExternalDocLinkObj(ScExternalRefManager* pRefMgr, sal_uInt16 nFileId);
529 ~ScExternalDocLinkObj();
531 // XExternalDocLink
532 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalSheetCache >
533 SAL_CALL addSheetCache( const OUString& aSheetName, sal_Bool bDynamicCache )
534 throw (::com::sun::star::uno::RuntimeException);
536 // XNameAccess
537 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
538 throw(::com::sun::star::container::NoSuchElementException,
539 ::com::sun::star::lang::WrappedTargetException,
540 ::com::sun::star::uno::RuntimeException);
541 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
542 throw(::com::sun::star::uno::RuntimeException);
543 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
544 throw(::com::sun::star::uno::RuntimeException);
546 // XIndexAccess
547 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
548 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex )
549 throw(::com::sun::star::lang::IndexOutOfBoundsException,
550 ::com::sun::star::lang::WrappedTargetException,
551 ::com::sun::star::uno::RuntimeException);
553 // XEnumerationAccess
554 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
555 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
557 // XElementAccess
558 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
559 throw(::com::sun::star::uno::RuntimeException);
560 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
562 // Attributes
563 virtual sal_Int32 SAL_CALL getTokenIndex()
564 throw (::com::sun::star::uno::RuntimeException);
566 private:
567 ScExternalRefManager* mpRefMgr;
568 sal_uInt16 mnFileId;
571 /** This is the UNO API equivalent of ScExternalRefManager. */
572 class ScExternalDocLinksObj : public cppu::WeakImplHelper1< ::com::sun::star::sheet::XExternalDocLinks >
574 public:
575 ScExternalDocLinksObj(ScDocShell* pDocShell);
576 ~ScExternalDocLinksObj();
578 // XExternalDocLinks
579 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalDocLink >
580 SAL_CALL addDocLink( const OUString& aDocName )
581 throw (::com::sun::star::uno::RuntimeException);
583 // XNameAccess
584 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
585 throw(::com::sun::star::container::NoSuchElementException,
586 ::com::sun::star::lang::WrappedTargetException,
587 ::com::sun::star::uno::RuntimeException);
588 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
589 throw(::com::sun::star::uno::RuntimeException);
590 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
591 throw(::com::sun::star::uno::RuntimeException);
593 // XIndexAccess
594 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
595 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex )
596 throw(::com::sun::star::lang::IndexOutOfBoundsException,
597 ::com::sun::star::lang::WrappedTargetException,
598 ::com::sun::star::uno::RuntimeException);
600 // XEnumerationAccess
601 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
602 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
604 // XElementAccess
605 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
606 throw(::com::sun::star::uno::RuntimeException);
607 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
609 private:
610 ScExternalDocLinksObj();
611 ScExternalDocLinksObj(const ScExternalDocLinksObj&);
613 private:
614 ScDocShell* mpDocShell;
615 ScExternalRefManager* mpRefMgr;
618 #endif
620 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */