1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dummyobject.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _INC_DUMMYOBJECT_HXX_
32 #define _INC_DUMMYOBJECT_HXX_
34 #include <com/sun/star/uno/Sequence.hxx>
35 #include <com/sun/star/uno/Reference.hxx>
36 #include <com/sun/star/uno/Any.hxx>
37 #include <com/sun/star/embed/XEmbeddedObject.hpp>
38 #include <com/sun/star/embed/XEmbedPersist.hpp>
39 #include <cppuhelper/implbase2.hxx>
41 namespace com
{ namespace sun
{ namespace star
{
50 class XMultiServiceFactory
;
62 class OMultiTypeInterfaceContainerHelper
;
65 class ODummyEmbeddedObject
: public ::cppu::WeakImplHelper2
66 < ::com::sun::star::embed::XEmbeddedObject
67 , ::com::sun::star::embed::XEmbedPersist
>
69 ::osl::Mutex m_aMutex
;
70 ::cppu::OMultiTypeInterfaceContainerHelper
* m_pInterfaceContainer
;
73 ::rtl::OUString m_aEntryName
;
74 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
> m_xParentStorage
;
75 sal_Int32 m_nObjectState
;
77 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XEmbeddedClient
> m_xClientSite
;
79 sal_Int64 m_nCachedAspect
;
80 ::com::sun::star::awt::Size m_aCachedSize
;
81 sal_Bool m_bHasCachedSize
;
83 // following information will be used between SaveAs and SaveCompleted
84 sal_Bool m_bWaitSaveCompleted
;
85 ::rtl::OUString m_aNewEntryName
;
86 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
> m_xNewParentStorage
;
90 void PostEvent_Impl( const ::rtl::OUString
& aEventName
,
91 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xSource
);
95 ODummyEmbeddedObject()
96 : m_pInterfaceContainer( NULL
)
97 , m_bDisposed( sal_False
)
98 , m_nObjectState( -1 )
99 , m_nCachedAspect( 0 )
100 , m_bHasCachedSize( sal_False
)
101 , m_bWaitSaveCompleted( sal_False
)
104 ~ODummyEmbeddedObject();
108 virtual void SAL_CALL
changeState( sal_Int32 nNewState
)
109 throw ( ::com::sun::star::embed::UnreachableStateException
,
110 ::com::sun::star::embed::WrongStateException
,
111 ::com::sun::star::uno::Exception
,
112 ::com::sun::star::uno::RuntimeException
);
114 virtual ::com::sun::star::uno::Sequence
< sal_Int32
> SAL_CALL
getReachableStates()
115 throw ( ::com::sun::star::embed::WrongStateException
,
116 ::com::sun::star::uno::RuntimeException
);
118 virtual sal_Int32 SAL_CALL
getCurrentState()
119 throw ( ::com::sun::star::embed::WrongStateException
,
120 ::com::sun::star::uno::RuntimeException
);
122 virtual void SAL_CALL
doVerb( sal_Int32 nVerbID
)
123 throw ( ::com::sun::star::lang::IllegalArgumentException
,
124 ::com::sun::star::embed::WrongStateException
,
125 ::com::sun::star::embed::UnreachableStateException
,
126 ::com::sun::star::uno::Exception
,
127 ::com::sun::star::uno::RuntimeException
);
129 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::embed::VerbDescriptor
> SAL_CALL
getSupportedVerbs()
130 throw ( ::com::sun::star::embed::WrongStateException
,
131 ::com::sun::star::uno::RuntimeException
);
133 virtual void SAL_CALL
setClientSite(
134 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XEmbeddedClient
>& xClient
)
135 throw ( ::com::sun::star::embed::WrongStateException
,
136 ::com::sun::star::uno::RuntimeException
);
138 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XEmbeddedClient
> SAL_CALL
getClientSite()
139 throw ( ::com::sun::star::embed::WrongStateException
,
140 ::com::sun::star::uno::RuntimeException
);
142 virtual void SAL_CALL
update()
143 throw ( ::com::sun::star::embed::WrongStateException
,
144 ::com::sun::star::uno::Exception
,
145 ::com::sun::star::uno::RuntimeException
);
147 virtual void SAL_CALL
setUpdateMode( sal_Int32 nMode
)
148 throw ( ::com::sun::star::embed::WrongStateException
,
149 ::com::sun::star::uno::RuntimeException
);
151 virtual sal_Int64 SAL_CALL
getStatus( sal_Int64 nAspect
)
152 throw ( ::com::sun::star::embed::WrongStateException
,
153 ::com::sun::star::uno::RuntimeException
);
155 virtual void SAL_CALL
setContainerName( const ::rtl::OUString
& sName
)
156 throw ( ::com::sun::star::uno::RuntimeException
);
161 virtual void SAL_CALL
setVisualAreaSize( sal_Int64 nAspect
, const ::com::sun::star::awt::Size
& aSize
)
162 throw ( ::com::sun::star::lang::IllegalArgumentException
,
163 ::com::sun::star::embed::WrongStateException
,
164 ::com::sun::star::uno::Exception
,
165 ::com::sun::star::uno::RuntimeException
);
167 virtual ::com::sun::star::awt::Size SAL_CALL
getVisualAreaSize( sal_Int64 nAspect
)
168 throw ( ::com::sun::star::lang::IllegalArgumentException
,
169 ::com::sun::star::embed::WrongStateException
,
170 ::com::sun::star::uno::Exception
,
171 ::com::sun::star::uno::RuntimeException
);
173 virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL
getPreferredVisualRepresentation( ::sal_Int64 nAspect
)
174 throw ( ::com::sun::star::lang::IllegalArgumentException
,
175 ::com::sun::star::embed::WrongStateException
,
176 ::com::sun::star::uno::Exception
,
177 ::com::sun::star::uno::RuntimeException
);
179 virtual sal_Int32 SAL_CALL
getMapUnit( sal_Int64 nAspect
)
180 throw ( ::com::sun::star::uno::Exception
,
181 ::com::sun::star::uno::RuntimeException
);
185 virtual void SAL_CALL
setPersistentEntry(
186 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xStorage
,
187 const ::rtl::OUString
& sEntName
,
188 sal_Int32 nEntryConnectionMode
,
189 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lArguments
,
190 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lObjArgs
)
191 throw ( ::com::sun::star::lang::IllegalArgumentException
,
192 ::com::sun::star::embed::WrongStateException
,
193 ::com::sun::star::io::IOException
,
194 ::com::sun::star::uno::Exception
,
195 ::com::sun::star::uno::RuntimeException
);
197 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
)
198 throw ( ::com::sun::star::lang::IllegalArgumentException
,
199 ::com::sun::star::embed::WrongStateException
,
200 ::com::sun::star::io::IOException
,
201 ::com::sun::star::uno::Exception
,
202 ::com::sun::star::uno::RuntimeException
);
204 virtual void SAL_CALL
storeAsEntry(
205 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xStorage
,
206 const ::rtl::OUString
& sEntName
,
207 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lArguments
,
208 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lObjArgs
)
209 throw ( ::com::sun::star::lang::IllegalArgumentException
,
210 ::com::sun::star::embed::WrongStateException
,
211 ::com::sun::star::io::IOException
,
212 ::com::sun::star::uno::Exception
,
213 ::com::sun::star::uno::RuntimeException
);
215 virtual void SAL_CALL
saveCompleted( sal_Bool bUseNew
)
216 throw ( ::com::sun::star::embed::WrongStateException
,
217 ::com::sun::star::uno::Exception
,
218 ::com::sun::star::uno::RuntimeException
);
220 virtual sal_Bool SAL_CALL
hasEntry()
221 throw ( ::com::sun::star::embed::WrongStateException
,
222 ::com::sun::star::uno::RuntimeException
);
224 virtual ::rtl::OUString SAL_CALL
getEntryName()
225 throw ( ::com::sun::star::embed::WrongStateException
,
226 ::com::sun::star::uno::RuntimeException
);
229 // XCommonEmbedPersist
231 virtual void SAL_CALL
storeOwn()
232 throw ( ::com::sun::star::embed::WrongStateException
,
233 ::com::sun::star::io::IOException
,
234 ::com::sun::star::uno::Exception
,
235 ::com::sun::star::uno::RuntimeException
);
237 virtual sal_Bool SAL_CALL
isReadonly()
238 throw ( ::com::sun::star::embed::WrongStateException
,
239 ::com::sun::star::uno::RuntimeException
);
241 virtual void SAL_CALL
reload(
242 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lArguments
,
243 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lObjArgs
)
244 throw ( ::com::sun::star::lang::IllegalArgumentException
,
245 ::com::sun::star::embed::WrongStateException
,
246 ::com::sun::star::io::IOException
,
247 ::com::sun::star::uno::Exception
,
248 ::com::sun::star::uno::RuntimeException
);
253 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getClassID()
254 throw ( ::com::sun::star::uno::RuntimeException
);
256 virtual ::rtl::OUString SAL_CALL
getClassName()
257 throw ( ::com::sun::star::uno::RuntimeException
);
259 virtual void SAL_CALL
setClassInfo(
260 const ::com::sun::star::uno::Sequence
< sal_Int8
>& aClassID
, const ::rtl::OUString
& aClassName
)
261 throw ( ::com::sun::star::lang::NoSupportException
,
262 ::com::sun::star::uno::RuntimeException
);
265 // XComponentSupplier
267 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloseable
> SAL_CALL
getComponent()
268 throw ( ::com::sun::star::uno::RuntimeException
);
270 // XStateChangeBroadcaster
271 virtual void SAL_CALL
addStateChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStateChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
272 virtual void SAL_CALL
removeStateChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStateChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
276 virtual void SAL_CALL
close( sal_Bool DeliverOwnership
)
277 throw ( ::com::sun::star::util::CloseVetoException
,
278 ::com::sun::star::uno::RuntimeException
);
280 virtual void SAL_CALL
addCloseListener(
281 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloseListener
>& Listener
)
282 throw ( ::com::sun::star::uno::RuntimeException
);
284 virtual void SAL_CALL
removeCloseListener(
285 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloseListener
>& Listener
)
286 throw ( ::com::sun::star::uno::RuntimeException
);
289 virtual void SAL_CALL
addEventListener(
290 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEventListener
>& Listener
)
291 throw ( ::com::sun::star::uno::RuntimeException
);
293 virtual void SAL_CALL
removeEventListener(
294 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEventListener
>& Listener
)
295 throw ( ::com::sun::star::uno::RuntimeException
);