1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _INC_COMMONEMBOBJ_HXX_
25 #define _INC_COMMONEMBOBJ_HXX_
26 
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <com/sun/star/uno/Reference.hxx>
29 #include <com/sun/star/uno/Any.hxx>
30 #include <com/sun/star/container/XChild.hpp>
31 #include <com/sun/star/document/XStorageBasedDocument.hpp>
32 #include <com/sun/star/embed/XEmbeddedObject.hpp>
33 #include <com/sun/star/embed/XVisualObject.hpp>
34 #include <com/sun/star/embed/XEmbedPersist.hpp>
35 #include <com/sun/star/embed/XLinkageSupport.hpp>
36 #include <com/sun/star/embed/XClassifiedObject.hpp>
37 #include <com/sun/star/embed/XComponentSupplier.hpp>
38 #include <com/sun/star/embed/XInplaceObject.hpp>
39 #include <com/sun/star/embed/XStateChangeBroadcaster.hpp>
40 #include <com/sun/star/awt/XWindow.hpp>
41 #include <com/sun/star/awt/Rectangle.hpp>
42 #include <com/sun/star/document/XEventBroadcaster.hpp>
43 #include <com/sun/star/util/XCloseable.hpp>
44 #include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
45 #include <cppuhelper/weak.hxx>
46 
47 namespace com { namespace sun { namespace star {
48     namespace embed {
49         class XStorage;
50     }
51     namespace frame {
52         class XModel;
53         class XFrame;
54     }
55     namespace lang {
56         class XMultiServiceFactory;
57     }
58     namespace util {
59         class XCloseListener;
60     }
61     namespace beans {
62         struct PropertyValue;
63         struct NamedValue;
64     }
65 }}}
66 
67 namespace cppu {
68     class OMultiTypeInterfaceContainerHelper;
69 }
70 
71 namespace comphelper {
72     class NamedValueCollection;
73 }
74 
75 #define NUM_SUPPORTED_STATES 5
76 // #define NUM_SUPPORTED_VERBS 5
77 
78 #include "docholder.hxx"
79 
80 class Interceptor;
81 
82 class OCommonEmbeddedObject : public ::com::sun::star::embed::XEmbeddedObject
83                             , public ::com::sun::star::embed::XEmbedPersist
84                             , public ::com::sun::star::embed::XLinkageSupport
85                             , public ::com::sun::star::embed::XInplaceObject
86                             , public ::com::sun::star::container::XChild
87                             , public ::com::sun::star::chart2::XDefaultSizeTransmitter
88                             , public ::cppu::OWeakObject
89 {
90 protected:
91     ::osl::Mutex    m_aMutex;
92 
93     DocumentHolder* m_pDocHolder;
94 
95     ::cppu::OMultiTypeInterfaceContainerHelper* m_pInterfaceContainer;
96 
97     sal_Bool m_bReadOnly;
98 
99     sal_Bool m_bDisposed;
100     sal_Bool m_bClosed;
101 
102     sal_Int32 m_nObjectState;
103     sal_Int32 m_nTargetState; // should be -1 exept during state changing
104     sal_Int32 m_nUpdateMode;
105 
106     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
107 
108     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aDocMediaDescriptor;
109 
110     ::com::sun::star::uno::Sequence< sal_Int8 > m_aClassID;
111     ::rtl::OUString m_aClassName;
112 
113     ::rtl::OUString m_aDocServiceName;
114     ::rtl::OUString m_aPresetFilterName;
115 
116     sal_Int64 m_nMiscStatus;
117 
118     ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > m_aObjectVerbs;
119 
120     ::com::sun::star::uno::Sequence< sal_Int32 > m_aAcceptedStates;
121     ::com::sun::star::uno::Sequence< sal_Int32 > m_pIntermediateStatesSeqs[NUM_SUPPORTED_STATES][NUM_SUPPORTED_STATES];
122     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > > m_aVerbTable;
123 
124     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > m_xClientSite;
125 
126     ::rtl::OUString m_aContainerName;
127     ::rtl::OUString m_aDefaultParentBaseURL;
128     ::rtl::OUString m_aModuleName;
129     sal_Bool        m_bEmbeddedScriptSupport;
130     sal_Bool        m_bDocumentRecoverySupport;
131 
132     Interceptor* m_pInterceptor;
133 
134     // following information will be used between SaveAs and SaveCompleted
135     sal_Bool m_bWaitSaveCompleted;
136     ::rtl::OUString m_aNewEntryName;
137     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewParentStorage;
138     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewObjectStorage;
139     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aNewDocMediaDescriptor;
140 
141     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xClientWindow; // ???
142     ::com::sun::star::awt::Rectangle m_aOwnRectangle;
143     ::com::sun::star::awt::Rectangle m_aClipRectangle;
144 
145     sal_Bool m_bIsLink;
146 
147     // embedded object related stuff
148     ::rtl::OUString m_aEntryName;
149     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
150     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xObjectStorage;
151     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRecoveryStorage;
152 
153     // link related stuff
154     ::rtl::OUString m_aLinkURL;
155     ::rtl::OUString m_aLinkFilterName;
156     sal_Bool        m_bLinkHasPassword;
157     ::rtl::OUString m_aLinkPassword;
158 
159     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
160 
161     sal_Bool m_bHasClonedSize; // the object has cached size
162     ::com::sun::star::awt::Size m_aClonedSize;
163     sal_Int32 m_nClonedMapUnit;
164     ::com::sun::star::awt::Size m_aDefaultSizeForChart_In_100TH_MM;//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this member
165 
166 private:
167     void CommonInit_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
168 
169     void LinkInit_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps,
170                         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr,
171                         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aObjectDescr );
172 
173 
174     void SwitchOwnPersistence(
175                 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
176                 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewObjectStorage,
177                 const ::rtl::OUString& aNewName );
178 
179     void SwitchOwnPersistence(
180                 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
181                 const ::rtl::OUString& aNewName );
182 
GetDocumentServiceName() const183     ::rtl::OUString GetDocumentServiceName() const { return m_aDocServiceName; }
GetPresetFilterName() const184     ::rtl::OUString GetPresetFilterName() const { return m_aPresetFilterName; }
185 
186     ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
187         StoreDocumentToTempStream_Impl( sal_Int32 nStorageFormat,
188                                         const ::rtl::OUString& aBaseURL,
189                                         const ::rtl::OUString& aHierarchName );
190 
191     sal_Int32 ConvertVerbToState_Impl( sal_Int32 nVerb );
192 
193     void Deactivate();
194 
195     void StateChangeNotification_Impl( sal_Bool bBeforeChange, sal_Int32 nOldState, sal_Int32 nNewState,::osl::ResettableMutexGuard& _rGuard );
196 
197     void SwitchStateTo_Impl( sal_Int32 nNextState );
198 
199     ::com::sun::star::uno::Sequence< sal_Int32 > GetIntermediateStatesSequence_Impl( sal_Int32 nNewState );
200 
201     ::rtl::OUString GetFilterName( sal_Int32 nVersion ) const;
202     ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadDocumentFromStorage_Impl();
203 
204     ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadLink_Impl();
205 
206     ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > InitNewDocument_Impl();
207 
208     void StoreDocToStorage_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
209                                 sal_Int32 nStorageVersion,
210                                 const ::rtl::OUString& aBaseURL,
211                                 const ::rtl::OUString& aHierarchName,
212                                 sal_Bool bAttachToStorage );
213 
214     void SwitchDocToStorage_Impl(
215             const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageBasedDocument >& xDoc,
216             const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
217 
218     void FillDefaultLoadArgs_Impl(
219             const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rxStorage,
220                   ::comphelper::NamedValueCollection& o_rLoadArgs
221         ) const;
222 
223     void EmbedAndReparentDoc_Impl(
224             const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable >& i_rxDocument
225         ) const;
226 
227     ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateDocFromMediaDescr_Impl(
228                         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMedDescr );
229 
230     ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateTempDocFromLink_Impl();
231 
232     ::rtl::OUString GetBaseURL_Impl() const;
233     ::rtl::OUString GetBaseURLFrom_Impl(
234                     const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
235                     const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs );
236 
237 public:
238     OCommonEmbeddedObject(
239         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
240         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
241 
242     // no persistance for linked objects, so the descriptors are provided in constructor
243     OCommonEmbeddedObject(
244         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
245         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps,
246         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr,
247         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aObjectDescr );
248 
249     virtual ~OCommonEmbeddedObject();
250 
251     void SaveObject_Impl();
252 
253     void requestPositioning( const ::com::sun::star::awt::Rectangle& aRect );
254 
255     // not a real listener and should not be
256     void PostEvent_Impl( const ::rtl::OUString& aEventName,
257                          const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xSource =
258                                             ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() );
259 
260 // XInterface
261 
262     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
263         throw( ::com::sun::star::uno::RuntimeException ) ;
264 
265     virtual void SAL_CALL acquire()
266         throw();
267 
268     virtual void SAL_CALL release()
269         throw();
270 
271 // XTypeProvider
272 
273     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
274         throw( ::com::sun::star::uno::RuntimeException ) ;
275 
276     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
277         throw( ::com::sun::star::uno::RuntimeException ) ;
278 
279 // XEmbeddedObject
280 
281     virtual void SAL_CALL changeState( sal_Int32 nNewState )
282         throw ( ::com::sun::star::embed::UnreachableStateException,
283                 ::com::sun::star::embed::WrongStateException,
284                 ::com::sun::star::uno::Exception,
285                 ::com::sun::star::uno::RuntimeException );
286 
287     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates()
288         throw ( ::com::sun::star::embed::WrongStateException,
289                 ::com::sun::star::uno::RuntimeException );
290 
291     virtual sal_Int32 SAL_CALL getCurrentState()
292         throw ( ::com::sun::star::embed::WrongStateException,
293                 ::com::sun::star::uno::RuntimeException );
294 
295     virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
296         throw ( ::com::sun::star::lang::IllegalArgumentException,
297                 ::com::sun::star::embed::WrongStateException,
298                 ::com::sun::star::embed::UnreachableStateException,
299                 ::com::sun::star::uno::Exception,
300                 ::com::sun::star::uno::RuntimeException );
301 
302     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > SAL_CALL getSupportedVerbs()
303         throw ( ::com::sun::star::embed::WrongStateException,
304                 ::com::sun::star::uno::RuntimeException );
305 
306     virtual void SAL_CALL setClientSite(
307                 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient >& xClient )
308         throw ( ::com::sun::star::embed::WrongStateException,
309                 ::com::sun::star::uno::RuntimeException );
310 
311     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > SAL_CALL getClientSite()
312         throw ( ::com::sun::star::embed::WrongStateException,
313                 ::com::sun::star::uno::RuntimeException );
314 
315     virtual void SAL_CALL update()
316         throw ( ::com::sun::star::embed::WrongStateException,
317                 ::com::sun::star::uno::Exception,
318                 ::com::sun::star::uno::RuntimeException );
319 
320     virtual void SAL_CALL setUpdateMode( sal_Int32 nMode )
321         throw ( ::com::sun::star::embed::WrongStateException,
322                 ::com::sun::star::uno::RuntimeException );
323 
324     virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect )
325         throw ( ::com::sun::star::embed::WrongStateException,
326                 ::com::sun::star::uno::RuntimeException );
327 
328     virtual void SAL_CALL setContainerName( const ::rtl::OUString& sName )
329         throw ( ::com::sun::star::uno::RuntimeException );
330 
331 
332 // XVisualObject
333 
334     virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
335         throw ( ::com::sun::star::lang::IllegalArgumentException,
336                 ::com::sun::star::embed::WrongStateException,
337                 ::com::sun::star::uno::Exception,
338                 ::com::sun::star::uno::RuntimeException );
339 
340     virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
341         throw ( ::com::sun::star::lang::IllegalArgumentException,
342                 ::com::sun::star::embed::WrongStateException,
343                 ::com::sun::star::uno::Exception,
344                 ::com::sun::star::uno::RuntimeException );
345 
346     virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
347         throw ( ::com::sun::star::lang::IllegalArgumentException,
348                 ::com::sun::star::embed::WrongStateException,
349                 ::com::sun::star::uno::Exception,
350                 ::com::sun::star::uno::RuntimeException );
351 
352     virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
353         throw ( ::com::sun::star::uno::Exception,
354                 ::com::sun::star::uno::RuntimeException);
355 
356 // XEmbedPersist
357 
358     virtual void SAL_CALL setPersistentEntry(
359                     const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
360                     const ::rtl::OUString& sEntName,
361                     sal_Int32 nEntryConnectionMode,
362                     const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
363                     const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
364         throw ( ::com::sun::star::lang::IllegalArgumentException,
365                 ::com::sun::star::embed::WrongStateException,
366                 ::com::sun::star::io::IOException,
367                 ::com::sun::star::uno::Exception,
368                 ::com::sun::star::uno::RuntimeException );
369 
370     virtual void SAL_CALL storeToEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
371         throw ( ::com::sun::star::lang::IllegalArgumentException,
372                 ::com::sun::star::embed::WrongStateException,
373                 ::com::sun::star::io::IOException,
374                 ::com::sun::star::uno::Exception,
375                 ::com::sun::star::uno::RuntimeException );
376 
377     virtual void SAL_CALL storeAsEntry(
378                 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
379                 const ::rtl::OUString& sEntName,
380                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
381                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
382         throw ( ::com::sun::star::lang::IllegalArgumentException,
383                 ::com::sun::star::embed::WrongStateException,
384                 ::com::sun::star::io::IOException,
385                 ::com::sun::star::uno::Exception,
386                 ::com::sun::star::uno::RuntimeException );
387 
388     virtual void SAL_CALL saveCompleted( sal_Bool bUseNew )
389         throw ( ::com::sun::star::embed::WrongStateException,
390                 ::com::sun::star::uno::Exception,
391                 ::com::sun::star::uno::RuntimeException );
392 
393     virtual sal_Bool SAL_CALL hasEntry()
394         throw ( ::com::sun::star::embed::WrongStateException,
395                 ::com::sun::star::uno::RuntimeException );
396 
397     virtual ::rtl::OUString SAL_CALL getEntryName()
398         throw ( ::com::sun::star::embed::WrongStateException,
399                 ::com::sun::star::uno::RuntimeException );
400 
401 // XLinkageSupport
402 
403     virtual void SAL_CALL breakLink( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
404                                      const ::rtl::OUString& sEntName )
405         throw ( ::com::sun::star::lang::IllegalArgumentException,
406                 ::com::sun::star::embed::WrongStateException,
407                 ::com::sun::star::io::IOException,
408                 ::com::sun::star::uno::Exception,
409                 ::com::sun::star::uno::RuntimeException );
410 
411     virtual sal_Bool SAL_CALL isLink()
412         throw ( ::com::sun::star::embed::WrongStateException,
413                 ::com::sun::star::uno::RuntimeException);
414 
415     virtual ::rtl::OUString SAL_CALL getLinkURL()
416         throw ( ::com::sun::star::embed::WrongStateException,
417                 ::com::sun::star::uno::Exception,
418                 ::com::sun::star::uno::RuntimeException);
419 
420 
421 // XCommonEmbedPersist
422 
423     virtual void SAL_CALL storeOwn()
424         throw ( ::com::sun::star::embed::WrongStateException,
425                 ::com::sun::star::io::IOException,
426                 ::com::sun::star::uno::Exception,
427                 ::com::sun::star::uno::RuntimeException );
428 
429     virtual sal_Bool SAL_CALL isReadonly()
430         throw ( ::com::sun::star::embed::WrongStateException,
431                 ::com::sun::star::uno::RuntimeException );
432 
433     virtual void SAL_CALL reload(
434                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
435                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
436         throw ( ::com::sun::star::lang::IllegalArgumentException,
437                 ::com::sun::star::embed::WrongStateException,
438                 ::com::sun::star::io::IOException,
439                 ::com::sun::star::uno::Exception,
440                 ::com::sun::star::uno::RuntimeException );
441 
442 
443 // XInplaceObject
444 
445     virtual void SAL_CALL setObjectRectangles( const ::com::sun::star::awt::Rectangle& aPosRect,
446                                           const ::com::sun::star::awt::Rectangle& aClipRect )
447         throw ( ::com::sun::star::embed::WrongStateException,
448                 ::com::sun::star::uno::Exception,
449                 ::com::sun::star::uno::RuntimeException );
450 
451     virtual void SAL_CALL enableModeless( sal_Bool bEnable )
452         throw ( ::com::sun::star::embed::WrongStateException,
453                 ::com::sun::star::uno::Exception,
454                 ::com::sun::star::uno::RuntimeException );
455 
456     virtual void SAL_CALL translateAccelerators(
457                     const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::KeyEvent >& aKeys )
458         throw ( ::com::sun::star::embed::WrongStateException,
459                 ::com::sun::star::uno::RuntimeException );
460 
461 // XClassifiedObject
462 
463     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getClassID()
464         throw ( ::com::sun::star::uno::RuntimeException );
465 
466     virtual ::rtl::OUString SAL_CALL getClassName()
467         throw ( ::com::sun::star::uno::RuntimeException );
468 
469     virtual void SAL_CALL setClassInfo(
470                 const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName )
471         throw ( ::com::sun::star::lang::NoSupportException,
472                 ::com::sun::star::uno::RuntimeException );
473 
474 
475 // XComponentSupplier
476 
477     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent()
478         throw ( ::com::sun::star::uno::RuntimeException );
479 
480 // XStateChangeBroadcaster
481     virtual void SAL_CALL addStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
482     virtual void SAL_CALL removeStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
483 
484 // XCloseable
485 
486     virtual void SAL_CALL close( sal_Bool DeliverOwnership )
487         throw ( ::com::sun::star::util::CloseVetoException,
488                 ::com::sun::star::uno::RuntimeException );
489 
490     virtual void SAL_CALL addCloseListener(
491                 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
492         throw ( ::com::sun::star::uno::RuntimeException );
493 
494     virtual void SAL_CALL removeCloseListener(
495                 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
496         throw ( ::com::sun::star::uno::RuntimeException );
497 
498 // XEventBroadcaster
499     virtual void SAL_CALL addEventListener(
500                 const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
501         throw ( ::com::sun::star::uno::RuntimeException );
502 
503     virtual void SAL_CALL removeEventListener(
504                 const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
505         throw ( ::com::sun::star::uno::RuntimeException );
506 
507     // XChild
508     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  ) throw (::com::sun::star::uno::RuntimeException);
509     virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
510 
511     // XDefaultSizeTransmitter
512     //#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
513     virtual void SAL_CALL setDefaultSize( const ::com::sun::star::awt::Size& rSize_100TH_MM ) throw (::com::sun::star::uno::RuntimeException);
514 };
515 
516 #endif
517 
518