1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: EnhancedCustomShapeEngine.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _ENHANCED_CUSTOMSHAPE_ENGINE_HXX
32 #define _ENHANCED_CUSTOMSHAPE_ENGINE_HXX
34 #include <tools/debug.hxx>
35 #include <tools/string.hxx>
36 #include <tools/stack.hxx>
38 #include <com/sun/star/uno/Reference.h>
39 #include <com/sun/star/uno/RuntimeException.hpp>
40 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
41 #include <com/sun/star/lang/XComponent.hpp>
42 #include <com/sun/star/registry/XRegistryKey.hpp>
43 #include <com/sun/star/lang/XComponent.hpp>
44 #include <cppuhelper/implbase3.hxx>
45 #ifndef __com_sun_star_awt_Rectangle_hpp_
46 #include <com/sun/star/awt/Rectangle.hpp>
48 #include <com/sun/star/beans/PropertyValue.hpp>
49 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
50 #include <com/sun/star/lang/XInitialization.hpp>
51 #include <com/sun/star/lang/XServiceInfo.hpp>
52 #include <com/sun/star/drawing/XCustomShapeEngine.hpp>
54 // -----------------------------------------------------------------------------
56 #define NMSP_IO com::sun::star::io
57 #define NMSP_UNO com::sun::star::uno
58 #define NMSP_BEANS com::sun::star::beans
59 #define NMSP_LANG com::sun::star::lang
60 #define NMSP_UTIL com::sun::star::util
61 #define NMSP_SAX com::sun::star::xml::sax
62 #define NMSP_LOGGING NMSP_UTIL::logging
65 #define REF( _def_Obj ) NMSP_UNO::Reference< _def_Obj >
66 #define SEQ( _def_Obj ) NMSP_UNO::Sequence< _def_Obj >
67 #define B2UCONST( _def_pChar ) (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar )))
69 // ---------------------------
70 // - EnhancedCustomShapeEngine -
71 // ---------------------------
75 class SdrObjCustomShape
;
76 class EnhancedCustomShapeEngine
: public cppu::WeakImplHelper3
78 com::sun::star::lang::XInitialization
,
79 com::sun::star::lang::XServiceInfo
,
80 com::sun::star::drawing::XCustomShapeEngine
83 REF( NMSP_LANG::XMultiServiceFactory
) mxFact
;
84 REF( com::sun::star::drawing::XShape
) mxShape
;
85 sal_Bool mbForceGroupWithText
;
87 SdrObject
* ImplForceGroupWithText( const SdrObjCustomShape
* pCustoObj
, SdrObject
* pRenderedShape
);
90 EnhancedCustomShapeEngine( const REF( NMSP_LANG::XMultiServiceFactory
)& rxMgr
);
91 virtual ~EnhancedCustomShapeEngine();
94 virtual void SAL_CALL
acquire() throw();
95 virtual void SAL_CALL
release() throw();
98 virtual void SAL_CALL
initialize( const SEQ( NMSP_UNO::Any
)& aArguments
)
99 throw ( NMSP_UNO::Exception
, NMSP_UNO::RuntimeException
);
102 virtual rtl::OUString SAL_CALL
getImplementationName()
103 throw ( NMSP_UNO::RuntimeException
);
104 virtual sal_Bool SAL_CALL
supportsService( const rtl::OUString
& rServiceName
)
105 throw ( NMSP_UNO::RuntimeException
);
106 virtual SEQ( rtl::OUString
) SAL_CALL
getSupportedServiceNames()
107 throw ( NMSP_UNO::RuntimeException
);
109 // XCustomShapeEngine
110 virtual REF( com::sun::star::drawing::XShape
) SAL_CALL
render()
111 throw ( NMSP_UNO::RuntimeException
);
112 virtual com::sun::star::awt::Rectangle SAL_CALL
getTextBounds()
113 throw ( NMSP_UNO::RuntimeException
);
114 virtual com::sun::star::drawing::PolyPolygonBezierCoords SAL_CALL
getLineGeometry()
115 throw ( NMSP_UNO::RuntimeException
);
116 virtual SEQ( REF( com::sun::star::drawing::XCustomShapeHandle
) ) SAL_CALL
getInteraction()
117 throw ( NMSP_UNO::RuntimeException
);
120 rtl::OUString
EnhancedCustomShapeEngine_getImplementationName()
121 throw ( NMSP_UNO::RuntimeException
);
122 sal_Bool SAL_CALL
EnhancedCustomShapeEngine_supportsService( const rtl::OUString
& rServiceName
)
123 throw( NMSP_UNO::RuntimeException
);
124 SEQ( rtl::OUString
) SAL_CALL
EnhancedCustomShapeEngine_getSupportedServiceNames()
125 throw( NMSP_UNO::RuntimeException
);