merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / unoidl / unopage.hxx
blobc5bf5b213df774886276df32ef7cd44b920e8403
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.20 $
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 _SD_UNOPAGE_HXX
31 #define _SD_UNOPAGE_HXX
33 #include <com/sun/star/document/XLinkTargetSupplier.hpp>
34 #include <com/sun/star/container/XIndexAccess.hpp>
35 #include <com/sun/star/container/XNamed.hpp>
36 #include <com/sun/star/drawing/XMasterPageTarget.hpp>
37 #include <com/sun/star/presentation/XPresentationPage.hpp>
38 #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
39 #include <com/sun/star/beans/XMultiPropertySet.hpp>
40 #include <com/sun/star/office/XAnnotationAccess.hpp>
42 #include <svtools/itemprop.hxx>
44 #ifndef _SVX_UNOPAGE_HXX
45 #include <svx/unopage.hxx>
46 #endif
47 #include <svx/fmdpage.hxx>
48 #include <svx/svdpool.hxx>
50 #include <comphelper/servicehelper.hxx>
52 #include "unosrch.hxx"
54 class SdPage;
55 class SvxShape;
56 class SdrObject;
57 struct SfxItemPropertySimpleEntry;
59 #ifdef SVX_LIGHT
60 #define SvxFmDrawPage SvxDrawPage
61 #endif
63 /***********************************************************************
64 * *
65 ***********************************************************************/
66 class SdGenericDrawPage : public SvxFmDrawPage,
67 public SdUnoSearchReplaceShape,
68 public ::com::sun::star::drawing::XShapeCombiner,
69 public ::com::sun::star::drawing::XShapeBinder,
70 public ::com::sun::star::container::XNamed,
71 public ::com::sun::star::beans::XPropertySet,
72 public ::com::sun::star::beans::XMultiPropertySet,
73 public ::com::sun::star::animations::XAnimationNodeSupplier,
74 public ::com::sun::star::office::XAnnotationAccess,
75 public ::com::sun::star::document::XLinkTargetSupplier
77 private:
78 SdXImpressDocument* mpModel;
79 SdrModel* mpSdrModel;
81 protected:
82 friend class SdXImpressDocument;
84 const SvxItemPropertySet* mpPropSet;
86 virtual void setBackground( const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::lang::IllegalArgumentException);
87 virtual void getBackground( ::com::sun::star::uno::Any& rValue ) throw();
89 rtl::OUString getBookmarkURL() const;
90 void setBookmarkURL( rtl::OUString& rURL );
92 void SetLftBorder( sal_Int32 nValue );
93 void SetRgtBorder( sal_Int32 nValue );
94 void SetUppBorder( sal_Int32 nValue );
95 void SetLwrBorder( sal_Int32 nValue );
97 void SetWidth( sal_Int32 nWidth );
98 void SetHeight( sal_Int32 nHeight );
100 sal_Bool mbHasBackgroundObject;
101 bool mbIsImpressDocument;
103 virtual void disposing() throw();
105 ::com::sun::star::uno::Any getNavigationOrder();
106 void setNavigationOrder( const ::com::sun::star::uno::Any& rValue );
108 void throwIfDisposed() const throw (::com::sun::star::uno::RuntimeException );
110 public:
111 SdGenericDrawPage( SdXImpressDocument* pModel, SdPage* pInPage, const SvxItemPropertySet* pSet ) throw();
112 virtual ~SdGenericDrawPage() throw();
114 // intern
115 sal_Bool isValid() { return (SvxDrawPage::mpPage != NULL) && (mpModel != NULL); }
117 SdPage* GetPage() const { return (SdPage*)SvxDrawPage::mpPage; }
118 SdXImpressDocument* GetModel() const;
120 UNO3_GETIMPLEMENTATION_DECL( SdGenericDrawPage )
122 // this is called whenever a SdrObject must be created for a empty api shape wrapper
123 virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw();
125 // SvxFmDrawPage
126 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw ();
128 // XInterface
129 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
130 virtual void SAL_CALL release() throw();
132 // XShapeCombiner
133 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL combine( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes ) throw(::com::sun::star::uno::RuntimeException);
134 virtual void SAL_CALL split( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xGroup ) throw(::com::sun::star::uno::RuntimeException);
136 // XShapeBinder
137 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL bind( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes ) throw(::com::sun::star::uno::RuntimeException);
138 virtual void SAL_CALL unbind( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
140 // XPropertySet
141 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
142 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);
143 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);
144 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);
145 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);
146 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);
147 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);
149 // XMultiPropertySet
150 virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
151 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
152 virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
153 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
154 virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
156 // XLinkTargetSupplier
157 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getLinks( ) throw(::com::sun::star::uno::RuntimeException);
159 // XServiceInfo
160 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
162 // XAnimationNodeSupplier
163 virtual ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > SAL_CALL getAnimationNode( ) throw (::com::sun::star::uno::RuntimeException);
165 // XAnnotationAccess:
166 virtual ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > SAL_CALL createAndInsertAnnotation() throw (::com::sun::star::uno::RuntimeException);
167 virtual void SAL_CALL removeAnnotation(const ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > & annotation) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException);
168 virtual ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotationEnumeration > SAL_CALL createAnnotationEnumeration() throw (::com::sun::star::uno::RuntimeException);
171 /***********************************************************************
173 ***********************************************************************/
175 class SdDrawPage : public ::com::sun::star::drawing::XMasterPageTarget,
176 public ::com::sun::star::presentation::XPresentationPage,
177 public SdGenericDrawPage
179 private:
180 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
182 protected:
183 virtual void setBackground( const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::lang::IllegalArgumentException);
184 virtual void getBackground( ::com::sun::star::uno::Any& rValue ) throw();
185 public:
186 SdDrawPage( SdXImpressDocument* pModel, SdPage* pInPage ) throw();
187 virtual ~SdDrawPage() throw();
189 UNO3_GETIMPLEMENTATION_DECL( SdDrawPage )
191 static ::rtl::OUString getPageApiName( SdPage* pPage );
192 static ::rtl::OUString getPageApiNameFromUiName( const String& rUIName );
193 static String getUiNameFromPageApiName( const ::rtl::OUString& rApiName );
195 // XInterface
196 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
197 virtual void SAL_CALL acquire() throw();
198 virtual void SAL_CALL release() throw();
200 // XTypeProvider
201 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
202 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
204 // XServiceInfo
205 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
206 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
207 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
209 // XMasterPageTarget
210 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getMasterPage( ) throw(::com::sun::star::uno::RuntimeException);
211 virtual void SAL_CALL setMasterPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xMasterPage ) throw(::com::sun::star::uno::RuntimeException);
213 // XPresentationPage
214 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getNotesPage( ) throw(::com::sun::star::uno::RuntimeException);
216 // XNamed
217 virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
218 virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
220 // XIndexAccess
221 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
222 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);
224 // XElementAccess
225 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
226 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
228 // XShapes
229 virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
230 virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
233 /***********************************************************************
235 ***********************************************************************/
237 class SdMasterPage : public ::com::sun::star::presentation::XPresentationPage,
238 public SdGenericDrawPage
240 private:
241 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
242 protected:
243 virtual void setBackground( const ::com::sun::star::uno::Any& rValue ) throw( ::com::sun::star::lang::IllegalArgumentException );
244 virtual void getBackground( ::com::sun::star::uno::Any& rValue ) throw();
246 public:
247 SdMasterPage( SdXImpressDocument* pModel, SdPage* pInPage ) throw();
248 virtual ~SdMasterPage() throw();
250 UNO3_GETIMPLEMENTATION_DECL(SdMasterPage)
252 // XInterface
253 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
254 virtual void SAL_CALL acquire() throw();
255 virtual void SAL_CALL release() throw();
257 // XTypeProvider
258 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
259 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
261 // XServiceInfo
262 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
263 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
264 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
266 // XIndexAccess
267 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
268 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);
270 // XElementAccess
271 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
272 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
274 // XPresentationPage
275 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getNotesPage( ) throw(::com::sun::star::uno::RuntimeException);
277 // XNamed
278 virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
279 virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
281 // XShapes
282 virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
283 virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
287 /***********************************************************************
289 ***********************************************************************/
290 #include <cppuhelper/implbase2.hxx>
292 class SdPageLinkTargets : public ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameAccess,
293 ::com::sun::star::lang::XServiceInfo >
295 private:
296 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxPage;
297 SdGenericDrawPage* mpUnoPage;
299 public:
300 SdPageLinkTargets( SdGenericDrawPage* pUnoPage ) throw();
301 virtual ~SdPageLinkTargets() throw();
303 // intern
304 SdrObject* FindObject( const String& rName ) const throw();
306 // XServiceInfo
307 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
308 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
309 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
311 // XNameAccess
312 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
313 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw(::com::sun::star::uno::RuntimeException);
314 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
316 // XElementAccess
317 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
318 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
321 #endif // _SD_UNOPAGE_HXX