update emoji autocorrect entries from po-files
[LibreOffice.git] / sc / inc / linkuno.hxx
blobc4b804f9a0f2b0fee45caab1adc8d59b5a812ccb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_LINKUNO_HXX
21 #define INCLUDED_SC_INC_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/ptr_container/ptr_vector.hpp>
49 class ScDocShell;
50 class ScTableLink;
52 typedef ::com::sun::star::uno::Reference<
53 ::com::sun::star::util::XRefreshListener > XRefreshListenerRef;
54 typedef boost::ptr_vector<XRefreshListenerRef> XRefreshListenerArr_Impl;
56 class ScSheetLinkObj : public cppu::WeakImplHelper4<
57 com::sun::star::container::XNamed,
58 com::sun::star::util::XRefreshable,
59 com::sun::star::beans::XPropertySet,
60 com::sun::star::lang::XServiceInfo >,
61 public SfxListener
63 private:
64 SfxItemPropertySet aPropSet;
65 ScDocShell* pDocShell;
66 OUString aFileName;
67 XRefreshListenerArr_Impl aRefreshListeners;
69 ScTableLink* GetLink_Impl() const;
70 void Refreshed_Impl();
71 void ModifyRefreshDelay_Impl( sal_Int32 nRefresh );
73 public:
74 ScSheetLinkObj(ScDocShell* pDocSh, const OUString& rName);
75 virtual ~ScSheetLinkObj();
77 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
79 // XNamed
80 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
81 virtual void SAL_CALL setName( const OUString& aName )
82 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
84 // XRefreshable
85 virtual void SAL_CALL refresh()
86 throw (::com::sun::star::uno::RuntimeException,
87 std::exception) SAL_OVERRIDE;
88 virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference<
89 ::com::sun::star::util::XRefreshListener >& l )
90 throw (::com::sun::star::uno::RuntimeException,
91 std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
137 // aus get/setPropertyValue gerufen:
138 OUString getFileName() const;
139 void setFileName(const OUString& FileName);
140 OUString getFilter() const;
141 void setFilter(const OUString& Filter);
142 OUString getFilterOptions() const;
143 void setFilterOptions(const OUString& FilterOptions);
144 sal_Int32 getRefreshDelay() const;
145 void setRefreshDelay(sal_Int32 nRefreshDelay);
147 // XServiceInfo
148 virtual OUString SAL_CALL getImplementationName()
149 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
150 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
151 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
152 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
153 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
156 class ScSheetLinksObj : public cppu::WeakImplHelper4<
157 com::sun::star::container::XNameAccess,
158 com::sun::star::container::XEnumerationAccess,
159 com::sun::star::container::XIndexAccess,
160 com::sun::star::lang::XServiceInfo >,
161 public SfxListener
163 private:
164 ScDocShell* pDocShell;
166 ScSheetLinkObj* GetObjectByIndex_Impl(sal_Int32 nIndex);
167 ScSheetLinkObj* GetObjectByName_Impl(const OUString& aName);
169 public:
170 ScSheetLinksObj(ScDocShell* pDocSh);
171 virtual ~ScSheetLinksObj();
173 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
175 // XNameAccess
176 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
177 throw(::com::sun::star::container::NoSuchElementException,
178 ::com::sun::star::lang::WrappedTargetException,
179 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
180 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
181 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
182 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
183 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
185 // XIndexAccess
186 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
187 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
188 throw(::com::sun::star::lang::IndexOutOfBoundsException,
189 ::com::sun::star::lang::WrappedTargetException,
190 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
192 // XEnumerationAccess
193 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
194 createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
196 // XElementAccess
197 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
198 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
199 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
201 // XServiceInfo
202 virtual OUString SAL_CALL getImplementationName()
203 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
204 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
205 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
206 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
207 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
210 class ScAreaLinkObj : public cppu::WeakImplHelper4<
211 com::sun::star::sheet::XAreaLink,
212 com::sun::star::util::XRefreshable,
213 com::sun::star::beans::XPropertySet,
214 com::sun::star::lang::XServiceInfo >,
215 public SfxListener
217 private:
218 SfxItemPropertySet aPropSet;
219 ScDocShell* pDocShell;
220 size_t nPos;
221 XRefreshListenerArr_Impl aRefreshListeners;
223 void Modify_Impl( const OUString* pNewFile, const OUString* pNewFilter,
224 const OUString* pNewOptions, const OUString* pNewSource,
225 const com::sun::star::table::CellRangeAddress* pNewDest );
226 void ModifyRefreshDelay_Impl( sal_Int32 nRefresh );
227 void Refreshed_Impl();
229 public:
230 ScAreaLinkObj(ScDocShell* pDocSh, size_t nP);
231 virtual ~ScAreaLinkObj();
233 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
235 // XRefreshable
236 virtual void SAL_CALL refresh()
237 throw (::com::sun::star::uno::RuntimeException,
238 std::exception) SAL_OVERRIDE;
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 std::exception) SAL_OVERRIDE;
243 virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference<
244 ::com::sun::star::util::XRefreshListener >& l )
245 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
247 // XPropertySet
248 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
249 SAL_CALL getPropertySetInfo( )
250 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
251 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
252 const ::com::sun::star::uno::Any& aValue )
253 throw(::com::sun::star::beans::UnknownPropertyException,
254 ::com::sun::star::beans::PropertyVetoException,
255 ::com::sun::star::lang::IllegalArgumentException,
256 ::com::sun::star::lang::WrappedTargetException,
257 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
258 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
259 const OUString& PropertyName )
260 throw(::com::sun::star::beans::UnknownPropertyException,
261 ::com::sun::star::lang::WrappedTargetException,
262 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
263 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
264 const ::com::sun::star::uno::Reference<
265 ::com::sun::star::beans::XPropertyChangeListener >& xListener )
266 throw(::com::sun::star::beans::UnknownPropertyException,
267 ::com::sun::star::lang::WrappedTargetException,
268 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
269 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
270 const ::com::sun::star::uno::Reference<
271 ::com::sun::star::beans::XPropertyChangeListener >& aListener )
272 throw(::com::sun::star::beans::UnknownPropertyException,
273 ::com::sun::star::lang::WrappedTargetException,
274 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
275 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
276 const ::com::sun::star::uno::Reference<
277 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
278 throw(::com::sun::star::beans::UnknownPropertyException,
279 ::com::sun::star::lang::WrappedTargetException,
280 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
281 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
282 const ::com::sun::star::uno::Reference<
283 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
284 throw(::com::sun::star::beans::UnknownPropertyException,
285 ::com::sun::star::lang::WrappedTargetException,
286 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
288 // called from get/setPropertyValue:
289 OUString getFileName() const;
290 void setFileName(const OUString& FileName);
291 OUString getFilter() const;
292 void setFilter(const OUString& Filter);
293 OUString getFilterOptions() const;
294 void setFilterOptions(const OUString& FilterOptions);
295 sal_Int32 getRefreshDelay() const;
296 void setRefreshDelay(sal_Int32 nRefreshDelay);
298 // XAreaLink
299 virtual OUString SAL_CALL getSourceArea() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
300 virtual void SAL_CALL setSourceArea( const OUString& aSourceArea )
301 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
302 virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getDestArea()
303 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
304 virtual void SAL_CALL setDestArea( const ::com::sun::star::table::CellRangeAddress& aDestArea )
305 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
307 // XServiceInfo
308 virtual OUString SAL_CALL getImplementationName()
309 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
310 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
311 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
312 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
313 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
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 ) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
340 virtual void SAL_CALL removeByIndex( sal_Int32 nIndex )
341 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
343 // XIndexAccess
344 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
350 // XEnumerationAccess
351 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
352 createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
354 // XElementAccess
355 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
356 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
357 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
359 // XServiceInfo
360 virtual OUString SAL_CALL getImplementationName()
361 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
362 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
363 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
364 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
365 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
368 //! order of XNamed and DDELink changed to avoid "duplicate comdat" symbols
370 class ScDDELinkObj : public cppu::WeakImplHelper5<
371 com::sun::star::sheet::XDDELink,
372 com::sun::star::container::XNamed,
373 com::sun::star::util::XRefreshable,
374 com::sun::star::sheet::XDDELinkResults,
375 com::sun::star::lang::XServiceInfo >,
376 public SfxListener
378 private:
379 ScDocShell* pDocShell;
380 OUString aAppl;
381 OUString aTopic;
382 OUString aItem;
383 XRefreshListenerArr_Impl aRefreshListeners;
385 void Refreshed_Impl();
387 public:
388 ScDDELinkObj(ScDocShell* pDocSh, const OUString& rA,
389 const OUString& rT, const OUString& rI);
390 virtual ~ScDDELinkObj();
392 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
394 // XNamed
395 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
396 virtual void SAL_CALL setName( const OUString& aName )
397 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
399 // XDDELink
400 virtual OUString SAL_CALL getApplication() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
401 virtual OUString SAL_CALL getTopic() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
402 virtual OUString SAL_CALL getItem() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
404 // XRefreshable
405 virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
406 virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference<
407 ::com::sun::star::util::XRefreshListener >& l )
408 throw (::com::sun::star::uno::RuntimeException,
409 std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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 std::exception) SAL_OVERRIDE;
419 virtual void SAL_CALL setResults(
420 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aResults )
421 throw (::com::sun::star::uno::RuntimeException,
422 std::exception) SAL_OVERRIDE;
424 // XServiceInfo
425 virtual OUString SAL_CALL getImplementationName()
426 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
427 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
428 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
429 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
430 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
433 class ScDDELinksObj : public cppu::WeakImplHelper4<
434 com::sun::star::container::XEnumerationAccess,
435 com::sun::star::container::XIndexAccess,
436 com::sun::star::sheet::XDDELinks,
437 com::sun::star::lang::XServiceInfo >,
438 public SfxListener
440 private:
441 ScDocShell* pDocShell;
443 ScDDELinkObj* GetObjectByIndex_Impl(sal_Int32 nIndex);
444 ScDDELinkObj* GetObjectByName_Impl(const OUString& aName);
446 public:
447 ScDDELinksObj(ScDocShell* pDocSh);
448 virtual ~ScDDELinksObj();
450 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
452 // XNameAccess
453 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
454 throw(::com::sun::star::container::NoSuchElementException,
455 ::com::sun::star::lang::WrappedTargetException,
456 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
457 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
458 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
459 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
460 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
462 // XIndexAccess
463 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
464 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
465 throw(::com::sun::star::lang::IndexOutOfBoundsException,
466 ::com::sun::star::lang::WrappedTargetException,
467 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
469 // XEnumerationAccess
470 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
471 createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
473 // XElementAccess
474 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
475 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
476 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
478 // XDDELinks
479 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDDELink > SAL_CALL addDDELink(
480 const OUString& aApplication, const OUString& aTopic,
481 const OUString& aItem, ::com::sun::star::sheet::DDELinkMode nMode )
482 throw (::com::sun::star::uno::RuntimeException,
483 std::exception) SAL_OVERRIDE;
485 // XServiceInfo
486 virtual OUString SAL_CALL getImplementationName()
487 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
488 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
489 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
490 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
491 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
494 class ScExternalSheetCacheObj : public cppu::WeakImplHelper1< ::com::sun::star::sheet::XExternalSheetCache >
496 public:
497 explicit ScExternalSheetCacheObj(ScDocShell* pDocShell, ScExternalRefCache::TableTypeRef pTable, size_t nIndex);
498 virtual ~ScExternalSheetCacheObj();
500 // XExternalSheetCache
501 virtual void SAL_CALL setCellValue(
502 sal_Int32 nCol, sal_Int32 nRow, const ::com::sun::star::uno::Any& rAny)
503 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
505 virtual ::com::sun::star::uno::Any SAL_CALL getCellValue(sal_Int32 nCol, sal_Int32 nRow)
506 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
508 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getAllRows()
509 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
511 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getAllColumns(sal_Int32 nRow)
512 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
514 // Attributes
515 virtual sal_Int32 SAL_CALL getTokenIndex()
516 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
518 private:
519 ScExternalSheetCacheObj(const ScExternalSheetCacheObj&) SAL_DELETED_FUNCTION;
521 private:
522 ScDocShell* mpDocShell;
523 ScExternalRefCache::TableTypeRef mpTable;
524 size_t mnIndex;
527 class ScExternalDocLinkObj : public cppu::WeakImplHelper1< ::com::sun::star::sheet::XExternalDocLink >
529 public:
530 ScExternalDocLinkObj(ScDocShell* pDocShell, ScExternalRefManager* pRefMgr, sal_uInt16 nFileId);
531 virtual ~ScExternalDocLinkObj();
533 // XExternalDocLink
534 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalSheetCache >
535 SAL_CALL addSheetCache( const OUString& aSheetName, sal_Bool bDynamicCache )
536 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
538 // XNameAccess
539 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
540 throw(::com::sun::star::container::NoSuchElementException,
541 ::com::sun::star::lang::WrappedTargetException,
542 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
543 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
544 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
545 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
546 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
548 // XIndexAccess
549 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
550 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex )
551 throw(::com::sun::star::lang::IndexOutOfBoundsException,
552 ::com::sun::star::lang::WrappedTargetException,
553 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
555 // XEnumerationAccess
556 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
557 createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
559 // XElementAccess
560 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
561 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
562 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
564 // Attributes
565 virtual sal_Int32 SAL_CALL getTokenIndex()
566 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
568 private:
569 ScDocShell* mpDocShell;
570 ScExternalRefManager* mpRefMgr;
571 sal_uInt16 mnFileId;
574 /** This is the UNO API equivalent of ScExternalRefManager. */
575 class ScExternalDocLinksObj : public cppu::WeakImplHelper1< ::com::sun::star::sheet::XExternalDocLinks >
577 public:
578 ScExternalDocLinksObj(ScDocShell* pDocShell);
579 virtual ~ScExternalDocLinksObj();
581 // XExternalDocLinks
582 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalDocLink >
583 SAL_CALL addDocLink( const OUString& aDocName )
584 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
586 // XNameAccess
587 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
588 throw(::com::sun::star::container::NoSuchElementException,
589 ::com::sun::star::lang::WrappedTargetException,
590 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
591 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
592 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
593 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
594 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
596 // XIndexAccess
597 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
598 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex )
599 throw(::com::sun::star::lang::IndexOutOfBoundsException,
600 ::com::sun::star::lang::WrappedTargetException,
601 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
603 // XEnumerationAccess
604 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
605 createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
607 // XElementAccess
608 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
609 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
610 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
612 private:
613 ScExternalDocLinksObj(const ScExternalDocLinksObj&) SAL_DELETED_FUNCTION;
615 private:
616 ScDocShell* mpDocShell;
617 ScExternalRefManager* mpRefMgr;
620 #endif
622 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */