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: unopage.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 ************************************************************************/
30 #ifndef _SVX_UNOWPAGE_HXX
31 #define _SVX_UNOWPAGE_HXX
33 #ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
34 #include <com/sun/star/lang/XTypeProvider.hpp>
36 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
37 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
40 #include <com/sun/star/beans/XPropertySet.hpp>
42 #ifndef _COM_SUN_STAR_DRAWING_XDRAWPAGE_HPP_
43 #include <com/sun/star/drawing/XDrawPage.hpp>
45 #ifndef _COM_SUN_STAR_DRAWING_XSHAPEGROUPER_HPP_
46 #include <com/sun/star/drawing/XShapeGrouper.hpp>
48 #ifndef _COM_SUN_STAR_DRAWING_XSHAPECOMBINER_HPP_
49 #include <com/sun/star/drawing/XShapeCombiner.hpp>
51 #ifndef _COM_SUN_STAR_DRAWING_XSHAPEBINDER_HPP_
52 #include <com/sun/star/drawing/XShapeBinder.hpp>
54 #ifndef _COM_SUN_STAR_UNO_XUNOTUNNEL_HPP_
55 #include <com/sun/star/lang/XUnoTunnel.hpp>
58 #ifndef _CPPUHELPER_WEAK_HXX_
59 #include <cppuhelper/weak.hxx>
61 #ifndef _CPPUHELPER_WEAKAGG_HXX_
62 #include <cppuhelper/weakagg.hxx>
65 #ifndef _SFXLSTNER_HXX
66 #include <bf_svtools/lstner.hxx>
69 #include <cppuhelper/implbase4.hxx>
70 #include <comphelper/servicehelper.hxx>
80 class SvxShapeDescriptor
;
83 class SvxShapeConnector
;
85 class SvxDrawPageList
;
87 /***********************************************************************
88 * Macros fuer Umrechnung Twips<->100tel mm *
89 ***********************************************************************/
90 #define TWIPS_TO_MM(val) ((val * 127 + 36) / 72)
91 #define MM_TO_TWIPS(val) ((val * 72 + 63) / 127)
93 /***********************************************************************
95 ***********************************************************************/
96 class SvxDrawPage
: public ::cppu::WeakAggImplHelper4
< ::com::sun::star::drawing::XDrawPage
,
97 ::com::sun::star::drawing::XShapeGrouper
,
98 ::com::sun::star::lang::XServiceInfo
,
99 ::com::sun::star::lang::XUnoTunnel
>,
108 void _SelectObjectsInView( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>& aShapes
, SdrPageView
* pPageView
) throw ();
109 void _SelectObjectInView( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
, SdrPageView
* pPageView
) throw();
112 SvxDrawPage( SdrPage
* pPage
) throw();
113 virtual ~SvxDrawPage() throw();
116 SdrPage
* GetSdrPage() const { return pPage
; }
118 // Erzeugen eines SdrObjects und Einfugen in die SdrPage
119 SdrObject
*CreateSdrObject( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
) throw();
121 // Typ und Inventor bestimmen
122 void GetTypeAndInventor( sal_uInt16
& rType
, sal_uInt32
& rInventor
, const ::rtl::OUString
& aName
) const throw();
124 // Erzeugen eines SdrObjects anhand einer Description. Kann von
125 // abgeleiteten Klassen dazu benutzt werden, eigene Shapes zu
126 // unterstuetzen (z.B. Controls)
127 virtual SdrObject
*_CreateSdrObject( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
) throw();
129 static SvxShape
* CreateShapeByTypeAndInventor( sal_uInt16 nType
, sal_uInt32 nInventor
, SdrObject
*pObj
= NULL
, SvxDrawPage
*pPage
= NULL
) throw();
131 // Die folgende Methode wird gerufen, wenn ein SvxShape-Objekt angelegt
132 // werden soll. abgeleitete Klassen koennen hier eine Ableitung oder
133 // ein ein SvxShape aggregierenden Objekt anlegen.
134 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> _CreateShape( SdrObject
*pObj
) const throw();
136 UNO3_GETIMPLEMENTATION_DECL( SvxDrawPage
)
139 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
142 virtual void SAL_CALL
add( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
) throw(::com::sun::star::uno::RuntimeException
);
143 virtual void SAL_CALL
remove( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
) throw(::com::sun::star::uno::RuntimeException
);
146 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType() throw(::com::sun::star::uno::RuntimeException
);
147 virtual sal_Bool SAL_CALL
hasElements() throw(::com::sun::star::uno::RuntimeException
);
150 virtual sal_Int32 SAL_CALL
getCount() throw(::com::sun::star::uno::RuntimeException
) ;
151 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) throw(::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
154 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapeGroup
> SAL_CALL
group( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>& xShapes
) throw(::com::sun::star::uno::RuntimeException
);
155 virtual void SAL_CALL
ungroup( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapeGroup
>& aGroup
) throw(::com::sun::star::uno::RuntimeException
);
158 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(::com::sun::star::uno::RuntimeException
);
159 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
);
160 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException
);
163 }//end of namespace binfilter