1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _ENHANCED_CUSTOMSHAPE_ENGINE_HXX 25cdf0e10cSrcweir #define _ENHANCED_CUSTOMSHAPE_ENGINE_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <tools/debug.hxx> 28cdf0e10cSrcweir #include <tools/string.hxx> 29cdf0e10cSrcweir #include <tools/stack.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h> 32cdf0e10cSrcweir #include <com/sun/star/uno/RuntimeException.hpp> 33cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 34cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp> 35cdf0e10cSrcweir #include <com/sun/star/registry/XRegistryKey.hpp> 36cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp> 37cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> 38cdf0e10cSrcweir #ifndef __com_sun_star_awt_Rectangle_hpp_ 39cdf0e10cSrcweir #include <com/sun/star/awt/Rectangle.hpp> 40cdf0e10cSrcweir #endif 41cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 42cdf0e10cSrcweir #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> 43cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 44cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 45cdf0e10cSrcweir #include <com/sun/star/drawing/XCustomShapeEngine.hpp> 46cdf0e10cSrcweir 47cdf0e10cSrcweir // ----------------------------------------------------------------------------- 48cdf0e10cSrcweir 49cdf0e10cSrcweir #define NMSP_IO com::sun::star::io 50cdf0e10cSrcweir #define NMSP_UNO com::sun::star::uno 51cdf0e10cSrcweir #define NMSP_BEANS com::sun::star::beans 52cdf0e10cSrcweir #define NMSP_LANG com::sun::star::lang 53cdf0e10cSrcweir #define NMSP_UTIL com::sun::star::util 54cdf0e10cSrcweir #define NMSP_SAX com::sun::star::xml::sax 55cdf0e10cSrcweir #define NMSP_LOGGING NMSP_UTIL::logging 56cdf0e10cSrcweir 57cdf0e10cSrcweir 58cdf0e10cSrcweir #define REF( _def_Obj ) NMSP_UNO::Reference< _def_Obj > 59cdf0e10cSrcweir #define SEQ( _def_Obj ) NMSP_UNO::Sequence< _def_Obj > 60cdf0e10cSrcweir #define B2UCONST( _def_pChar ) (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar ))) 61cdf0e10cSrcweir 62cdf0e10cSrcweir // --------------------------- 63cdf0e10cSrcweir // - EnhancedCustomShapeEngine - 64cdf0e10cSrcweir // --------------------------- 65cdf0e10cSrcweir // 66cdf0e10cSrcweir 67cdf0e10cSrcweir class SdrObject; 68cdf0e10cSrcweir class SdrObjCustomShape; 69cdf0e10cSrcweir class EnhancedCustomShapeEngine : public cppu::WeakImplHelper3 70cdf0e10cSrcweir < 71cdf0e10cSrcweir com::sun::star::lang::XInitialization, 72cdf0e10cSrcweir com::sun::star::lang::XServiceInfo, 73cdf0e10cSrcweir com::sun::star::drawing::XCustomShapeEngine 74cdf0e10cSrcweir > 75cdf0e10cSrcweir { 76cdf0e10cSrcweir REF( NMSP_LANG::XMultiServiceFactory ) mxFact; 77cdf0e10cSrcweir REF( com::sun::star::drawing::XShape ) mxShape; 78cdf0e10cSrcweir sal_Bool mbForceGroupWithText; 79cdf0e10cSrcweir 80cdf0e10cSrcweir SdrObject* ImplForceGroupWithText( const SdrObjCustomShape* pCustoObj, SdrObject* pRenderedShape ); 81cdf0e10cSrcweir 82cdf0e10cSrcweir public: 83cdf0e10cSrcweir EnhancedCustomShapeEngine( const REF( NMSP_LANG::XMultiServiceFactory )& rxMgr ); 84cdf0e10cSrcweir virtual ~EnhancedCustomShapeEngine(); 85cdf0e10cSrcweir 86cdf0e10cSrcweir // XInterface 87cdf0e10cSrcweir virtual void SAL_CALL acquire() throw(); 88cdf0e10cSrcweir virtual void SAL_CALL release() throw(); 89cdf0e10cSrcweir 90cdf0e10cSrcweir // XInitialization 91cdf0e10cSrcweir virtual void SAL_CALL initialize( const SEQ( NMSP_UNO::Any )& aArguments ) 92cdf0e10cSrcweir throw ( NMSP_UNO::Exception, NMSP_UNO::RuntimeException ); 93cdf0e10cSrcweir 94cdf0e10cSrcweir // XServiceInfo 95cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName() 96cdf0e10cSrcweir throw ( NMSP_UNO::RuntimeException ); 97cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& rServiceName ) 98cdf0e10cSrcweir throw ( NMSP_UNO::RuntimeException ); 99cdf0e10cSrcweir virtual SEQ( rtl::OUString ) SAL_CALL getSupportedServiceNames() 100cdf0e10cSrcweir throw ( NMSP_UNO::RuntimeException ); 101cdf0e10cSrcweir 102cdf0e10cSrcweir // XCustomShapeEngine 103cdf0e10cSrcweir virtual REF( com::sun::star::drawing::XShape ) SAL_CALL render() 104cdf0e10cSrcweir throw ( NMSP_UNO::RuntimeException ); 105cdf0e10cSrcweir virtual com::sun::star::awt::Rectangle SAL_CALL getTextBounds() 106cdf0e10cSrcweir throw ( NMSP_UNO::RuntimeException ); 107cdf0e10cSrcweir virtual com::sun::star::drawing::PolyPolygonBezierCoords SAL_CALL getLineGeometry() 108cdf0e10cSrcweir throw ( NMSP_UNO::RuntimeException ); 109cdf0e10cSrcweir virtual SEQ( REF( com::sun::star::drawing::XCustomShapeHandle ) ) SAL_CALL getInteraction() 110cdf0e10cSrcweir throw ( NMSP_UNO::RuntimeException ); 111cdf0e10cSrcweir }; 112cdf0e10cSrcweir 113cdf0e10cSrcweir rtl::OUString EnhancedCustomShapeEngine_getImplementationName() 114cdf0e10cSrcweir throw ( NMSP_UNO::RuntimeException ); 115cdf0e10cSrcweir sal_Bool SAL_CALL EnhancedCustomShapeEngine_supportsService( const rtl::OUString& rServiceName ) 116cdf0e10cSrcweir throw( NMSP_UNO::RuntimeException ); 117cdf0e10cSrcweir SEQ( rtl::OUString ) SAL_CALL EnhancedCustomShapeEngine_getSupportedServiceNames() 118cdf0e10cSrcweir throw( NMSP_UNO::RuntimeException ); 119cdf0e10cSrcweir 120cdf0e10cSrcweir #endif 121