1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _INC_DUMMYOBJECT_HXX_
30 #define _INC_DUMMYOBJECT_HXX_
32 #include <com/sun/star/uno/Sequence.hxx>
33 #include <com/sun/star/uno/Reference.hxx>
34 #include <com/sun/star/uno/Any.hxx>
35 #include <com/sun/star/embed/XEmbeddedObject.hpp>
36 #include <com/sun/star/embed/XEmbedPersist.hpp>
37 #include <cppuhelper/implbase2.hxx>
39 namespace com
{ namespace sun
{ namespace star
{
48 class XMultiServiceFactory
;
60 class OMultiTypeInterfaceContainerHelper
;
63 class ODummyEmbeddedObject
: public ::cppu::WeakImplHelper2
64 < ::com::sun::star::embed::XEmbeddedObject
65 , ::com::sun::star::embed::XEmbedPersist
>
67 ::osl::Mutex m_aMutex
;
68 ::cppu::OMultiTypeInterfaceContainerHelper
* m_pInterfaceContainer
;
71 ::rtl::OUString m_aEntryName
;
72 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
> m_xParentStorage
;
73 sal_Int32 m_nObjectState
;
75 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XEmbeddedClient
> m_xClientSite
;
77 sal_Int64 m_nCachedAspect
;
78 ::com::sun::star::awt::Size m_aCachedSize
;
79 sal_Bool m_bHasCachedSize
;
81 // following information will be used between SaveAs and SaveCompleted
82 sal_Bool m_bWaitSaveCompleted
;
83 ::rtl::OUString m_aNewEntryName
;
84 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
> m_xNewParentStorage
;
88 void PostEvent_Impl( const ::rtl::OUString
& aEventName
);
92 ODummyEmbeddedObject()
93 : m_pInterfaceContainer( NULL
)
94 , m_bDisposed( sal_False
)
95 , m_nObjectState( -1 )
96 , m_nCachedAspect( 0 )
97 , m_bHasCachedSize( sal_False
)
98 , m_bWaitSaveCompleted( sal_False
)
101 ~ODummyEmbeddedObject();
105 virtual void SAL_CALL
changeState( sal_Int32 nNewState
)
106 throw ( ::com::sun::star::embed::UnreachableStateException
,
107 ::com::sun::star::embed::WrongStateException
,
108 ::com::sun::star::uno::Exception
,
109 ::com::sun::star::uno::RuntimeException
);
111 virtual ::com::sun::star::uno::Sequence
< sal_Int32
> SAL_CALL
getReachableStates()
112 throw ( ::com::sun::star::embed::WrongStateException
,
113 ::com::sun::star::uno::RuntimeException
);
115 virtual sal_Int32 SAL_CALL
getCurrentState()
116 throw ( ::com::sun::star::embed::WrongStateException
,
117 ::com::sun::star::uno::RuntimeException
);
119 virtual void SAL_CALL
doVerb( sal_Int32 nVerbID
)
120 throw ( ::com::sun::star::lang::IllegalArgumentException
,
121 ::com::sun::star::embed::WrongStateException
,
122 ::com::sun::star::embed::UnreachableStateException
,
123 ::com::sun::star::uno::Exception
,
124 ::com::sun::star::uno::RuntimeException
);
126 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::embed::VerbDescriptor
> SAL_CALL
getSupportedVerbs()
127 throw ( ::com::sun::star::embed::WrongStateException
,
128 ::com::sun::star::uno::RuntimeException
);
130 virtual void SAL_CALL
setClientSite(
131 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XEmbeddedClient
>& xClient
)
132 throw ( ::com::sun::star::embed::WrongStateException
,
133 ::com::sun::star::uno::RuntimeException
);
135 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XEmbeddedClient
> SAL_CALL
getClientSite()
136 throw ( ::com::sun::star::embed::WrongStateException
,
137 ::com::sun::star::uno::RuntimeException
);
139 virtual void SAL_CALL
update()
140 throw ( ::com::sun::star::embed::WrongStateException
,
141 ::com::sun::star::uno::Exception
,
142 ::com::sun::star::uno::RuntimeException
);
144 virtual void SAL_CALL
setUpdateMode( sal_Int32 nMode
)
145 throw ( ::com::sun::star::embed::WrongStateException
,
146 ::com::sun::star::uno::RuntimeException
);
148 virtual sal_Int64 SAL_CALL
getStatus( sal_Int64 nAspect
)
149 throw ( ::com::sun::star::embed::WrongStateException
,
150 ::com::sun::star::uno::RuntimeException
);
152 virtual void SAL_CALL
setContainerName( const ::rtl::OUString
& sName
)
153 throw ( ::com::sun::star::uno::RuntimeException
);
158 virtual void SAL_CALL
setVisualAreaSize( sal_Int64 nAspect
, const ::com::sun::star::awt::Size
& aSize
)
159 throw ( ::com::sun::star::lang::IllegalArgumentException
,
160 ::com::sun::star::embed::WrongStateException
,
161 ::com::sun::star::uno::Exception
,
162 ::com::sun::star::uno::RuntimeException
);
164 virtual ::com::sun::star::awt::Size SAL_CALL
getVisualAreaSize( sal_Int64 nAspect
)
165 throw ( ::com::sun::star::lang::IllegalArgumentException
,
166 ::com::sun::star::embed::WrongStateException
,
167 ::com::sun::star::uno::Exception
,
168 ::com::sun::star::uno::RuntimeException
);
170 virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL
getPreferredVisualRepresentation( ::sal_Int64 nAspect
)
171 throw ( ::com::sun::star::lang::IllegalArgumentException
,
172 ::com::sun::star::embed::WrongStateException
,
173 ::com::sun::star::uno::Exception
,
174 ::com::sun::star::uno::RuntimeException
);
176 virtual sal_Int32 SAL_CALL
getMapUnit( sal_Int64 nAspect
)
177 throw ( ::com::sun::star::uno::Exception
,
178 ::com::sun::star::uno::RuntimeException
);
182 virtual void SAL_CALL
setPersistentEntry(
183 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xStorage
,
184 const ::rtl::OUString
& sEntName
,
185 sal_Int32 nEntryConnectionMode
,
186 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lArguments
,
187 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lObjArgs
)
188 throw ( ::com::sun::star::lang::IllegalArgumentException
,
189 ::com::sun::star::embed::WrongStateException
,
190 ::com::sun::star::io::IOException
,
191 ::com::sun::star::uno::Exception
,
192 ::com::sun::star::uno::RuntimeException
);
194 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
)
195 throw ( ::com::sun::star::lang::IllegalArgumentException
,
196 ::com::sun::star::embed::WrongStateException
,
197 ::com::sun::star::io::IOException
,
198 ::com::sun::star::uno::Exception
,
199 ::com::sun::star::uno::RuntimeException
);
201 virtual void SAL_CALL
storeAsEntry(
202 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xStorage
,
203 const ::rtl::OUString
& sEntName
,
204 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lArguments
,
205 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lObjArgs
)
206 throw ( ::com::sun::star::lang::IllegalArgumentException
,
207 ::com::sun::star::embed::WrongStateException
,
208 ::com::sun::star::io::IOException
,
209 ::com::sun::star::uno::Exception
,
210 ::com::sun::star::uno::RuntimeException
);
212 virtual void SAL_CALL
saveCompleted( sal_Bool bUseNew
)
213 throw ( ::com::sun::star::embed::WrongStateException
,
214 ::com::sun::star::uno::Exception
,
215 ::com::sun::star::uno::RuntimeException
);
217 virtual sal_Bool SAL_CALL
hasEntry()
218 throw ( ::com::sun::star::embed::WrongStateException
,
219 ::com::sun::star::uno::RuntimeException
);
221 virtual ::rtl::OUString SAL_CALL
getEntryName()
222 throw ( ::com::sun::star::embed::WrongStateException
,
223 ::com::sun::star::uno::RuntimeException
);
226 // XCommonEmbedPersist
228 virtual void SAL_CALL
storeOwn()
229 throw ( ::com::sun::star::embed::WrongStateException
,
230 ::com::sun::star::io::IOException
,
231 ::com::sun::star::uno::Exception
,
232 ::com::sun::star::uno::RuntimeException
);
234 virtual sal_Bool SAL_CALL
isReadonly()
235 throw ( ::com::sun::star::embed::WrongStateException
,
236 ::com::sun::star::uno::RuntimeException
);
238 virtual void SAL_CALL
reload(
239 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lArguments
,
240 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lObjArgs
)
241 throw ( ::com::sun::star::lang::IllegalArgumentException
,
242 ::com::sun::star::embed::WrongStateException
,
243 ::com::sun::star::io::IOException
,
244 ::com::sun::star::uno::Exception
,
245 ::com::sun::star::uno::RuntimeException
);
250 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getClassID()
251 throw ( ::com::sun::star::uno::RuntimeException
);
253 virtual ::rtl::OUString SAL_CALL
getClassName()
254 throw ( ::com::sun::star::uno::RuntimeException
);
256 virtual void SAL_CALL
setClassInfo(
257 const ::com::sun::star::uno::Sequence
< sal_Int8
>& aClassID
, const ::rtl::OUString
& aClassName
)
258 throw ( ::com::sun::star::lang::NoSupportException
,
259 ::com::sun::star::uno::RuntimeException
);
262 // XComponentSupplier
264 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloseable
> SAL_CALL
getComponent()
265 throw ( ::com::sun::star::uno::RuntimeException
);
267 // XStateChangeBroadcaster
268 virtual void SAL_CALL
addStateChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStateChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
269 virtual void SAL_CALL
removeStateChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStateChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
273 virtual void SAL_CALL
close( sal_Bool DeliverOwnership
)
274 throw ( ::com::sun::star::util::CloseVetoException
,
275 ::com::sun::star::uno::RuntimeException
);
277 virtual void SAL_CALL
addCloseListener(
278 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloseListener
>& Listener
)
279 throw ( ::com::sun::star::uno::RuntimeException
);
281 virtual void SAL_CALL
removeCloseListener(
282 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloseListener
>& Listener
)
283 throw ( ::com::sun::star::uno::RuntimeException
);
286 virtual void SAL_CALL
addEventListener(
287 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEventListener
>& Listener
)
288 throw ( ::com::sun::star::uno::RuntimeException
);
290 virtual void SAL_CALL
removeEventListener(
291 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEventListener
>& Listener
)
292 throw ( ::com::sun::star::uno::RuntimeException
);
298 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */