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