xref: /trunk/main/svx/source/customshapes/EnhancedCustomShapeEngine.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 
24 #ifndef _ENHANCED_CUSTOMSHAPE_ENGINE_HXX
25 #define _ENHANCED_CUSTOMSHAPE_ENGINE_HXX
26 
27 #include <tools/debug.hxx>
28 #include <tools/string.hxx>
29 #include <tools/stack.hxx>
30 
31 #include <com/sun/star/uno/Reference.h>
32 #include <com/sun/star/uno/RuntimeException.hpp>
33 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34 #include <com/sun/star/lang/XComponent.hpp>
35 #include <com/sun/star/registry/XRegistryKey.hpp>
36 #include <com/sun/star/lang/XComponent.hpp>
37 #include <cppuhelper/implbase3.hxx>
38 #ifndef __com_sun_star_awt_Rectangle_hpp_
39 #include <com/sun/star/awt/Rectangle.hpp>
40 #endif
41 #include <com/sun/star/beans/PropertyValue.hpp>
42 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
43 #include <com/sun/star/lang/XInitialization.hpp>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/drawing/XCustomShapeEngine.hpp>
46 
47 // -----------------------------------------------------------------------------
48 
49 #define NMSP_IO         com::sun::star::io
50 #define NMSP_UNO        com::sun::star::uno
51 #define NMSP_BEANS      com::sun::star::beans
52 #define NMSP_LANG       com::sun::star::lang
53 #define NMSP_UTIL       com::sun::star::util
54 #define NMSP_SAX        com::sun::star::xml::sax
55 #define NMSP_LOGGING    NMSP_UTIL::logging
56 
57 
58 #define REF( _def_Obj )         NMSP_UNO::Reference< _def_Obj >
59 #define SEQ( _def_Obj )         NMSP_UNO::Sequence< _def_Obj >
60 #define B2UCONST( _def_pChar )  (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar )))
61 
62 // ---------------------------
63 // - EnhancedCustomShapeEngine -
64 // ---------------------------
65 //
66 
67 class SdrObject;
68 class SdrObjCustomShape;
69 class EnhancedCustomShapeEngine : public cppu::WeakImplHelper3
70 <
71     com::sun::star::lang::XInitialization,
72     com::sun::star::lang::XServiceInfo,
73     com::sun::star::drawing::XCustomShapeEngine
74 >
75 {
76     REF( NMSP_LANG::XMultiServiceFactory )      mxFact;
77     REF( com::sun::star::drawing::XShape )      mxShape;
78     sal_Bool                                    mbForceGroupWithText;
79 
80     SdrObject* ImplForceGroupWithText( const SdrObjCustomShape* pCustoObj, SdrObject* pRenderedShape );
81 
82 public:
83                             EnhancedCustomShapeEngine( const REF( NMSP_LANG::XMultiServiceFactory )& rxMgr );
84     virtual                 ~EnhancedCustomShapeEngine();
85 
86     // XInterface
87     virtual void SAL_CALL   acquire() throw();
88     virtual void SAL_CALL   release() throw();
89 
90     // XInitialization
91     virtual void SAL_CALL initialize( const SEQ( NMSP_UNO::Any )& aArguments );
92 
93     // XServiceInfo
94     virtual rtl::OUString SAL_CALL getImplementationName();
95     virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& rServiceName );
96     virtual SEQ( rtl::OUString ) SAL_CALL getSupportedServiceNames();
97 
98     // XCustomShapeEngine
99     virtual REF( com::sun::star::drawing::XShape ) SAL_CALL render();
100     virtual com::sun::star::awt::Rectangle SAL_CALL getTextBounds();
101     virtual com::sun::star::drawing::PolyPolygonBezierCoords SAL_CALL getLineGeometry();
102     virtual SEQ( REF( com::sun::star::drawing::XCustomShapeHandle ) ) SAL_CALL getInteraction();
103 };
104 
105 rtl::OUString EnhancedCustomShapeEngine_getImplementationName();
106 sal_Bool SAL_CALL EnhancedCustomShapeEngine_supportsService( const rtl::OUString& rServiceName );
107 SEQ( rtl::OUString ) SAL_CALL EnhancedCustomShapeEngine_getSupportedServiceNames();
108 
109 #endif
110