1*08421ca6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*08421ca6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*08421ca6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*08421ca6SAndrew Rist  * distributed with this work for additional information
6*08421ca6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*08421ca6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*08421ca6SAndrew Rist  * "License"); you may not use this file except in compliance
9*08421ca6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*08421ca6SAndrew Rist  *
11*08421ca6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*08421ca6SAndrew Rist  *
13*08421ca6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*08421ca6SAndrew Rist  * software distributed under the License is distributed on an
15*08421ca6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*08421ca6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*08421ca6SAndrew Rist  * specific language governing permissions and limitations
18*08421ca6SAndrew Rist  * under the License.
19*08421ca6SAndrew Rist  *
20*08421ca6SAndrew Rist  *************************************************************/
21*08421ca6SAndrew Rist 
22*08421ca6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _INC_DUMMYOBJECT_HXX_
25cdf0e10cSrcweir #define _INC_DUMMYOBJECT_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
28cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
29cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
30cdf0e10cSrcweir #include <com/sun/star/embed/XEmbeddedObject.hpp>
31cdf0e10cSrcweir #include <com/sun/star/embed/XEmbedPersist.hpp>
32cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace com { namespace sun { namespace star {
35cdf0e10cSrcweir 	namespace embed {
36cdf0e10cSrcweir 		class XStorage;
37cdf0e10cSrcweir 	}
38cdf0e10cSrcweir 	namespace frame {
39cdf0e10cSrcweir 		class XModel;
40cdf0e10cSrcweir 		class XFrame;
41cdf0e10cSrcweir 	}
42cdf0e10cSrcweir 	namespace lang {
43cdf0e10cSrcweir 		class XMultiServiceFactory;
44cdf0e10cSrcweir 	}
45cdf0e10cSrcweir 	namespace util {
46cdf0e10cSrcweir 		class XCloseListener;
47cdf0e10cSrcweir 	}
48cdf0e10cSrcweir 	namespace beans {
49cdf0e10cSrcweir 		struct PropertyValue;
50cdf0e10cSrcweir 		struct NamedValue;
51cdf0e10cSrcweir 	}
52cdf0e10cSrcweir }}}
53cdf0e10cSrcweir 
54cdf0e10cSrcweir namespace cppu {
55cdf0e10cSrcweir 	class OMultiTypeInterfaceContainerHelper;
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir class ODummyEmbeddedObject : public ::cppu::WeakImplHelper2
59cdf0e10cSrcweir 						< ::com::sun::star::embed::XEmbeddedObject
60cdf0e10cSrcweir 						, ::com::sun::star::embed::XEmbedPersist >
61cdf0e10cSrcweir {
62cdf0e10cSrcweir 	::osl::Mutex	m_aMutex;
63cdf0e10cSrcweir 	::cppu::OMultiTypeInterfaceContainerHelper* m_pInterfaceContainer;
64cdf0e10cSrcweir 	sal_Bool m_bDisposed;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	::rtl::OUString m_aEntryName;
67cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
68cdf0e10cSrcweir 	sal_Int32 m_nObjectState;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > m_xClientSite;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	sal_Int64 m_nCachedAspect;
73cdf0e10cSrcweir 	::com::sun::star::awt::Size m_aCachedSize;
74cdf0e10cSrcweir 	sal_Bool m_bHasCachedSize;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	// following information will be used between SaveAs and SaveCompleted
77cdf0e10cSrcweir 	sal_Bool m_bWaitSaveCompleted;
78cdf0e10cSrcweir 	::rtl::OUString m_aNewEntryName;
79cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewParentStorage;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir protected:
82cdf0e10cSrcweir 	void CheckInit();
83cdf0e10cSrcweir 	void PostEvent_Impl( const ::rtl::OUString& aEventName,
84cdf0e10cSrcweir 						const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xSource );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir public:
87cdf0e10cSrcweir 
ODummyEmbeddedObject()88cdf0e10cSrcweir 	ODummyEmbeddedObject()
89cdf0e10cSrcweir 	: m_pInterfaceContainer( NULL )
90cdf0e10cSrcweir 	, m_bDisposed( sal_False )
91cdf0e10cSrcweir 	, m_nObjectState( -1 )
92cdf0e10cSrcweir 	, m_nCachedAspect( 0 )
93cdf0e10cSrcweir 	, m_bHasCachedSize( sal_False )
94cdf0e10cSrcweir 	, m_bWaitSaveCompleted( sal_False )
95cdf0e10cSrcweir 	{}
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	~ODummyEmbeddedObject();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir // XEmbeddedObject
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     virtual void SAL_CALL changeState( sal_Int32 nNewState )
102cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::UnreachableStateException,
103cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
104cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
105cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates()
108cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
109cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getCurrentState()
112cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
113cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
116cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
117cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
118cdf0e10cSrcweir 				::com::sun::star::embed::UnreachableStateException,
119cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
120cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > SAL_CALL getSupportedVerbs()
123cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
124cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     virtual void SAL_CALL setClientSite(
127cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient >& xClient )
128cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
129cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > SAL_CALL getClientSite()
132cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
133cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
134cdf0e10cSrcweir 
135cdf0e10cSrcweir     virtual void SAL_CALL update()
136cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
137cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
138cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     virtual void SAL_CALL setUpdateMode( sal_Int32 nMode )
141cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
142cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect )
145cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
146cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
147cdf0e10cSrcweir 
148cdf0e10cSrcweir     virtual void SAL_CALL setContainerName( const ::rtl::OUString& sName )
149cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
150cdf0e10cSrcweir 
151cdf0e10cSrcweir 
152cdf0e10cSrcweir // XVisualObject
153cdf0e10cSrcweir 
154cdf0e10cSrcweir     virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
155cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
156cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
157cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
158cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
159cdf0e10cSrcweir 
160cdf0e10cSrcweir     virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
161cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
162cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
163cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
164cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
165cdf0e10cSrcweir 
166cdf0e10cSrcweir     virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
167cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
168cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
169cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
170cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
171cdf0e10cSrcweir 
172cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
173cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::Exception,
174cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException);
175cdf0e10cSrcweir 
176cdf0e10cSrcweir // XEmbedPersist
177cdf0e10cSrcweir 
178cdf0e10cSrcweir     virtual void SAL_CALL setPersistentEntry(
179cdf0e10cSrcweir 					const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
180cdf0e10cSrcweir 					const ::rtl::OUString& sEntName,
181cdf0e10cSrcweir 					sal_Int32 nEntryConnectionMode,
182cdf0e10cSrcweir 					const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
183cdf0e10cSrcweir 					const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
184cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
185cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
186cdf0e10cSrcweir 				::com::sun::star::io::IOException,
187cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
188cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
189cdf0e10cSrcweir 
190cdf0e10cSrcweir     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 )
191cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
192cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
193cdf0e10cSrcweir 				::com::sun::star::io::IOException,
194cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
195cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
196cdf0e10cSrcweir 
197cdf0e10cSrcweir     virtual void SAL_CALL storeAsEntry(
198cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
199cdf0e10cSrcweir 				const ::rtl::OUString& sEntName,
200cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
201cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
202cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
203cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
204cdf0e10cSrcweir 				::com::sun::star::io::IOException,
205cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
206cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
207cdf0e10cSrcweir 
208cdf0e10cSrcweir     virtual void SAL_CALL saveCompleted( sal_Bool bUseNew )
209cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
210cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
211cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
212cdf0e10cSrcweir 
213cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasEntry()
214cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
215cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
216cdf0e10cSrcweir 
217cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getEntryName()
218cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
219cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 
222cdf0e10cSrcweir // XCommonEmbedPersist
223cdf0e10cSrcweir 
224cdf0e10cSrcweir     virtual void SAL_CALL storeOwn()
225cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
226cdf0e10cSrcweir 				::com::sun::star::io::IOException,
227cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
228cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isReadonly()
231cdf0e10cSrcweir 		throw ( ::com::sun::star::embed::WrongStateException,
232cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     virtual void SAL_CALL reload(
235cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
236cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
237cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::IllegalArgumentException,
238cdf0e10cSrcweir 				::com::sun::star::embed::WrongStateException,
239cdf0e10cSrcweir 				::com::sun::star::io::IOException,
240cdf0e10cSrcweir 				::com::sun::star::uno::Exception,
241cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 
244cdf0e10cSrcweir // XClassifiedObject
245cdf0e10cSrcweir 
246cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getClassID()
247cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
248cdf0e10cSrcweir 
249cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getClassName()
250cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
251cdf0e10cSrcweir 
252cdf0e10cSrcweir     virtual void SAL_CALL setClassInfo(
253cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName )
254cdf0e10cSrcweir 		throw ( ::com::sun::star::lang::NoSupportException,
255cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
256cdf0e10cSrcweir 
257cdf0e10cSrcweir 
258cdf0e10cSrcweir // XComponentSupplier
259cdf0e10cSrcweir 
260cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent()
261cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
262cdf0e10cSrcweir 
263cdf0e10cSrcweir // XStateChangeBroadcaster
264cdf0e10cSrcweir     virtual void SAL_CALL addStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
265cdf0e10cSrcweir     virtual void SAL_CALL removeStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
266cdf0e10cSrcweir 
267cdf0e10cSrcweir // XCloseable
268cdf0e10cSrcweir 
269cdf0e10cSrcweir     virtual void SAL_CALL close( sal_Bool DeliverOwnership )
270cdf0e10cSrcweir 		throw ( ::com::sun::star::util::CloseVetoException,
271cdf0e10cSrcweir 				::com::sun::star::uno::RuntimeException );
272cdf0e10cSrcweir 
273cdf0e10cSrcweir     virtual void SAL_CALL addCloseListener(
274cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
275cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
276cdf0e10cSrcweir 
277cdf0e10cSrcweir     virtual void SAL_CALL removeCloseListener(
278cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
279cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
280cdf0e10cSrcweir 
281cdf0e10cSrcweir // XEventBroadcaster
282cdf0e10cSrcweir     virtual void SAL_CALL addEventListener(
283cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
284cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
285cdf0e10cSrcweir 
286cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener(
287cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
288cdf0e10cSrcweir 		throw ( ::com::sun::star::uno::RuntimeException );
289cdf0e10cSrcweir 
290cdf0e10cSrcweir };
291cdf0e10cSrcweir 
292cdf0e10cSrcweir #endif
293cdf0e10cSrcweir 
294