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 SC_SHAPEUNO_HXX 29*cdf0e10cSrcweir #define SC_SHAPEUNO_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <tools/solar.h> 32*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyState.hpp> 33*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 34*cdf0e10cSrcweir #include <com/sun/star/text/XTextContent.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/text/XText.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/document/XEventsSupplier.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/container/XChild.hpp> 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 42*cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir namespace com { namespace sun { namespace star { 45*cdf0e10cSrcweir namespace uno { 46*cdf0e10cSrcweir class XAggregation; 47*cdf0e10cSrcweir } 48*cdf0e10cSrcweir namespace drawing { 49*cdf0e10cSrcweir class XShape; 50*cdf0e10cSrcweir } 51*cdf0e10cSrcweir }}} 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir class SdrObject; 54*cdf0e10cSrcweir struct SvEventDescription; 55*cdf0e10cSrcweir class ShapeUnoEventAccessImpl; 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir //------------------------------------------------------------------------ 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir // object which aggregates all svx shape objects, 60*cdf0e10cSrcweir // to add own properties 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir typedef ::cppu::WeakImplHelper5 < ::com::sun::star::beans::XPropertySet 63*cdf0e10cSrcweir , ::com::sun::star::beans::XPropertyState 64*cdf0e10cSrcweir , ::com::sun::star::text::XTextContent 65*cdf0e10cSrcweir , ::com::sun::star::document::XEventsSupplier 66*cdf0e10cSrcweir , ::com::sun::star::lang::XServiceInfo 67*cdf0e10cSrcweir > ScShapeObj_Base; 68*cdf0e10cSrcweir typedef ::cppu::ImplHelper1 < ::com::sun::star::text::XText 69*cdf0e10cSrcweir > ScShapeObj_TextBase; 70*cdf0e10cSrcweir typedef ::cppu::ImplHelper1 < ::com::sun::star::container::XChild 71*cdf0e10cSrcweir > ScShapeObj_ChildBase; 72*cdf0e10cSrcweir class ScShapeObj :public ScShapeObj_Base 73*cdf0e10cSrcweir ,public ScShapeObj_TextBase 74*cdf0e10cSrcweir ,public ScShapeObj_ChildBase 75*cdf0e10cSrcweir { 76*cdf0e10cSrcweir private: 77*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg; 78*cdf0e10cSrcweir // cached pointers to avoid repeated queryAggregation calls: 79*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet* pShapePropertySet; 80*cdf0e10cSrcweir ::com::sun::star::beans::XPropertyState* pShapePropertyState; 81*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > mxPropSetInfo; 82*cdf0e10cSrcweir com::sun::star::uno::Sequence< sal_Int8 >* pImplementationId; 83*cdf0e10cSrcweir bool bIsTextShape; 84*cdf0e10cSrcweir bool bIsNoteCaption; 85*cdf0e10cSrcweir bool bInitializedNotifier; 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir SdrObject* GetSdrObject() const throw(); 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir void GetShapePropertySet(); 90*cdf0e10cSrcweir void GetShapePropertyState(); 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir friend class ShapeUnoEventAccessImpl; 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir public: 95*cdf0e10cSrcweir static const SvEventDescription* GetSupportedMacroItems(); 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir // ctor modifies xShape parameter 98*cdf0e10cSrcweir ScShapeObj( ::com::sun::star::uno::Reference< 99*cdf0e10cSrcweir ::com::sun::star::drawing::XShape > & xShape ); 100*cdf0e10cSrcweir virtual ~ScShapeObj(); 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir // XInterface 103*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 104*cdf0e10cSrcweir const ::com::sun::star::uno::Type & rType ) 105*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 106*cdf0e10cSrcweir virtual void SAL_CALL acquire() throw(); 107*cdf0e10cSrcweir virtual void SAL_CALL release() throw(); 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir // XPropertySet 110*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > 111*cdf0e10cSrcweir SAL_CALL getPropertySetInfo() 112*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 113*cdf0e10cSrcweir virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 114*cdf0e10cSrcweir const ::com::sun::star::uno::Any& aValue ) 115*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 116*cdf0e10cSrcweir ::com::sun::star::beans::PropertyVetoException, 117*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 118*cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 119*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 120*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 121*cdf0e10cSrcweir const ::rtl::OUString& PropertyName ) 122*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 123*cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 124*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 125*cdf0e10cSrcweir virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, 126*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 127*cdf0e10cSrcweir ::com::sun::star::beans::XPropertyChangeListener >& xListener ) 128*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 129*cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 130*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 131*cdf0e10cSrcweir virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, 132*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 133*cdf0e10cSrcweir ::com::sun::star::beans::XPropertyChangeListener >& aListener ) 134*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 135*cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 136*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 137*cdf0e10cSrcweir virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, 138*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 139*cdf0e10cSrcweir ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 140*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 141*cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 142*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 143*cdf0e10cSrcweir virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, 144*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 145*cdf0e10cSrcweir ::com::sun::star::beans::XVetoableChangeListener >& aListener ) 146*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 147*cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 148*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir // XPropertyState 151*cdf0e10cSrcweir virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( 152*cdf0e10cSrcweir const ::rtl::OUString& PropertyName ) 153*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 154*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 155*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL 156*cdf0e10cSrcweir getPropertyStates( const ::com::sun::star::uno::Sequence< 157*cdf0e10cSrcweir ::rtl::OUString >& aPropertyName ) 158*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 159*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 160*cdf0e10cSrcweir virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) 161*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 162*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 163*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( 164*cdf0e10cSrcweir const ::rtl::OUString& aPropertyName ) 165*cdf0e10cSrcweir throw(::com::sun::star::beans::UnknownPropertyException, 166*cdf0e10cSrcweir ::com::sun::star::lang::WrappedTargetException, 167*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir // XTextContent 170*cdf0e10cSrcweir virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< 171*cdf0e10cSrcweir ::com::sun::star::text::XTextRange > & xTextRange) 172*cdf0e10cSrcweir throw( ::com::sun::star::lang::IllegalArgumentException, 173*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 174*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 175*cdf0e10cSrcweir getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); 176*cdf0e10cSrcweir 177*cdf0e10cSrcweir // XComponent 178*cdf0e10cSrcweir virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); 179*cdf0e10cSrcweir virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< 180*cdf0e10cSrcweir ::com::sun::star::lang::XEventListener > & aListener) 181*cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ); 182*cdf0e10cSrcweir virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< 183*cdf0e10cSrcweir ::com::sun::star::lang::XEventListener > & aListener) 184*cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException ); 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir // XText 187*cdf0e10cSrcweir virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< 188*cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& xRange, 189*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 190*cdf0e10cSrcweir ::com::sun::star::text::XTextContent >& xContent, 191*cdf0e10cSrcweir sal_Bool bAbsorb ) 192*cdf0e10cSrcweir throw(::com::sun::star::lang::IllegalArgumentException, 193*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 194*cdf0e10cSrcweir virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< 195*cdf0e10cSrcweir ::com::sun::star::text::XTextContent >& xContent ) 196*cdf0e10cSrcweir throw(::com::sun::star::container::NoSuchElementException, 197*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir // XSimpleText 200*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL 201*cdf0e10cSrcweir createTextCursor() throw(::com::sun::star::uno::RuntimeException); 202*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL 203*cdf0e10cSrcweir createTextCursorByRange( const ::com::sun::star::uno::Reference< 204*cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& aTextPosition ) 205*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 206*cdf0e10cSrcweir virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< 207*cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& xRange, 208*cdf0e10cSrcweir const ::rtl::OUString& aString, sal_Bool bAbsorb ) 209*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 210*cdf0e10cSrcweir virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< 211*cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& xRange, 212*cdf0e10cSrcweir sal_Int16 nControlCharacter, sal_Bool bAbsorb ) 213*cdf0e10cSrcweir throw(::com::sun::star::lang::IllegalArgumentException, 214*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 215*cdf0e10cSrcweir 216*cdf0e10cSrcweir // XTextRange 217*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL 218*cdf0e10cSrcweir getText() throw(::com::sun::star::uno::RuntimeException); 219*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 220*cdf0e10cSrcweir getStart() throw(::com::sun::star::uno::RuntimeException); 221*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 222*cdf0e10cSrcweir getEnd() throw(::com::sun::star::uno::RuntimeException); 223*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException); 224*cdf0e10cSrcweir virtual void SAL_CALL setString( const ::rtl::OUString& aString ) 225*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir // XChild 228*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent() 229*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 230*cdf0e10cSrcweir virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xParent ) 231*cdf0e10cSrcweir throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); 232*cdf0e10cSrcweir 233*cdf0e10cSrcweir // XTypeProvider 234*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() 235*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 236*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 237*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 238*cdf0e10cSrcweir 239*cdf0e10cSrcweir // XEventsSupplier 240*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents() 241*cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 242*cdf0e10cSrcweir 243*cdf0e10cSrcweir // XServiceInfo 244*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) 245*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException) ; 246*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 247*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 248*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) 249*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 250*cdf0e10cSrcweir }; 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir #endif 253*cdf0e10cSrcweir 254