Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / unopage.hxx
blobceaa23ffd28330416edc791c6e664896ab5caa30
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unopage.hxx,v $
10 * $Revision: 1.8 $
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>
35 #endif
36 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
40 #include <com/sun/star/beans/XPropertySet.hpp>
41 #endif
42 #ifndef _COM_SUN_STAR_DRAWING_XDRAWPAGE_HPP_
43 #include <com/sun/star/drawing/XDrawPage.hpp>
44 #endif
45 #ifndef _COM_SUN_STAR_DRAWING_XSHAPEGROUPER_HPP_
46 #include <com/sun/star/drawing/XShapeGrouper.hpp>
47 #endif
48 #ifndef _COM_SUN_STAR_DRAWING_XSHAPECOMBINER_HPP_
49 #include <com/sun/star/drawing/XShapeCombiner.hpp>
50 #endif
51 #ifndef _COM_SUN_STAR_DRAWING_XSHAPEBINDER_HPP_
52 #include <com/sun/star/drawing/XShapeBinder.hpp>
53 #endif
54 #ifndef _COM_SUN_STAR_UNO_XUNOTUNNEL_HPP_
55 #include <com/sun/star/lang/XUnoTunnel.hpp>
56 #endif
58 #ifndef _CPPUHELPER_WEAK_HXX_
59 #include <cppuhelper/weak.hxx>
60 #endif
61 #ifndef _CPPUHELPER_WEAKAGG_HXX_
62 #include <cppuhelper/weakagg.hxx>
63 #endif
65 #ifndef _SFXLSTNER_HXX
66 #include <bf_svtools/lstner.hxx>
67 #endif
69 #include <cppuhelper/implbase4.hxx>
70 #include <comphelper/servicehelper.hxx>
72 class List;
73 namespace binfilter {
75 class SdrPage;
76 class SdrModel;
77 class SdrView;
78 class SdrPageView;
79 class SdrObject;
80 class SvxShapeDescriptor;
81 class SvxShape;
82 class SvxShapeGroup;
83 class SvxShapeConnector;
84 class SvxShapeList;
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 /***********************************************************************
94 * *
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>,
100 public SfxListener
102 protected:
104 SdrPage* pPage;
105 SdrModel* pModel;
106 SdrView* pView;
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();
111 public:
112 SvxDrawPage( SdrPage* pPage ) throw();
113 virtual ~SvxDrawPage() throw();
115 // Internals
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 )
138 // SfxListener
139 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
141 // XShapes
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);
145 // XElementAccess
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);
149 // XIndexAccess
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);
153 // XShapeGrouper
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);
157 // XServiceInfo
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
164 #endif