Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / unodraw.hxx
blobbee01646d3003a3385af4b8280d2b26f9c658c23
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: unodraw.hxx,v $
10 * $Revision: 1.5 $
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 _UNODRAW_HXX
31 #define _UNODRAW_HXX
33 #ifndef _SVX_FMDPAGE_HXX //autogen
34 #include <bf_svx/fmdpage.hxx>
35 #endif
36 #ifndef _CALBCK_HXX //autogen
37 #include <calbck.hxx>
38 #endif
39 #ifndef _FRMFMT_HXX //autogen
40 #include <frmfmt.hxx>
41 #endif
42 #ifndef _COM_SUN_STAR_TEXT_XTEXTCONTENT_HPP_
43 #include <com/sun/star/text/XTextContent.hpp>
44 #endif
45 #ifndef _COM_SUN_STAR_DRAWING_XSHAPE_HPP_
46 #include <com/sun/star/drawing/XShape.hpp>
47 #endif
48 #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
49 #include <com/sun/star/lang/XUnoTunnel.hpp>
50 #endif
51 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
52 #include <com/sun/star/beans/XPropertyState.hpp>
53 #endif
54 #ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_
55 #include <com/sun/star/drawing/XShapes.hpp>
56 #endif
57 #ifndef _CPPUHELPER_IMPLBASE3_HXX_
58 #include <cppuhelper/implbase3.hxx> // helper for implementations
59 #endif
60 #ifndef _CPPUHELPER_IMPLBASE5_HXX_
61 #include <cppuhelper/implbase5.hxx> // helper for implementations
62 #endif
63 #ifndef _SFX_ITEMPROP_HXX
64 #include <bf_svtools/itemprop.hxx>
65 #endif
66 namespace binfilter {
68 class SdrMarkList;
69 class SdrView;
70 class SwDoc;
71 /******************************************************************************
73 ******************************************************************************/
74 class SwFmDrawPage : public SvxFmDrawPage
76 SdrPageView* pPageView;
77 protected:
79 // Erzeugen eines SdrObjects anhand einer Description. Kann von
80 // abgeleiteten Klassen dazu benutzt werden, eigene ::com::sun::star::drawing::Shapes zu
81 // unterstuetzen (z.B. Controls)
82 virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape ) throw ();
84 public:
85 SwFmDrawPage( SdrPage* pPage );
86 virtual ~SwFmDrawPage() throw ();
88 const SdrMarkList& PreGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > & xShapes);
89 void PreUnGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > xShapeGroup);
90 // void PostGroup(); ?? wird es noch gebraucht ??
92 SdrView* GetDrawView() {return pView;}
93 SdrPageView* GetPageView();
94 void RemovePageView();
95 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetInterface( SdrObject* pObj );
97 // Die folgende Methode wird gerufen, wenn ein SvxShape-Objekt angelegt
98 // werden soll. abgeleitete Klassen koennen hier eine Ableitung oder
99 // ein ein SvxShape aggregierendes Objekt anlegen.
100 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw ();
103 /* -----------------09.12.98 08:57-------------------
105 * --------------------------------------------------*/
106 typedef cppu::WeakAggImplHelper3
108 ::com::sun::star::drawing::XDrawPage,
109 ::com::sun::star::lang::XServiceInfo,
110 ::com::sun::star::drawing::XShapeGrouper
112 SwXDrawPageBaseClass;
113 class SwXDrawPage : public SwXDrawPageBaseClass
115 SwDoc* pDoc;
116 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > xPageAgg;
117 SwFmDrawPage* pDrawPage;
118 public:
119 SwXDrawPage(SwDoc* pDoc);
120 ~SwXDrawPage();
122 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
123 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
125 //XIndexAccess
126 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
127 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
129 //XElementAccess
130 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
131 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
133 //XShapes
134 virtual void SAL_CALL add(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape) throw( ::com::sun::star::uno::RuntimeException );
135 virtual void SAL_CALL remove(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape) throw( ::com::sun::star::uno::RuntimeException );
137 //XShapeGrouper
138 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 );
139 virtual void SAL_CALL ungroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > & aGroup) throw( ::com::sun::star::uno::RuntimeException );
141 //XServiceInfo
142 virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
143 virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
144 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
146 SwFmDrawPage* GetSvxPage();
147 void Invalidate() {pDoc = 0;}
149 /* -----------------22.01.99 10:20-------------------
151 * --------------------------------------------------*/
152 class SwShapeDescriptor_Impl;
153 class SwXGroupShape;
154 typedef
155 cppu::WeakAggImplHelper5
157 ::com::sun::star::beans::XPropertySet,
158 ::com::sun::star::beans::XPropertyState,
159 ::com::sun::star::text::XTextContent,
160 ::com::sun::star::lang::XServiceInfo,
161 ::com::sun::star::lang::XUnoTunnel
163 SwXShapeBaseClass;
164 class SwXShape : public SwXShapeBaseClass,
165 public SwClient
167 friend class SwHTMLImageWatcher;
168 friend class SwHTMLParser;
169 friend class SwXGroupShape;
170 friend class SwXDrawPage;
172 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > xShapeAgg;
173 SfxItemPropertySet aPropSet;
174 const SfxItemPropertyMap* _pMap;
175 ::com::sun::star::uno::Sequence< sal_Int8 >* pImplementationId;
177 SwShapeDescriptor_Impl* pImpl;
179 sal_Bool m_bDescriptor;
181 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
183 SvxShape* GetSvxShape();
184 protected:
185 virtual ~SwXShape();
186 public:
187 SwXShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xShape);
190 TYPEINFO();
191 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
192 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
193 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
194 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
196 //XUnoTunnel
197 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
200 //XPropertySet
201 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
202 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
203 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
204 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
205 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
206 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
207 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
209 //XPropertyState
210 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
211 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
212 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
213 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
215 //XTextContent
216 virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
217 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException );
219 //XComponent
220 virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
221 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
222 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
224 //XServiceInfo
225 virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
226 virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
227 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
229 //SwClient
230 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
232 SwShapeDescriptor_Impl* GetDescImpl() {return pImpl;}
233 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > GetAggregationInterface() {return xShapeAgg;}
235 /* -----------------------------31.05.01 09:54--------------------------------
237 ---------------------------------------------------------------------------*/
238 class SwXGroupShape :
239 public SwXShape,
240 public ::com::sun::star::drawing::XShapes
242 protected:
243 virtual ~SwXGroupShape();
244 public:
245 SwXGroupShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xShape);
248 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
249 virtual void SAL_CALL acquire( ) throw();
250 virtual void SAL_CALL release( ) throw();
252 //XShapes
253 virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw (::com::sun::star::uno::RuntimeException);
254 virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw (::com::sun::star::uno::RuntimeException);
256 //XIndexAccess
257 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
258 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
260 //XElementAccess
261 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
262 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
264 } //namespace binfilter
265 #endif