1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _UNOOBJ_HXX 28 #define _UNOOBJ_HXX 29 30 #include <com/sun/star/beans/XPropertyState.hpp> 31 #include <com/sun/star/beans/XPropertySet.hpp> 32 #include <com/sun/star/lang/XServiceInfo.hpp> 33 #include <com/sun/star/drawing/XShape.hpp> 34 #include <com/sun/star/document/XEventsSupplier.hpp> 35 #include <com/sun/star/document/XEventsSupplier.hpp> 36 #include <com/sun/star/lang/XTypeProvider.hpp> 37 #include <svx/svdpool.hxx> 38 #include <svx/unomaster.hxx> 39 40 #include <editeng/unoipset.hxx> 41 42 #include <cppuhelper/implbase2.hxx> 43 44 class SdrObject; 45 class SdXImpressDocument; 46 class SdAnimationInfo; 47 48 class SdXShape : public SvxShapeMaster, 49 public ::com::sun::star::document::XEventsSupplier 50 { 51 friend class SdUnoEventsAccess; 52 53 private: 54 SvxShape* mpShape; 55 const SvxItemPropertySet* mpPropSet; 56 const SfxItemPropertyMapEntry* mpMap; 57 SdXImpressDocument* mpModel; 58 59 void SetStyleSheet( const ::com::sun::star::uno::Any& rAny ) throw( ::com::sun::star::lang::IllegalArgumentException ); 60 ::com::sun::star::uno::Any GetStyleSheet() const throw( ::com::sun::star::beans::UnknownPropertyException ); 61 62 // Intern 63 SdAnimationInfo* GetAnimationInfo( sal_Bool bCreate = sal_False ) const throw(); 64 sal_Bool IsPresObj() const throw(); 65 void SetPresObj( sal_Bool bPresObj ) throw(); 66 67 sal_Bool IsEmptyPresObj() const throw(); 68 void SetEmptyPresObj( sal_Bool bEmpty ) throw(); 69 70 sal_Bool IsMasterDepend() const throw(); 71 void SetMasterDepend( sal_Bool bDepend ) throw(); 72 73 SdrObject* GetSdrObject() const throw(); 74 75 com::sun::star::uno::Sequence< sal_Int8 >* mpImplementationId; 76 77 public: 78 SdXShape(SvxShape* pShape, SdXImpressDocument* pModel) throw(); 79 virtual ~SdXShape() throw(); 80 81 virtual sal_Bool queryAggregation( const com::sun::star::uno::Type & rType, com::sun::star::uno::Any& aAny ); 82 virtual void dispose(); 83 virtual void modelChanged( SdrModel* pNewModel ); 84 virtual void pageChanged( SdrPage* pNewPage ); 85 virtual void objectChanged( SdrObject* pNewObj ); 86 87 // XInterface 88 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); 89 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); 90 virtual void SAL_CALL acquire() throw(); 91 virtual void SAL_CALL release() throw(); 92 93 // XServiceInfo 94 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 95 96 //XPropertySet 97 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 98 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 99 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 100 101 //XPropertyState 102 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 103 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 104 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 105 106 // XTypeProvider 107 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 108 109 // XEventsSupplier 110 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw(::com::sun::star::uno::RuntimeException); 111 112 private: 113 void setOldEffect( const com::sun::star::uno::Any& aValue ); 114 void setOldTextEffect( const com::sun::star::uno::Any& aValue ); 115 void setOldSpeed( const com::sun::star::uno::Any& aValue ); 116 void setOldDimColor( const com::sun::star::uno::Any& aValue ); 117 void setOldDimHide( const com::sun::star::uno::Any& aValue ); 118 void setOldDimPrevious( const com::sun::star::uno::Any& aValue ); 119 void setOldPresOrder( const com::sun::star::uno::Any& aValue ); 120 void updateOldSoundEffect( SdAnimationInfo* pInfo ); 121 122 void getOldEffect( com::sun::star::uno::Any& rValue ) const; 123 void getOldTextEffect( com::sun::star::uno::Any& rValue ) const; 124 void getOldSpeed( com::sun::star::uno::Any& rValue ) const; 125 void getOldSoundFile( com::sun::star::uno::Any& rValue ) const; 126 void getOldSoundOn( com::sun::star::uno::Any& rValue ) const; 127 void getOldDimColor( com::sun::star::uno::Any& rValue ) const; 128 void getOldDimHide( com::sun::star::uno::Any& rValue ) const; 129 void getOldDimPrev( com::sun::star::uno::Any& rValue ) const; 130 void getOldPresOrder( com::sun::star::uno::Any& rValue ) const; 131 }; 132 133 struct SvEventDescription; 134 const SvEventDescription* ImplGetSupportedMacroItems(); 135 136 #endif 137 138 139