1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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>
67 class IOpenGLRenderer
;
69 // Dimension arrows change size/position on save/reload (#i59051#)
73 } // end of namespace basegfx
83 class SvxItemPropertySet
;
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
<
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
,
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
;
125 friend class SvxDrawPage
;
126 friend class SvxShapeConnector
;
127 friend class SdXShape
;
129 const SvxItemPropertySet
* mpPropSet
;
130 const SfxItemPropertyMapEntry
* maPropMapEntries
;
133 ::tools::WeakReference
< SdrObject
> mpSdrObjectWeakReference
;
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 */
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
);
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
;
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;
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
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
);
267 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) throw () override
;
270 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& aType
) override
;
273 virtual OUString SAL_CALL
getName( ) override
;
274 virtual void SAL_CALL
setName( const OUString
& aName
) override
;
277 virtual OUString SAL_CALL
getShapeType() override
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
335 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
336 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
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
;
346 /** initializes SdrObj-dependent members. Only to be called when GetSdrObject() != NULL
348 SVX_DLLPRIVATE
void impl_initFromSdrObject();
350 SVX_DLLPRIVATE
void impl_construct();
353 class SVX_DLLPUBLIC SvxShapeText
: public SvxShape
, public SvxUnoTextBase
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
;
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
;
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
;
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
;
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
;
394 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
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
404 SvxShapeRect(SdrObject
* pObj
);
405 virtual ~SvxShapeRect() throw () override
;
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
;
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
426 rtl::Reference
< SvxDrawPage
> mxPage
;
428 void addUnoShape( const css::uno::Reference
< css::drawing::XShape
>& xShape
, size_t nPos
);
431 SvxShapeGroup(SdrObject
* pObj
,SvxDrawPage
* pDrawPage
);
432 virtual ~SvxShapeGroup() throw () override
;
434 virtual void Create( SdrObject
* pNewOpj
, SvxDrawPage
* pNewPage
) override
;
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
;
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
;
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
;
451 virtual css::uno::Type SAL_CALL
getElementType() override
;
452 virtual sal_Bool SAL_CALL
hasElements() override
;
455 virtual sal_Int32 SAL_CALL
getCount() override
;
456 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
459 virtual OUString SAL_CALL
getShapeType() override
;
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
;
468 virtual void SAL_CALL
enterGroup( ) override
;
469 virtual void SAL_CALL
leaveGroup( ) override
;
472 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
475 /***********************************************************************
477 ***********************************************************************/
478 class SvxShapeConnector
: public css::drawing::XConnectorShape
,
482 SvxShapeConnector(SdrObject
* pObj
);
483 virtual ~SvxShapeConnector() throw() override
;
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
;
492 virtual OUString SAL_CALL
getShapeType() override
;
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
;
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
;
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
517 using SvxUnoTextRangeBase::setPropertyValue
;
518 using SvxUnoTextRangeBase::getPropertyValue
;
521 SvxShapeControl(SdrObject
* pObj
);
522 virtual ~SvxShapeControl() throw() override
;
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
;
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
;
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
;
540 virtual OUString SAL_CALL
getShapeType() override
;
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
;
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
;
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
563 SvxShapeDimensioning(SdrObject
* pObj
);
564 virtual ~SvxShapeDimensioning() throw() override
;
567 /***********************************************************************
569 ***********************************************************************/
570 class SvxShapeCircle final
: public SvxShapeText
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
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
);
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;
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
;
644 SvxGraphicObject(SdrObject
* pObj
);
645 virtual ~SvxGraphicObject() throw() override
;
648 /***********************************************************************
650 ***********************************************************************/
651 class Svx3DSceneObject final
: public css::drawing::XShapes
, public SvxShape
654 rtl::Reference
< SvxDrawPage
> mxPage
;
657 using SvxShape::setPropertyValue
;
658 using SvxShape::getPropertyValue
;
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
;
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
;
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
;
682 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
683 virtual sal_Bool SAL_CALL
hasElements( ) override
;
686 virtual sal_Int32 SAL_CALL
getCount( ) override
;
687 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
690 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
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
;
706 Svx3DCubeObject(SdrObject
* pObj
);
707 virtual ~Svx3DCubeObject() throw() override
;
710 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
713 /***********************************************************************
715 ***********************************************************************/
716 class Svx3DSphereObject final
: public SvxShape
719 Svx3DSphereObject(SdrObject
* pObj
);
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
;
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
;
741 Svx3DLatheObject(SdrObject
* pObj
);
742 virtual ~Svx3DLatheObject() throw() override
;
745 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
748 /***********************************************************************
750 ***********************************************************************/
751 class Svx3DExtrudeObject final
: public SvxShape
754 Svx3DExtrudeObject(SdrObject
* pObj
);
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
;
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
;
776 Svx3DPolygonObject(SdrObject
* pObj
);
777 virtual ~Svx3DPolygonObject() throw() override
;
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
793 using SvxUnoTextRangeBase::setPropertyValue
;
794 using SvxUnoTextRangeBase::getPropertyValue
;
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
;
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
;
811 virtual css::awt::Point SAL_CALL
getPosition() override
;
814 void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
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
831 SvxMediaShape(SdrObject
* pObj
, OUString
const & referer
);
832 virtual ~SvxMediaShape() throw() override
;
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_
;
844 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */