1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _UNOOBJ_HXX 24 #define _UNOOBJ_HXX 25 26 #include <com/sun/star/beans/XPropertyState.hpp> 27 #include <com/sun/star/beans/XPropertySet.hpp> 28 #include <com/sun/star/lang/XServiceInfo.hpp> 29 #include <com/sun/star/drawing/XShape.hpp> 30 #include <com/sun/star/document/XEventsSupplier.hpp> 31 #include <com/sun/star/document/XEventsSupplier.hpp> 32 #include <com/sun/star/lang/XTypeProvider.hpp> 33 #include <svx/svdpool.hxx> 34 #include <svx/unomaster.hxx> 35 36 #include <editeng/unoipset.hxx> 37 38 #include <cppuhelper/implbase2.hxx> 39 40 class SdrObject; 41 class SdXImpressDocument; 42 class SdAnimationInfo; 43 44 class SdXShape : public SvxShapeMaster, 45 public ::com::sun::star::document::XEventsSupplier 46 { 47 friend class SdUnoEventsAccess; 48 49 private: 50 SvxShape* mpShape; 51 const SvxItemPropertySet* mpPropSet; 52 const SfxItemPropertyMapEntry* mpMap; 53 SdXImpressDocument* mpModel; 54 55 void SetStyleSheet( const ::com::sun::star::uno::Any& rAny ) throw( ::com::sun::star::lang::IllegalArgumentException ); 56 ::com::sun::star::uno::Any GetStyleSheet() const throw( ::com::sun::star::beans::UnknownPropertyException ); 57 58 // Intern 59 SdAnimationInfo* GetAnimationInfo( sal_Bool bCreate = sal_False ) const throw(); 60 sal_Bool IsPresObj() const throw(); 61 void SetPresObj( sal_Bool bPresObj ) throw(); 62 63 sal_Bool IsEmptyPresObj() const throw(); 64 void SetEmptyPresObj( sal_Bool bEmpty ) throw(); 65 66 sal_Bool IsMasterDepend() const throw(); 67 void SetMasterDepend( sal_Bool bDepend ) throw(); 68 69 SdrObject* GetSdrObject() const throw(); 70 71 com::sun::star::uno::Sequence< sal_Int8 >* mpImplementationId; 72 73 public: 74 SdXShape(SvxShape* pShape, SdXImpressDocument* pModel) throw(); 75 virtual ~SdXShape() throw(); 76 77 virtual sal_Bool queryAggregation( const com::sun::star::uno::Type & rType, com::sun::star::uno::Any& aAny ); 78 virtual void dispose(); 79 virtual void modelChanged( SdrModel* pNewModel ); 80 virtual void pageChanged( SdrPage* pNewPage ); 81 virtual void objectChanged( SdrObject* pNewObj ); 82 83 // XInterface 84 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); 85 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); 86 virtual void SAL_CALL acquire() throw(); 87 virtual void SAL_CALL release() throw(); 88 89 // XServiceInfo 90 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 91 92 //XPropertySet 93 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 94 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); 95 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); 96 97 //XPropertyState 98 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 99 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 100 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); 101 102 // XTypeProvider 103 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 104 105 // XEventsSupplier 106 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents( ) throw(::com::sun::star::uno::RuntimeException); 107 108 private: 109 void setOldEffect( const com::sun::star::uno::Any& aValue ); 110 void setOldTextEffect( const com::sun::star::uno::Any& aValue ); 111 void setOldSpeed( const com::sun::star::uno::Any& aValue ); 112 void setOldDimColor( const com::sun::star::uno::Any& aValue ); 113 void setOldDimHide( const com::sun::star::uno::Any& aValue ); 114 void setOldDimPrevious( const com::sun::star::uno::Any& aValue ); 115 void setOldPresOrder( const com::sun::star::uno::Any& aValue ); 116 void updateOldSoundEffect( SdAnimationInfo* pInfo ); 117 118 void getOldEffect( com::sun::star::uno::Any& rValue ) const; 119 void getOldTextEffect( com::sun::star::uno::Any& rValue ) const; 120 void getOldSpeed( com::sun::star::uno::Any& rValue ) const; 121 void getOldSoundFile( com::sun::star::uno::Any& rValue ) const; 122 void getOldSoundOn( com::sun::star::uno::Any& rValue ) const; 123 void getOldDimColor( com::sun::star::uno::Any& rValue ) const; 124 void getOldDimHide( com::sun::star::uno::Any& rValue ) const; 125 void getOldDimPrev( com::sun::star::uno::Any& rValue ) const; 126 void getOldPresOrder( com::sun::star::uno::Any& rValue ) const; 127 }; 128 129 struct SvEventDescription; 130 const SvEventDescription* ImplGetSupportedMacroItems(); 131 132 #endif 133 134 135