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 <svl/lstner.hxx>
47 #include <editeng/unoipset.hxx>
48 #include <svx/svxdllapi.h>
49 #include <rtl/ref.hxx>
50 #include <com/sun/star/uno/Any.hxx>
51 #include <editeng/unotext.hxx>
53 #include <svx/svdobj.hxx>
54 #include <unotools/weakref.hxx>
56 #include <comphelper/servicehelper.hxx>
58 #include <cppuhelper/implbase12.hxx>
66 // Dimension arrows change size/position on save/reload (#i59051#)
70 } // end of namespace basegfx
74 class SvxItemPropertySet
;
77 void SVXCORE_DLLPUBLIC
SvxItemPropertySet_setPropertyValue( const SfxItemPropertyMapEntry
* pMap
,
78 const css::uno::Any
& rVal
, SfxItemSet
& rSet
);
80 css::uno::Any SVXCORE_DLLPUBLIC
SvxItemPropertySet_getPropertyValue( const SfxItemPropertyMapEntry
* pMap
, const SfxItemSet
& rSet
);
83 // WARNING: if you update the supported interfaces,
84 // also update SvxShape::_getTypes()
85 typedef ::cppu::WeakAggImplHelper12
<
87 css::lang::XComponent
,
88 css::beans::XPropertySet
,
89 css::beans::XMultiPropertySet
,
90 css::beans::XPropertyState
,
91 css::lang::XUnoTunnel
,
92 css::container::XNamed
,
93 css::drawing::XGluePointsSupplier
,
94 css::container::XChild
,
95 css::lang::XServiceInfo
,
96 css::document::XActionLockable
,
97 css::beans::XMultiPropertyStates
> SvxShape_UnoImplHelper
;
99 class SVXCORE_DLLPUBLIC SvxShape
:
100 public SvxShape_UnoImplHelper
,
104 friend class SvxDrawPage
;
105 friend class SvxShapeConnector
;
106 friend class SdXShape
;
108 // translations for writer, which works in TWIPS
109 void ForceMetricToItemPoolMetric(Pair
& rPoint
) const noexcept
;
110 void ForceMetricToItemPoolMetric(Point
& rPoint
) const noexcept
{ ForceMetricToItemPoolMetric(rPoint
.toPair()); }
111 void ForceMetricToItemPoolMetric(Size
& rPoint
) const noexcept
{ ForceMetricToItemPoolMetric(rPoint
.toPair()); }
112 void ForceMetricTo100th_mm(Pair
& rPoint
) const noexcept
;
113 void ForceMetricTo100th_mm(Point
& rPoint
) const noexcept
{ ForceMetricTo100th_mm(rPoint
.toPair()); }
114 void ForceMetricTo100th_mm(Size
& rPoint
) const noexcept
{ ForceMetricTo100th_mm(rPoint
.toPair()); }
116 // version for basegfx::B2DPolyPolygon
117 void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon
& rPolyPolygon
) const noexcept
;
118 void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon
& rPolyPolygon
) const noexcept
;
120 // tdf#117145 version for basegfx::B2DHomMatrix
121 void ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix
& rB2DHomMatrix
) const noexcept
;
122 void ForceMetricTo100th_mm(basegfx::B2DHomMatrix
& rB2DHomMatrix
) const noexcept
;
124 css::uno::Any
GetAnyForItem( SfxItemSet
const & aSet
, const SfxItemPropertyMapEntry
* pMap
) const;
126 bool SetFillAttribute( sal_uInt16 nWID
, const OUString
& rName
);
128 /** called from the XActionLockable interface methods on initial locking */
131 /** called from the XActionLockable interface methods on final unlock */
132 virtual void unlock();
134 std::span
<const SfxItemPropertyMapEntry
> getPropertyMapEntries() const { return maPropMapEntries
; }
136 void updateShapeKind();
137 void endSetPropertyValues();
139 // override these for special property handling in subcasses. Return true if property is handled
140 /// @throws css::beans::UnknownPropertyException
141 /// @throws css::beans::PropertyVetoException
142 /// @throws css::lang::IllegalArgumentException
143 /// @throws css::lang::WrappedTargetException
144 /// @throws css::uno::RuntimeException
145 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
);
146 /// @throws css::beans::UnknownPropertyException
147 /// @throws css::lang::WrappedTargetException
148 /// @throws css::uno::RuntimeException
149 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
);
150 /// @throws css::beans::UnknownPropertyException
151 /// @throws css::uno::RuntimeException
152 virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry
* pProperty
, css::beans::PropertyState
& rState
);
153 /// @throws css::beans::UnknownPropertyException
154 /// @throws css::uno::RuntimeException
155 virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry
* pProperty
);
158 /// @throws css::uno::RuntimeException
159 SvxShape( SdrObject
* pObj
);
160 /// @throws css::uno::RuntimeException
161 SvxShape( SdrObject
* pObject
, std::span
<const SfxItemPropertyMapEntry
> pEntries
, const SvxItemPropertySet
* pPropertySet
);
162 virtual ~SvxShape() noexcept override
;
165 void ObtainSettingsFromPropertySet(const SvxItemPropertySet
& rPropSet
);
166 virtual void Create( SdrObject
* pNewOpj
, SvxDrawPage
* pNewPage
);
168 // used exclusively by SdrObject
169 void InvalidateSdrObject();
171 // Encapsulated access to SdrObject
172 SdrObject
* GetSdrObject() const { return mxSdrObject
.get(); }
173 bool HasSdrObject() const { return mxSdrObject
.is(); }
175 void SetShapeType( const OUString
& ShapeType
) { maShapeType
= ShapeType
; }
176 /// @throws css::uno::RuntimeException
177 css::uno::Any
GetBitmap( bool bMetaFile
= false ) const;
179 void notifyPropertyChange(const OUString
& rPropName
);
181 void setShapeKind( SdrObjKind nKind
);
182 SdrObjKind
getShapeKind() const;
185 static bool SetFillAttribute( sal_uInt16 nWID
, const OUString
& rName
, SfxItemSet
& rSet
, SdrModel
const * pModel
);
186 static bool SetFillAttribute( sal_uInt16 nWID
, const OUString
& rName
, SfxItemSet
& rSet
);
188 /** same as SetFillAttribute but for property names instead of which ids,
189 and the property found is returned instead of set at the object
193 UNO3_GETIMPLEMENTATION_DECL( SvxShape
)
195 // access methods for master objects
196 /// @throws css::uno::RuntimeException
197 rtl::Reference
< SfxItemPropertySetInfo
> const & _getPropertySetInfo( );
198 /// @throws css::beans::UnknownPropertyException
199 /// @throws css::beans::PropertyVetoException
200 /// @throws css::lang::IllegalArgumentException
201 /// @throws css::lang::WrappedTargetException
202 /// @throws css::uno::RuntimeException
203 void _setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
);
204 /// @throws css::beans::UnknownPropertyException
205 /// @throws css::lang::WrappedTargetException
206 /// @throws css::uno::RuntimeException
207 css::uno::Any
_getPropertyValue( const OUString
& PropertyName
);
209 /// @throws css::beans::UnknownPropertyException
210 /// @throws css::uno::RuntimeException
211 css::beans::PropertyState
_getPropertyState( const OUString
& PropertyName
);
212 /// @throws css::beans::UnknownPropertyException
213 /// @throws css::uno::RuntimeException
214 void _setPropertyToDefault( const OUString
& PropertyName
);
215 /// @throws css::beans::UnknownPropertyException
216 /// @throws css::lang::WrappedTargetException
217 /// @throws css::uno::RuntimeException
218 css::uno::Any
_getPropertyDefault( const OUString
& aPropertyName
);
220 /// @throws css::uno::RuntimeException
221 css::uno::Sequence
< OUString
> _getSupportedServiceNames();
223 /// @throws css::uno::RuntimeException
224 css::uno::Sequence
< css::uno::Type
> const & _getTypes( );
226 void setMaster( SvxShapeMaster
* pMaster
);
229 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) noexcept override final
;
232 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& aType
) override
;
235 virtual OUString SAL_CALL
getName( ) override
;
236 virtual void SAL_CALL
setName( const OUString
& aName
) override
;
239 virtual OUString SAL_CALL
getShapeType() override
;
242 virtual css::awt::Point SAL_CALL
getPosition() override
;
243 virtual void SAL_CALL
setPosition( const css::awt::Point
& aPosition
) override
;
244 virtual css::awt::Size SAL_CALL
getSize() override
;
245 virtual void SAL_CALL
setSize( const css::awt::Size
& aSize
) override
;
248 virtual void SAL_CALL
dispose() override
;
249 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::lang::XEventListener
>& xListener
) override
;
250 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
;
253 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
254 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
255 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
256 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
257 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
258 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
259 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
262 virtual void SAL_CALL
setPropertyValues( const css::uno::Sequence
< OUString
>& aPropertyNames
, const css::uno::Sequence
< css::uno::Any
>& aValues
) override
;
263 virtual css::uno::Sequence
< css::uno::Any
> SAL_CALL
getPropertyValues( const css::uno::Sequence
< OUString
>& aPropertyNames
) override
;
264 virtual void SAL_CALL
addPropertiesChangeListener( const css::uno::Sequence
< OUString
>& aPropertyNames
, const css::uno::Reference
< css::beans::XPropertiesChangeListener
>& xListener
) override
;
265 virtual void SAL_CALL
removePropertiesChangeListener( const css::uno::Reference
< css::beans::XPropertiesChangeListener
>& xListener
) override
;
266 virtual void SAL_CALL
firePropertiesChangeEvent( const css::uno::Sequence
< OUString
>& aPropertyNames
, const css::uno::Reference
< css::beans::XPropertiesChangeListener
>& xListener
) override
;
269 virtual css::beans::PropertyState SAL_CALL
getPropertyState( const OUString
& PropertyName
) override
;
270 virtual css::uno::Sequence
< css::beans::PropertyState
> SAL_CALL
getPropertyStates( const css::uno::Sequence
< OUString
>& aPropertyName
) override
;
271 virtual void SAL_CALL
setPropertyToDefault( const OUString
& PropertyName
) override
;
272 virtual css::uno::Any SAL_CALL
getPropertyDefault( const OUString
& aPropertyName
) override
;
274 // XMultiPropertyStates
275 virtual void SAL_CALL
setAllPropertiesToDefault() override
;
276 virtual void SAL_CALL
setPropertiesToDefault(
277 const css::uno::Sequence
<
278 OUString
>& aPropertyNames
) override
;
279 virtual css::uno::Sequence
< css::uno::Any
>
280 SAL_CALL
getPropertyDefaults(
281 const css::uno::Sequence
<
282 OUString
>& aPropertyNames
) override
;
285 virtual OUString SAL_CALL
getImplementationName() override
;
286 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
287 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
289 // XGluePointsSupplier
290 virtual css::uno::Reference
< css::container::XIndexContainer
> SAL_CALL
getGluePoints( ) override
;
293 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getParent( ) override
;
294 virtual void SAL_CALL
setParent( const css::uno::Reference
< css::uno::XInterface
>& Parent
) override
;
297 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
298 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
301 virtual sal_Bool SAL_CALL
isActionLocked( ) override
;
302 virtual void SAL_CALL
addActionLock( ) override
;
303 virtual void SAL_CALL
removeActionLock( ) override
;
304 virtual void SAL_CALL
setActionLocks( sal_Int16 nLock
) override
;
305 virtual sal_Int16 SAL_CALL
resetActionLocks( ) override
;
308 /** initializes SdrObj-dependent members. Only to be called when GetSdrObject() != NULL
310 SVX_DLLPRIVATE
void impl_initFromSdrObject();
312 SVX_DLLPRIVATE
void impl_construct();
315 css::awt::Size maSize
;
316 css::awt::Point maPosition
;
317 OUString maShapeType
;
318 OUString maShapeName
;
319 /** these members are used to optimize XMultiProperty calls */
320 std::unique_ptr
<SvxShapeImpl
> mpImpl
;
321 bool mbIsMultiPropertyCall
;
323 css::uno::WeakReference
< css::container::XIndexContainer
> mxGluePoints
;
324 const SvxItemPropertySet
* mpPropSet
;
325 SvxItemPropertySetUsrAnys maUrsAnys
;
326 std::span
<const SfxItemPropertyMapEntry
> maPropMapEntries
;
327 rtl::Reference
< SdrObject
> mxSdrObject
;
328 /** used from the XActionLockable interface */
329 sal_uInt16 mnLockCount
;
332 class SVXCORE_DLLPUBLIC SvxShapeText
: public SvxShape
, public SvxUnoTextBase
335 /** called from the XActionLockable interface methods on initial locking */
336 virtual void lock() override
;
338 /** called from the XActionLockable interface methods on final unlock */
339 virtual void unlock() override
;
342 // override these for special property handling in subcasses. Return true if property is handled
343 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
344 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
345 virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry
* pProperty
, css::beans::PropertyState
& rState
) override
;
346 virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry
* pProperty
) override
;
349 SvxShapeText(SdrObject
* pObj
);
350 SvxShapeText(SdrObject
* pObject
, std::span
<const SfxItemPropertyMapEntry
> pPropertyMap
, const SvxItemPropertySet
* pPropertySet
);
351 virtual ~SvxShapeText() noexcept override
;
353 virtual void Create( SdrObject
* pNewOpj
, SvxDrawPage
* pNewPage
) override
;
356 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
357 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
358 virtual void SAL_CALL
acquire() noexcept override
359 { SvxShape::acquire(); }
360 virtual void SAL_CALL
release() noexcept override
361 { SvxShape::release(); }
364 virtual OUString SAL_CALL
getImplementationName() override
;
365 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
366 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
368 // css::text::XTextRange
369 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getStart() override
;
370 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getEnd() override
;
371 virtual OUString SAL_CALL
getString() override
;
372 virtual void SAL_CALL
setString( const OUString
& aString
) override
;
375 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
378 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
379 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
382 class UNLESS_MERGELIBS(SAL_DLLPUBLIC_RTTI
) SvxShapeRect final
: public SvxShapeText
385 UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) SvxShapeRect(SdrObject
* pObj
);
386 virtual ~SvxShapeRect() noexcept override
;
389 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
390 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
391 virtual void SAL_CALL
acquire() noexcept override
392 { OWeakAggObject::acquire(); }
393 virtual void SAL_CALL
release() noexcept override
394 { OWeakAggObject::release(); }
397 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
400 /// This only exists so I have a common base class for SvxShapeGroup and Svx3DSceneObject
401 class SVXCORE_DLLPUBLIC SvxShapeGroupAnyD
: public SvxShape
,
402 public css::drawing::XShapes
405 SvxShapeGroupAnyD( SdrObject
* pObject
, std::span
<const SfxItemPropertyMapEntry
> pEntries
, const SvxItemPropertySet
* pPropertySet
);
406 virtual ~SvxShapeGroupAnyD() noexcept override
;
408 virtual void SAL_CALL
acquire() noexcept override
409 { SvxShape::acquire(); }
410 virtual void SAL_CALL
release() noexcept override
411 { SvxShape::release(); }
413 virtual void addShape(SvxShape
& rShape
) = 0;
416 /***********************************************************************
418 ***********************************************************************/
419 class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) SvxShapeGroup final
: public SvxShapeGroupAnyD
,
420 public css::drawing::XShapeGroup
,
421 public css::drawing::XShapes2
424 /// using a weak reference to prevent leaks via ref-counting cycles
425 unotools::WeakReference
< SvxDrawPage
> mxWeakPage
;
427 void addUnoShape( const css::uno::Reference
< css::drawing::XShape
>& xShape
, size_t nPos
);
428 void addShape(SvxShape
& rShape
, size_t nPos
);
431 SvxShapeGroup(SdrObject
* pObj
,SvxDrawPage
* pDrawPage
);
432 virtual ~SvxShapeGroup() noexcept 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() noexcept override
440 { SvxShape::acquire(); }
441 virtual void SAL_CALL
release() noexcept override
442 { SvxShape::release(); }
445 virtual void SAL_CALL
add( const css::uno::Reference
< css::drawing::XShape
>& xShape
) override
;
446 virtual void SAL_CALL
remove( const css::uno::Reference
< css::drawing::XShape
>& xShape
) override
;
449 virtual void SAL_CALL
addTop( const css::uno::Reference
< css::drawing::XShape
>& xShape
) override
;
450 virtual void SAL_CALL
addBottom( const css::uno::Reference
< css::drawing::XShape
>& xShape
) override
;
453 virtual css::uno::Type SAL_CALL
getElementType() override
;
454 virtual sal_Bool SAL_CALL
hasElements() override
;
457 virtual sal_Int32 SAL_CALL
getCount() override
;
458 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
461 virtual OUString SAL_CALL
getShapeType() override
;
464 virtual css::awt::Point SAL_CALL
getPosition() override
;
465 virtual void SAL_CALL
setPosition( const css::awt::Point
& aPosition
) override
;
466 virtual css::awt::Size SAL_CALL
getSize() override
;
467 virtual void SAL_CALL
setSize( const css::awt::Size
& aSize
) override
;
470 virtual void SAL_CALL
enterGroup( ) override
;
471 virtual void SAL_CALL
leaveGroup( ) override
;
474 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
476 virtual void addShape(SvxShape
& rShape
) final override
;
479 /***********************************************************************
481 ***********************************************************************/
482 class SvxShapeConnector final
: public css::drawing::XConnectorShape
,
486 SvxShapeConnector(SdrObject
* pObj
);
487 virtual ~SvxShapeConnector() noexcept override
;
490 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
491 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
492 virtual void SAL_CALL
acquire() noexcept override
493 { SvxShapeText::acquire(); }
494 virtual void SAL_CALL
release() noexcept override
495 { SvxShapeText::release(); }
498 virtual OUString SAL_CALL
getShapeType() override
;
501 virtual css::awt::Point SAL_CALL
getPosition() override
;
502 virtual void SAL_CALL
setPosition( const css::awt::Point
& aPosition
) override
;
503 virtual css::awt::Size SAL_CALL
getSize() override
;
504 virtual void SAL_CALL
setSize( const css::awt::Size
& aSize
) override
;
507 virtual void SAL_CALL
connectStart( const css::uno::Reference
< css::drawing::XConnectableShape
>& xShape
, css::drawing::ConnectionType nPos
) override
;
508 virtual void SAL_CALL
connectEnd( const css::uno::Reference
< css::drawing::XConnectableShape
>& xShape
, css::drawing::ConnectionType nPos
) override
;
509 virtual void SAL_CALL
disconnectBegin( const css::uno::Reference
< css::drawing::XConnectableShape
>& xShape
) override
;
510 virtual void SAL_CALL
disconnectEnd( const css::uno::Reference
< css::drawing::XConnectableShape
>& xShape
) override
;
513 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
514 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
517 /***********************************************************************
519 ***********************************************************************/
520 class UNLESS_MERGELIBS_MORE(SVXCORE_DLLPUBLIC
) SvxShapeControl final
: public css::drawing::XControlShape
, public SvxShapeText
523 using SvxUnoTextRangeBase::setPropertyValue
;
524 using SvxUnoTextRangeBase::getPropertyValue
;
527 SvxShapeControl(SdrObject
* pObj
);
528 virtual ~SvxShapeControl() noexcept override
;
531 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
532 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
533 virtual void SAL_CALL
acquire() noexcept override
534 { SvxShapeText::acquire(); }
535 virtual void SAL_CALL
release() noexcept override
536 { SvxShapeText::release(); }
539 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
540 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
543 virtual css::beans::PropertyState SAL_CALL
getPropertyState( const OUString
& PropertyName
) override
;
544 virtual void SAL_CALL
setPropertyToDefault( const OUString
& PropertyName
) override
;
545 virtual css::uno::Any SAL_CALL
getPropertyDefault( const OUString
& aPropertyName
) override
;
548 virtual OUString SAL_CALL
getShapeType() override
;
551 virtual css::awt::Point SAL_CALL
getPosition() override
;
552 virtual void SAL_CALL
setPosition( const css::awt::Point
& aPosition
) override
;
553 virtual css::awt::Size SAL_CALL
getSize() override
;
554 virtual void SAL_CALL
setSize( const css::awt::Size
& aSize
) override
;
557 virtual css::uno::Reference
< css::awt::XControlModel
> SAL_CALL
getControl() override
;
558 virtual void SAL_CALL
setControl( const css::uno::Reference
< css::awt::XControlModel
>& xControl
) override
;
561 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
562 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
565 /***********************************************************************
567 ***********************************************************************/
568 class SvxShapeDimensioning final
: public SvxShapeText
571 SvxShapeDimensioning(SdrObject
* pObj
);
572 virtual ~SvxShapeDimensioning() noexcept override
;
575 /***********************************************************************
577 ***********************************************************************/
578 class SvxShapeCircle final
: public SvxShapeText
581 UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) SvxShapeCircle(SdrObject
* pObj
);
582 virtual ~SvxShapeCircle() noexcept override
;
585 /***********************************************************************
587 ***********************************************************************/
589 // #i118485# changed parent to SvxShapeText to allow Text handling over UNO API
590 class UNLESS_MERGELIBS_MORE(SVXCORE_DLLPUBLIC
) SvxOle2Shape
: public SvxShapeText
595 // override these for special property handling in subcasses. Return true if property is handled
596 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
597 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
599 void resetModifiedState();
601 SvGlobalName
GetClassName_Impl(OUString
& rHexCLSID
);
603 SvxOle2Shape(SdrObject
* pObj
, OUString referer
);
604 SvxOle2Shape(SdrObject
* pObject
, OUString referer
, std::span
<const SfxItemPropertyMapEntry
> pPropertyMap
, const SvxItemPropertySet
* pPropertySet
);
605 virtual ~SvxOle2Shape() noexcept override
;
607 bool createObject( const SvGlobalName
&aClassName
);
609 void createLink( const OUString
& aLinkURL
);
611 virtual OUString
GetAndClearInitialFrameURL();
615 /***********************************************************************
617 ***********************************************************************/
618 class UNLESS_MERGELIBS(SAL_DLLPUBLIC_RTTI
) SvxShapePolyPolygon final
: public SvxShapeText
620 using SvxUnoTextRangeBase::setPropertyValue
;
621 using SvxUnoTextRangeBase::getPropertyValue
;
623 // override these for special property handling in subcasses. Return true if property is handled
624 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
625 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
627 // local helper to detect PolygonKind from SdrObject::GetObjIdentifier()
628 css::drawing::PolygonKind
GetPolygonKind() const;
631 /// @throws css::lang::IllegalArgumentException
632 /// @throws css::beans::PropertyVetoException
633 UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) SvxShapePolyPolygon( SdrObject
* pObj
);
634 virtual ~SvxShapePolyPolygon() noexcept override
;
636 // Local support functions
637 /// @throws css::uno::RuntimeException
638 void SetPolygon(const basegfx::B2DPolyPolygon
& rNew
);
639 basegfx::B2DPolyPolygon
GetPolygon() const noexcept
;
642 /***********************************************************************
644 ***********************************************************************/
646 class SvxGraphicObject final
: public SvxShapeText
648 using SvxUnoTextRangeBase::setPropertyValue
;
649 using SvxUnoTextRangeBase::getPropertyValue
;
651 // override these for special property handling in subcasses. Return true if property is handled
652 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
653 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
656 UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) SvxGraphicObject(SdrObject
* pObj
);
657 virtual ~SvxGraphicObject() noexcept override
;
660 /***********************************************************************
662 ***********************************************************************/
663 class UNLESS_MERGELIBS(SAL_DLLPUBLIC_RTTI
) Svx3DSceneObject final
: public SvxShapeGroupAnyD
666 rtl::Reference
< SvxDrawPage
> mxPage
;
669 using SvxShape::setPropertyValue
;
670 using SvxShape::getPropertyValue
;
672 UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) Svx3DSceneObject(SdrObject
* pObj
, SvxDrawPage
* pDrawPage
);
673 // override these for special property handling in subcasses. Return true if property is handled
674 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
675 virtual bool getPropertyValueImpl(const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
,
676 css::uno::Any
& rValue
) override
;
678 virtual ~Svx3DSceneObject() noexcept override
;
680 virtual void Create( SdrObject
* pNewOpj
, SvxDrawPage
* pNewPage
) override
;
683 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
684 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
685 virtual void SAL_CALL
acquire() noexcept override
686 { SvxShape::acquire(); }
687 virtual void SAL_CALL
release() noexcept override
688 { SvxShape::release(); }
691 virtual void SAL_CALL
add( const css::uno::Reference
< css::drawing::XShape
>& xShape
) override
;
692 virtual void SAL_CALL
remove( const css::uno::Reference
< css::drawing::XShape
>& xShape
) override
;
695 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
696 virtual sal_Bool SAL_CALL
hasElements( ) override
;
699 virtual sal_Int32 SAL_CALL
getCount( ) override
;
700 virtual css::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
703 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
706 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
708 virtual void addShape(SvxShape
& rShape
) override final
;
711 /***********************************************************************
713 ***********************************************************************/
714 class Svx3DCubeObject final
: public SvxShape
716 // override these for special property handling in subcasses. Return true if property is handled
717 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
718 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
721 Svx3DCubeObject(SdrObject
* pObj
);
722 virtual ~Svx3DCubeObject() noexcept override
;
725 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
728 /***********************************************************************
730 ***********************************************************************/
731 class Svx3DSphereObject final
: public SvxShape
734 Svx3DSphereObject(SdrObject
* pObj
);
736 // override these for special property handling in subcasses. Return true if property is handled
737 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
738 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
740 virtual ~Svx3DSphereObject() noexcept override
;
743 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
746 /***********************************************************************
748 ***********************************************************************/
749 class Svx3DLatheObject final
: public SvxShape
751 // override these for special property handling in subcasses. Return true if property is handled
752 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
753 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
756 UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) Svx3DLatheObject(SdrObject
* pObj
);
757 virtual ~Svx3DLatheObject() noexcept override
;
760 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
763 /***********************************************************************
765 ***********************************************************************/
766 class Svx3DExtrudeObject final
: public SvxShape
769 UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) Svx3DExtrudeObject(SdrObject
* pObj
);
771 // override these for special property handling in subcasses. Return true if property is handled
772 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
773 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
775 virtual ~Svx3DExtrudeObject() noexcept override
;
778 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
781 /***********************************************************************
783 ***********************************************************************/
784 class Svx3DPolygonObject final
: public SvxShape
786 // override these for special property handling in subcasses. Return true if property is handled
787 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
788 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
791 UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC
) Svx3DPolygonObject(SdrObject
* pObj
);
792 virtual ~Svx3DPolygonObject() noexcept override
;
795 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
798 /***********************************************************************
800 ***********************************************************************/
801 class SVXCORE_DLLPUBLIC SvxCustomShape final
: public SvxShapeText
, public css::drawing::XEnhancedCustomShapeDefaulter
804 using SvxUnoTextRangeBase::setPropertyValue
;
805 using SvxUnoTextRangeBase::getPropertyValue
;
808 SvxCustomShape(SdrObject
* pObj
);
809 // override these for special property handling in subcasses. Return true if property is handled
810 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
813 virtual ~SvxCustomShape() noexcept override
;
816 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
817 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
818 virtual void SAL_CALL
acquire() noexcept override
819 { SvxShapeText::acquire(); }
820 virtual void SAL_CALL
release() noexcept override
821 { SvxShapeText::release(); }
824 virtual css::awt::Point SAL_CALL
getPosition() override
;
827 void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
830 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) override
;
832 //XEnhancedCustomShapeDefaulter
833 virtual void SAL_CALL
createCustomShapeDefaults( const OUString
& rShapeType
) override
;
836 /***********************************************************************
838 ***********************************************************************/
840 class SvxMediaShape final
: public SvxShape
843 SvxMediaShape(SdrObject
* pObj
, OUString referer
);
844 virtual ~SvxMediaShape() noexcept override
;
847 // override these for special property handling in subcasses. Return true if property is handled
848 virtual bool setPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, const css::uno::Any
& rValue
) override
;
849 virtual bool getPropertyValueImpl( const OUString
& rName
, const SfxItemPropertyMapEntry
* pProperty
, css::uno::Any
& rValue
) override
;
850 bool getPropertyStateImpl(const SfxItemPropertyMapEntry
* pProperty
,
851 css::beans::PropertyState
& rState
) override
;
858 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */