update dev300-m58
[ooovba.git] / sd / source / ui / unoidl / unopage.hxx
blobfaece948cfcf5f8c0515e61671a1007a9ff2d48f
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 <svtools/itemprop.hxx>
42 #ifndef _SVX_UNOPAGE_HXX
43 #include <svx/unopage.hxx>
44 #endif
45 #include <svx/fmdpage.hxx>
46 #include <svx/svdpool.hxx>
48 #include <comphelper/servicehelper.hxx>
50 #include "unosrch.hxx"
52 class SdPage;
53 class SvxShape;
54 class SdrObject;
55 struct SfxItemPropertySimpleEntry;
57 #ifdef SVX_LIGHT
58 #define SvxFmDrawPage SvxDrawPage
59 #endif
61 /***********************************************************************
62 * *
63 ***********************************************************************/
64 class SdGenericDrawPage : public SvxFmDrawPage,
65 public SdUnoSearchReplaceShape,
66 public ::com::sun::star::drawing::XShapeCombiner,
67 public ::com::sun::star::drawing::XShapeBinder,
68 public ::com::sun::star::container::XNamed,
69 public ::com::sun::star::beans::XPropertySet,
70 public ::com::sun::star::beans::XMultiPropertySet,
71 public ::com::sun::star::animations::XAnimationNodeSupplier,
72 public ::com::sun::star::document::XLinkTargetSupplier
74 private:
75 SdXImpressDocument* mpModel;
76 SdrModel* mpSdrModel;
78 protected:
79 friend class SdXImpressDocument;
81 const SvxItemPropertySet* mpPropSet;
83 virtual void setBackground( const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::lang::IllegalArgumentException);
84 virtual void getBackground( ::com::sun::star::uno::Any& rValue ) throw();
86 rtl::OUString getBookmarkURL() const;
87 void setBookmarkURL( rtl::OUString& rURL );
89 void SetLftBorder( sal_Int32 nValue );
90 void SetRgtBorder( sal_Int32 nValue );
91 void SetUppBorder( sal_Int32 nValue );
92 void SetLwrBorder( sal_Int32 nValue );
94 void SetWidth( sal_Int32 nWidth );
95 void SetHeight( sal_Int32 nHeight );
97 sal_Bool mbHasBackgroundObject;
98 bool mbIsImpressDocument;
100 virtual void disposing() throw();
102 ::com::sun::star::uno::Any getNavigationOrder();
103 void setNavigationOrder( const ::com::sun::star::uno::Any& rValue );
105 void throwIfDisposed() const throw (::com::sun::star::uno::RuntimeException );
107 public:
108 SdGenericDrawPage( SdXImpressDocument* pModel, SdPage* pInPage, const SvxItemPropertySet* pSet ) throw();
109 virtual ~SdGenericDrawPage() throw();
111 // intern
112 sal_Bool isValid() { return (SvxDrawPage::mpPage != NULL) && (mpModel != NULL); }
114 SdPage* GetPage() const { return (SdPage*)SvxDrawPage::mpPage; }
115 SdXImpressDocument* GetModel() const;
117 UNO3_GETIMPLEMENTATION_DECL( SdGenericDrawPage )
119 // this is called whenever a SdrObject must be created for a empty api shape wrapper
120 virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw();
122 // SvxFmDrawPage
123 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw ();
125 // XInterface
126 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
127 virtual void SAL_CALL release() throw();
129 // XShapeCombiner
130 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);
131 virtual void SAL_CALL split( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xGroup ) throw(::com::sun::star::uno::RuntimeException);
133 // XShapeBinder
134 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);
135 virtual void SAL_CALL unbind( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
137 // XPropertySet
138 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
139 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);
140 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);
141 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);
142 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);
143 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);
144 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);
146 // XMultiPropertySet
147 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);
148 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);
149 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);
150 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
151 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);
153 // XLinkTargetSupplier
154 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getLinks( ) throw(::com::sun::star::uno::RuntimeException);
156 // XServiceInfo
157 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
159 // XAnimationNodeSupplier
160 virtual ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > SAL_CALL getAnimationNode( ) throw (::com::sun::star::uno::RuntimeException);
163 /***********************************************************************
165 ***********************************************************************/
167 class SdDrawPage : public ::com::sun::star::drawing::XMasterPageTarget,
168 public ::com::sun::star::presentation::XPresentationPage,
169 public SdGenericDrawPage
171 private:
172 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
174 protected:
175 virtual void setBackground( const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::lang::IllegalArgumentException);
176 virtual void getBackground( ::com::sun::star::uno::Any& rValue ) throw();
177 public:
178 SdDrawPage( SdXImpressDocument* pModel, SdPage* pInPage ) throw();
179 virtual ~SdDrawPage() throw();
181 UNO3_GETIMPLEMENTATION_DECL( SdDrawPage )
183 static ::rtl::OUString getPageApiName( SdPage* pPage );
184 static ::rtl::OUString getPageApiNameFromUiName( const String& rUIName );
185 static String getUiNameFromPageApiName( const ::rtl::OUString& rApiName );
187 // XInterface
188 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
189 virtual void SAL_CALL acquire() throw();
190 virtual void SAL_CALL release() throw();
192 // XTypeProvider
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 // XServiceInfo
197 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
198 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
199 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
201 // XMasterPageTarget
202 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getMasterPage( ) throw(::com::sun::star::uno::RuntimeException);
203 virtual void SAL_CALL setMasterPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xMasterPage ) throw(::com::sun::star::uno::RuntimeException);
205 // XPresentationPage
206 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getNotesPage( ) throw(::com::sun::star::uno::RuntimeException);
208 // XNamed
209 virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
210 virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
212 // XIndexAccess
213 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
214 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);
216 // XElementAccess
217 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
218 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
220 // XShapes
221 virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
222 virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
225 /***********************************************************************
227 ***********************************************************************/
229 class SdMasterPage : public ::com::sun::star::presentation::XPresentationPage,
230 public SdGenericDrawPage
232 private:
233 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
234 protected:
235 virtual void setBackground( const ::com::sun::star::uno::Any& rValue ) throw( ::com::sun::star::lang::IllegalArgumentException );
236 virtual void getBackground( ::com::sun::star::uno::Any& rValue ) throw();
238 public:
239 SdMasterPage( SdXImpressDocument* pModel, SdPage* pInPage ) throw();
240 virtual ~SdMasterPage() throw();
242 UNO3_GETIMPLEMENTATION_DECL(SdMasterPage)
244 // XInterface
245 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
246 virtual void SAL_CALL acquire() throw();
247 virtual void SAL_CALL release() throw();
249 // XTypeProvider
250 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
251 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
253 // XServiceInfo
254 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
255 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
256 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
258 // XIndexAccess
259 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
260 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);
262 // XElementAccess
263 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
264 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
266 // XPresentationPage
267 virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getNotesPage( ) throw(::com::sun::star::uno::RuntimeException);
269 // XNamed
270 virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
271 virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
273 // XShapes
274 virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
275 virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw(::com::sun::star::uno::RuntimeException);
279 /***********************************************************************
281 ***********************************************************************/
282 #include <cppuhelper/implbase2.hxx>
284 class SdPageLinkTargets : public ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameAccess,
285 ::com::sun::star::lang::XServiceInfo >
287 private:
288 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxPage;
289 SdGenericDrawPage* mpUnoPage;
291 public:
292 SdPageLinkTargets( SdGenericDrawPage* pUnoPage ) throw();
293 virtual ~SdPageLinkTargets() throw();
295 // intern
296 SdrObject* FindObject( const String& rName ) const throw();
298 // XServiceInfo
299 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
300 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
301 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
303 // XNameAccess
304 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);
305 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw(::com::sun::star::uno::RuntimeException);
306 virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
308 // XElementAccess
309 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
310 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
313 #endif // _SD_UNOPAGE_HXX