Bump version to 6.4-15
[LibreOffice.git] / include / svx / unoshape.hxx
blob0e445c0e84f4c6ecb542db96af02bc929296ecbf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_UNOSHAPE_HXX
21 #define INCLUDED_SVX_UNOSHAPE_HXX
23 #include <memory>
24 #include <com/sun/star/document/XActionLockable.hpp>
25 #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
26 #include <com/sun/star/drawing/XGluePointsSupplier.hpp>
27 #include <com/sun/star/drawing/XShape.hpp>
28 #include <com/sun/star/lang/XComponent.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/beans/XPropertyState.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/lang/XUnoTunnel.hpp>
33 #include <com/sun/star/awt/Point.hpp>
34 #include <com/sun/star/drawing/PolygonKind.hpp>
35 #include <com/sun/star/drawing/XShapes.hpp>
36 #include <com/sun/star/drawing/XShapes2.hpp>
37 #include <com/sun/star/drawing/XShapeGroup.hpp>
38 #include <com/sun/star/container/XNamed.hpp>
39 #include <com/sun/star/container/XChild.hpp>
40 #include <com/sun/star/beans/XMultiPropertySet.hpp>
41 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
42 #include <com/sun/star/drawing/XConnectorShape.hpp>
43 #include <com/sun/star/drawing/XControlShape.hpp>
44 #include <basegfx/polygon/b2dpolypolygon.hxx>
45 #include <sal/types.h>
46 #include <tools/weakbase.hxx>
47 #include <svl/lstner.hxx>
48 #include <editeng/unoipset.hxx>
49 #include <osl/mutex.hxx>
50 #include <svx/svxdllapi.h>
51 #include <rtl/ref.hxx>
52 #include <com/sun/star/uno/Any.hxx>
53 #include <editeng/unotext.hxx>
55 #include <svx/svdobj.hxx>
57 #include <comphelper/servicehelper.hxx>
59 #include <cppuhelper/implbase1.hxx>
60 #include <cppuhelper/implbase12.hxx>
62 class SfxItemSet;
63 class SdrModel;
64 class SvxDrawPage;
65 class SvGlobalName;
66 class Pair;
67 class IOpenGLRenderer;
69 // Dimension arrows change size/position on save/reload (#i59051#)
70 namespace basegfx
72 class B2DPolyPolygon;
73 } // end of namespace basegfx
75 class SvxShapeMutex
77 protected:
78 ::osl::Mutex maMutex;
81 struct SvxShapeImpl;
82 class SvxShapeMaster;
83 class SvxItemPropertySet;
84 class SfxItemSet;
86 void SVX_DLLPUBLIC SvxItemPropertySet_setPropertyValue( const SfxItemPropertySimpleEntry* pMap,
87 const css::uno::Any& rVal, SfxItemSet& rSet );
89 css::uno::Any SVX_DLLPUBLIC SvxItemPropertySet_getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet );
92 // WARNING: if you update the supported interfaces,
93 // also update SvxShape::_getTypes()
94 typedef ::cppu::WeakAggImplHelper12<
95 css::drawing::XShape,
96 css::lang::XComponent,
97 css::beans::XPropertySet,
98 css::beans::XMultiPropertySet,
99 css::beans::XPropertyState,
100 css::lang::XUnoTunnel,
101 css::container::XNamed,
102 css::drawing::XGluePointsSupplier,
103 css::container::XChild,
104 css::lang::XServiceInfo,
105 css::document::XActionLockable,
106 css::beans::XMultiPropertyStates> SvxShape_UnoImplHelper;
108 class SVX_DLLPUBLIC SvxShape : public SvxShape_UnoImplHelper,
109 public SfxListener,
110 public SvxShapeMutex
112 private:
113 css::awt::Size maSize;
114 css::awt::Point maPosition;
115 OUString maShapeType;
116 OUString maShapeName;
118 /** these members are used to optimize XMultiProperty calls */
119 std::unique_ptr<SvxShapeImpl> mpImpl;
120 bool mbIsMultiPropertyCall;
122 css::uno::WeakReference< css::container::XIndexContainer > mxGluePoints;
124 protected:
125 friend class SvxDrawPage;
126 friend class SvxShapeConnector;
127 friend class SdXShape;
129 const SvxItemPropertySet* mpPropSet;
130 const SfxItemPropertyMapEntry* maPropMapEntries;
132 private:
133 ::tools::WeakReference< SdrObject > mpSdrObjectWeakReference;
135 protected:
136 // translations for writer, which works in TWIPS
137 void ForceMetricToItemPoolMetric(Pair& rPoint) const throw();
138 void ForceMetricToItemPoolMetric(Point& rPoint) const throw() { ForceMetricToItemPoolMetric(rPoint.toPair()); }
139 void ForceMetricToItemPoolMetric(Size& rPoint) const throw() { ForceMetricToItemPoolMetric(rPoint.toPair()); }
140 void ForceMetricTo100th_mm(Pair& rPoint) const throw();
141 void ForceMetricTo100th_mm(Point& rPoint) const throw() { ForceMetricTo100th_mm(rPoint.toPair()); }
142 void ForceMetricTo100th_mm(Size& rPoint) const throw() { ForceMetricTo100th_mm(rPoint.toPair()); }
144 // version for basegfx::B2DPolyPolygon
145 void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw();
146 void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw();
148 // tdf#117145 version for basegfx::B2DHomMatrix
149 void ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix& rB2DHomMatrix) const throw();
150 void ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rB2DHomMatrix) const throw();
152 css::uno::Any GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertySimpleEntry* pMap ) const;
154 bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName );
156 /** called from the XActionLockable interface methods on initial locking */
157 virtual void lock();
159 /** called from the XActionLockable interface methods on final unlock */
160 virtual void unlock();
162 /** used from the XActionLockable interface */
163 sal_uInt16 mnLockCount;
165 const SfxItemPropertyMapEntry* getPropertyMapEntries() const { return maPropMapEntries; }
167 void updateShapeKind();
168 void endSetPropertyValues();
170 // override these for special property handling in subcasses. Return true if property is handled
171 /// @throws css::beans::UnknownPropertyException
172 /// @throws css::beans::PropertyVetoException
173 /// @throws css::lang::IllegalArgumentException
174 /// @throws css::lang::WrappedTargetException
175 /// @throws css::uno::RuntimeException
176 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue );
177 /// @throws css::beans::UnknownPropertyException
178 /// @throws css::lang::WrappedTargetException
179 /// @throws css::uno::RuntimeException
180 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue );
181 /// @throws css::beans::UnknownPropertyException
182 /// @throws css::uno::RuntimeException
183 virtual bool getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, css::beans::PropertyState& rState );
184 /// @throws css::beans::UnknownPropertyException
185 /// @throws css::uno::RuntimeException
186 virtual bool setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* pProperty );
188 public:
189 /// @throws css::uno::RuntimeException
190 SvxShape( SdrObject* pObj );
191 /// @throws css::uno::RuntimeException
192 SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries, const SvxItemPropertySet* pPropertySet );
193 virtual ~SvxShape() throw () override;
195 // Internals
196 void ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet);
197 virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage );
198 /** takes the ownership of the SdrObject.
200 When the shape is disposed, and it has the ownership of its associated SdrObject, then
201 it will delete this object.
203 void TakeSdrObjectOwnership();
204 bool HasSdrObjectOwnership() const;
206 // used exclusively by SdrObject
207 void InvalidateSdrObject();
209 // Encapsulated access to SdrObject
210 SdrObject* GetSdrObject() const { return mpSdrObjectWeakReference.get(); }
211 bool HasSdrObject() const { return mpSdrObjectWeakReference.is(); }
213 void SetShapeType( const OUString& ShapeType ) { maShapeType = ShapeType; }
214 /// @throws css::uno::RuntimeException
215 css::uno::Any GetBitmap( bool bMetaFile = false ) const;
217 svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
219 void setShapeKind( sal_uInt32 nKind );
220 sal_uInt32 getShapeKind() const;
222 // styles need this
223 static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel );
224 static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet );
226 /** same as SetFillAttribute but for property names instead of which ids,
227 and the property found is returned instead of set at the object
228 directly.
231 UNO3_GETIMPLEMENTATION_DECL( SvxShape )
233 // access methods for master objects
234 /// @throws css::uno::RuntimeException
235 css::uno::Reference< css::beans::XPropertySetInfo > const & _getPropertySetInfo( );
236 /// @throws css::beans::UnknownPropertyException
237 /// @throws css::beans::PropertyVetoException
238 /// @throws css::lang::IllegalArgumentException
239 /// @throws css::lang::WrappedTargetException
240 /// @throws css::uno::RuntimeException
241 void _setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue );
242 /// @throws css::beans::UnknownPropertyException
243 /// @throws css::lang::WrappedTargetException
244 /// @throws css::uno::RuntimeException
245 css::uno::Any _getPropertyValue( const OUString& PropertyName );
247 /// @throws css::beans::UnknownPropertyException
248 /// @throws css::uno::RuntimeException
249 css::beans::PropertyState _getPropertyState( const OUString& PropertyName );
250 /// @throws css::beans::UnknownPropertyException
251 /// @throws css::uno::RuntimeException
252 void _setPropertyToDefault( const OUString& PropertyName );
253 /// @throws css::beans::UnknownPropertyException
254 /// @throws css::lang::WrappedTargetException
255 /// @throws css::uno::RuntimeException
256 css::uno::Any _getPropertyDefault( const OUString& aPropertyName );
258 /// @throws css::uno::RuntimeException
259 css::uno::Sequence< OUString > _getSupportedServiceNames();
261 /// @throws css::uno::RuntimeException
262 css::uno::Sequence< css::uno::Type > const & _getTypes( );
264 void setMaster( SvxShapeMaster* pMaster );
266 // SfxListener
267 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw () override;
269 // XAggregation
270 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override;
272 // XNamed
273 virtual OUString SAL_CALL getName( ) override;
274 virtual void SAL_CALL setName( const OUString& aName ) override;
276 // XShapeDescriptor
277 virtual OUString SAL_CALL getShapeType() override;
279 // XShape
280 virtual css::awt::Point SAL_CALL getPosition() override;
281 virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
282 virtual css::awt::Size SAL_CALL getSize() override;
283 virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
285 // XComponent
286 virtual void SAL_CALL dispose() override;
287 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
288 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
290 // XPropertySet
291 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
292 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
293 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
294 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
295 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
296 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
297 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
299 // XMultiPropertySet
300 virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
301 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
302 virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
303 virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
304 virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
306 // XPropertyState
307 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
308 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
309 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
310 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
312 // XMultiPropertyStates
313 virtual void SAL_CALL setAllPropertiesToDefault() override;
314 virtual void SAL_CALL setPropertiesToDefault(
315 const css::uno::Sequence<
316 OUString >& aPropertyNames ) override;
317 virtual css::uno::Sequence< css::uno::Any >
318 SAL_CALL getPropertyDefaults(
319 const css::uno::Sequence<
320 OUString >& aPropertyNames ) override;
322 // XServiceInfo
323 virtual OUString SAL_CALL getImplementationName() override;
324 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
325 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
327 // XGluePointsSupplier
328 virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL getGluePoints( ) override;
330 // XChild
331 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
332 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
334 // XTypeProvider
335 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
336 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
338 // XActionLockable
339 virtual sal_Bool SAL_CALL isActionLocked( ) override;
340 virtual void SAL_CALL addActionLock( ) override;
341 virtual void SAL_CALL removeActionLock( ) override;
342 virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) override;
343 virtual sal_Int16 SAL_CALL resetActionLocks( ) override;
345 private:
346 /** initializes SdrObj-dependent members. Only to be called when GetSdrObject() != NULL
348 SVX_DLLPRIVATE void impl_initFromSdrObject();
349 /// CTOR-Impl
350 SVX_DLLPRIVATE void impl_construct();
353 class SVX_DLLPUBLIC SvxShapeText : public SvxShape, public SvxUnoTextBase
355 protected:
356 /** called from the XActionLockable interface methods on initial locking */
357 virtual void lock() override;
359 /** called from the XActionLockable interface methods on final unlock */
360 virtual void unlock() override;
362 protected:
363 // override these for special property handling in subcasses. Return true if property is handled
364 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
365 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
366 virtual bool getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, css::beans::PropertyState& rState ) override;
367 virtual bool setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* pProperty ) override;
369 public:
370 SvxShapeText(SdrObject* pObj);
371 SvxShapeText(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
372 virtual ~SvxShapeText() throw () override;
374 virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
376 // XInterface
377 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
378 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
379 virtual void SAL_CALL acquire() throw() override;
380 virtual void SAL_CALL release() throw() override;
382 // XServiceInfo
383 virtual OUString SAL_CALL getImplementationName() override;
384 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
385 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
387 // css::text::XTextRange
388 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
389 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
390 virtual OUString SAL_CALL getString() override;
391 virtual void SAL_CALL setString( const OUString& aString ) override;
393 // XUnoTunnel
394 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
396 // XTypeProvider
397 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
398 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
401 class SvxShapeRect final : public SvxShapeText
403 public:
404 SvxShapeRect(SdrObject* pObj);
405 virtual ~SvxShapeRect() throw () override;
407 // XInterface
408 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
409 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
410 virtual void SAL_CALL acquire() throw() override;
411 virtual void SAL_CALL release() throw() override;
413 // XServiceInfo
414 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
417 /***********************************************************************
419 ***********************************************************************/
420 class SvxShapeGroup final : public SvxShape,
421 public css::drawing::XShapeGroup,
422 public css::drawing::XShapes2,
423 public css::drawing::XShapes
425 private:
426 rtl::Reference< SvxDrawPage> mxPage;
428 void addUnoShape( const css::uno::Reference< css::drawing::XShape >& xShape, size_t nPos );
430 public:
431 SvxShapeGroup(SdrObject* pObj,SvxDrawPage* pDrawPage);
432 virtual ~SvxShapeGroup() throw () override;
434 virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
436 // XInterface
437 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
438 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
439 virtual void SAL_CALL acquire() throw() override;
440 virtual void SAL_CALL release() throw() override;
442 // XShapes
443 virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
444 virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
446 // XShapes2
447 virtual void SAL_CALL addTop( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
448 virtual void SAL_CALL addBottom( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
450 // XElementAccess
451 virtual css::uno::Type SAL_CALL getElementType() override;
452 virtual sal_Bool SAL_CALL hasElements() override;
454 // XIndexAccess
455 virtual sal_Int32 SAL_CALL getCount() override ;
456 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
458 // XShapeDescriptor
459 virtual OUString SAL_CALL getShapeType() override;
461 // XShape
462 virtual css::awt::Point SAL_CALL getPosition() override;
463 virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
464 virtual css::awt::Size SAL_CALL getSize() override;
465 virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
467 // XShapeGroup
468 virtual void SAL_CALL enterGroup( ) override;
469 virtual void SAL_CALL leaveGroup( ) override;
471 // XTypeProvider
472 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
475 /***********************************************************************
477 ***********************************************************************/
478 class SvxShapeConnector : public css::drawing::XConnectorShape,
479 public SvxShapeText
481 public:
482 SvxShapeConnector(SdrObject* pObj);
483 virtual ~SvxShapeConnector() throw() override;
485 // XInterface
486 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
487 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
488 virtual void SAL_CALL acquire() throw() override;
489 virtual void SAL_CALL release() throw() override;
491 // XShapeDescriptor
492 virtual OUString SAL_CALL getShapeType() override;
494 // XShape
495 virtual css::awt::Point SAL_CALL getPosition() override;
496 virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
497 virtual css::awt::Size SAL_CALL getSize() override;
498 virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
500 // XConnectorShape
501 virtual void SAL_CALL connectStart( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override;
502 virtual void SAL_CALL connectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override;
503 virtual void SAL_CALL disconnectBegin( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override;
504 virtual void SAL_CALL disconnectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override;
506 // XTypeProvider
507 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
508 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
511 /***********************************************************************
513 ***********************************************************************/
514 class SVX_DLLPUBLIC SvxShapeControl final : public css::drawing::XControlShape, public SvxShapeText
516 protected:
517 using SvxUnoTextRangeBase::setPropertyValue;
518 using SvxUnoTextRangeBase::getPropertyValue;
520 public:
521 SvxShapeControl(SdrObject* pObj);
522 virtual ~SvxShapeControl() throw() override;
524 // XInterface
525 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
526 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
527 virtual void SAL_CALL acquire() throw() override;
528 virtual void SAL_CALL release() throw() override;
530 // XPropertySet
531 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
532 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
534 // XPropertyState
535 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
536 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
537 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
539 // XShapeDescriptor
540 virtual OUString SAL_CALL getShapeType() override;
542 // XShape
543 virtual css::awt::Point SAL_CALL getPosition() override;
544 virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
545 virtual css::awt::Size SAL_CALL getSize() override;
546 virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
548 // XControlShape
549 virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getControl() override;
550 virtual void SAL_CALL setControl( const css::uno::Reference< css::awt::XControlModel >& xControl ) override;
552 // XTypeProvider
553 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
554 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
557 /***********************************************************************
559 ***********************************************************************/
560 class SvxShapeDimensioning final : public SvxShapeText
562 public:
563 SvxShapeDimensioning(SdrObject* pObj);
564 virtual ~SvxShapeDimensioning() throw() override;
567 /***********************************************************************
569 ***********************************************************************/
570 class SvxShapeCircle final : public SvxShapeText
572 public:
573 SvxShapeCircle(SdrObject* pObj);
574 virtual ~SvxShapeCircle() throw () override;
577 /***********************************************************************
579 ***********************************************************************/
581 // #i118485# changed parent to SvxShapeText to allow Text handling over UNO API
582 class SVX_DLLPUBLIC SvxOle2Shape : public SvxShapeText
584 protected:
585 // override these for special property handling in subcasses. Return true if property is handled
586 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
587 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
589 void resetModifiedState();
591 SvGlobalName GetClassName_Impl(OUString& rHexCLSID);
592 public:
593 SvxOle2Shape(SdrObject* pObj);
594 SvxOle2Shape(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
595 virtual ~SvxOle2Shape() throw() override;
597 bool createObject( const SvGlobalName &aClassName );
599 void createLink( const OUString& aLinkURL );
603 /***********************************************************************
605 ***********************************************************************/
606 class SvxShapePolyPolygon final : public SvxShapeText
608 using SvxUnoTextRangeBase::setPropertyValue;
609 using SvxUnoTextRangeBase::getPropertyValue;
611 // override these for special property handling in subcasses. Return true if property is handled
612 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
613 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
615 // local helper to detect PolygonKind from SdrObject::GetObjIdentifier()
616 css::drawing::PolygonKind GetPolygonKind() const;
618 public:
619 /// @throws css::lang::IllegalArgumentException
620 /// @throws css::beans::PropertyVetoException
621 SvxShapePolyPolygon( SdrObject* pObj );
622 virtual ~SvxShapePolyPolygon() throw() override;
624 // Local support functions
625 /// @throws css::uno::RuntimeException
626 void SetPolygon(const basegfx::B2DPolyPolygon& rNew);
627 basegfx::B2DPolyPolygon GetPolygon() const throw();
630 /***********************************************************************
632 ***********************************************************************/
634 class SVX_DLLPUBLIC SvxGraphicObject final : public SvxShapeText
636 using SvxUnoTextRangeBase::setPropertyValue;
637 using SvxUnoTextRangeBase::getPropertyValue;
639 // override these for special property handling in subcasses. Return true if property is handled
640 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
641 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
643 public:
644 SvxGraphicObject(SdrObject* pObj);
645 virtual ~SvxGraphicObject() throw() override;
648 /***********************************************************************
650 ***********************************************************************/
651 class Svx3DSceneObject final : public css::drawing::XShapes, public SvxShape
653 private:
654 rtl::Reference< SvxDrawPage > mxPage;
656 protected:
657 using SvxShape::setPropertyValue;
658 using SvxShape::getPropertyValue;
660 public:
661 Svx3DSceneObject(SdrObject* pObj, SvxDrawPage* pDrawPage);
662 // override these for special property handling in subcasses. Return true if property is handled
663 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
664 virtual bool getPropertyValueImpl(const OUString& rName, const SfxItemPropertySimpleEntry* pProperty,
665 css::uno::Any& rValue ) override;
667 virtual ~Svx3DSceneObject() throw() override;
669 virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
671 // XInterface
672 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
673 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
674 virtual void SAL_CALL acquire() throw() override;
675 virtual void SAL_CALL release() throw() override;
677 // XShapes
678 virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
679 virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
681 // XElementAccess
682 virtual css::uno::Type SAL_CALL getElementType( ) override;
683 virtual sal_Bool SAL_CALL hasElements( ) override;
685 // XIndexAccess
686 virtual sal_Int32 SAL_CALL getCount( ) override ;
687 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
689 // XServiceInfo
690 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
692 // XTypeProvider
693 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
696 /***********************************************************************
698 ***********************************************************************/
699 class Svx3DCubeObject final : public SvxShape
701 // override these for special property handling in subcasses. Return true if property is handled
702 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
703 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
705 public:
706 Svx3DCubeObject(SdrObject* pObj);
707 virtual ~Svx3DCubeObject() throw() override;
709 // XServiceInfo
710 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
713 /***********************************************************************
715 ***********************************************************************/
716 class Svx3DSphereObject final : public SvxShape
718 public:
719 Svx3DSphereObject(SdrObject* pObj);
720 private:
721 // override these for special property handling in subcasses. Return true if property is handled
722 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
723 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
725 virtual ~Svx3DSphereObject() throw() override;
727 // XServiceInfo
728 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
731 /***********************************************************************
733 ***********************************************************************/
734 class Svx3DLatheObject final : public SvxShape
736 // override these for special property handling in subcasses. Return true if property is handled
737 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
738 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
740 public:
741 Svx3DLatheObject(SdrObject* pObj);
742 virtual ~Svx3DLatheObject() throw() override;
744 // XServiceInfo
745 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
748 /***********************************************************************
750 ***********************************************************************/
751 class Svx3DExtrudeObject final : public SvxShape
753 public:
754 Svx3DExtrudeObject(SdrObject* pObj);
755 private:
756 // override these for special property handling in subcasses. Return true if property is handled
757 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
758 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
760 virtual ~Svx3DExtrudeObject() throw() override;
762 // XServiceInfo
763 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
766 /***********************************************************************
768 ***********************************************************************/
769 class Svx3DPolygonObject final : public SvxShape
771 // override these for special property handling in subcasses. Return true if property is handled
772 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
773 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
775 public:
776 Svx3DPolygonObject(SdrObject* pObj);
777 virtual ~Svx3DPolygonObject() throw() override;
779 // XServiceInfo
780 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
783 /***********************************************************************
785 ***********************************************************************/
786 typedef ::cppu::WeakAggImplHelper1<
787 css::drawing::XEnhancedCustomShapeDefaulter
788 > SvxShape_UnoImplHelper1;
790 class SVX_DLLPUBLIC SvxCustomShape final : public SvxShapeText, public SvxShape_UnoImplHelper1
792 protected:
793 using SvxUnoTextRangeBase::setPropertyValue;
794 using SvxUnoTextRangeBase::getPropertyValue;
796 public:
797 SvxCustomShape(SdrObject* pObj);
798 // override these for special property handling in subcasses. Return true if property is handled
799 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
802 virtual ~SvxCustomShape() throw () override;
804 // XInterface
805 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
806 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
807 virtual void SAL_CALL acquire() throw() override;
808 virtual void SAL_CALL release() throw() override;
810 // XShape
811 virtual css::awt::Point SAL_CALL getPosition() override;
813 // XPropertySet
814 void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
816 // XTypeProvider
817 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
818 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
820 //XEnhancedCustomShapeDefaulter
821 virtual void SAL_CALL createCustomShapeDefaults( const OUString& rShapeType ) override;
824 /***********************************************************************
826 ***********************************************************************/
828 class SvxMediaShape final : public SvxShape
830 public:
831 SvxMediaShape(SdrObject* pObj, OUString const & referer);
832 virtual ~SvxMediaShape() throw() override;
834 private:
835 // override these for special property handling in subcasses. Return true if property is handled
836 virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
837 virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
839 OUString const referer_;
842 #endif
844 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */