LibreOffice Module svx (master)  1
unoshape.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SVX_UNOSHAPE_HXX
21 #define INCLUDED_SVX_UNOSHAPE_HXX
22 
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>
45 #include <sal/types.h>
46 #include <tools/weakbase.hxx>
47 #include <svl/lstner.hxx>
48 #include <editeng/unoipset.hxx>
49 #include <svx/svxdllapi.h>
50 #include <rtl/ref.hxx>
51 #include <com/sun/star/uno/Any.hxx>
52 #include <editeng/unotext.hxx>
53 
54 #include <svx/svdobj.hxx>
55 
57 
58 #include <cppuhelper/basemutex.hxx>
60 
61 class SfxItemSet;
62 class SdrModel;
63 class SvxDrawPage;
64 class SvGlobalName;
65 class Pair;
66 
67 // Dimension arrows change size/position on save/reload (#i59051#)
68 namespace basegfx
69  {
70  class B2DPolyPolygon;
71  } // end of namespace basegfx
72 
73 struct SvxShapeImpl;
74 class SvxShapeMaster;
75 class SvxItemPropertySet;
76 class SfxItemSet;
77 
79  const css::uno::Any& rVal, SfxItemSet& rSet );
80 
82 
83 
84 // WARNING: if you update the supported interfaces,
85 // also update SvxShape::_getTypes()
86 typedef ::cppu::WeakAggImplHelper12<
87  css::drawing::XShape,
88  css::lang::XComponent,
90  css::beans::XMultiPropertySet,
91  css::beans::XPropertyState,
92  css::lang::XUnoTunnel,
93  css::container::XNamed,
94  css::drawing::XGluePointsSupplier,
95  css::container::XChild,
96  css::lang::XServiceInfo,
97  css::document::XActionLockable,
98  css::beans::XMultiPropertyStates> SvxShape_UnoImplHelper;
99 
101  public cppu::BaseMutex,
102  public SvxShape_UnoImplHelper,
103  public SfxListener
104 {
105 private:
106  css::awt::Size maSize;
107  css::awt::Point maPosition;
108  OUString maShapeType;
109  OUString maShapeName;
110 
112  std::unique_ptr<SvxShapeImpl> mpImpl;
114 
115  css::uno::WeakReference< css::container::XIndexContainer > mxGluePoints;
116 
117 protected:
118  friend class SvxDrawPage;
119  friend class SvxShapeConnector;
120  friend class SdXShape;
121 
125 
126 private:
128 
129 protected:
130  // translations for writer, which works in TWIPS
131  void ForceMetricToItemPoolMetric(Pair& rPoint) const noexcept;
132  void ForceMetricToItemPoolMetric(Point& rPoint) const noexcept { ForceMetricToItemPoolMetric(rPoint.toPair()); }
133  void ForceMetricToItemPoolMetric(Size& rPoint) const noexcept { ForceMetricToItemPoolMetric(rPoint.toPair()); }
134  void ForceMetricTo100th_mm(Pair& rPoint) const noexcept;
135  void ForceMetricTo100th_mm(Point& rPoint) const noexcept { ForceMetricTo100th_mm(rPoint.toPair()); }
136  void ForceMetricTo100th_mm(Size& rPoint) const noexcept { ForceMetricTo100th_mm(rPoint.toPair()); }
137 
138  // version for basegfx::B2DPolyPolygon
139  void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const noexcept;
140  void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const noexcept;
141 
142  // tdf#117145 version for basegfx::B2DHomMatrix
143  void ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix& rB2DHomMatrix) const noexcept;
144  void ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rB2DHomMatrix) const noexcept;
145 
146  css::uno::Any GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertyMapEntry* pMap ) const;
147 
148  bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName );
149 
151  virtual void lock();
152 
154  virtual void unlock();
155 
157  sal_uInt16 mnLockCount;
158 
159  const SfxItemPropertyMapEntry* getPropertyMapEntries() const { return maPropMapEntries; }
160 
161  void updateShapeKind();
162  void endSetPropertyValues();
163 
164  // override these for special property handling in subcasses. Return true if property is handled
170  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue );
174  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue );
177  virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState );
180  virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry* pProperty );
181 
182 public:
184  SvxShape( SdrObject* pObj );
186  SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries, const SvxItemPropertySet* pPropertySet );
187  virtual ~SvxShape() noexcept override;
188 
189  // Internals
190  void ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet);
191  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage );
197  void TakeSdrObjectOwnership();
198  bool HasSdrObjectOwnership() const;
199 
200  // used exclusively by SdrObject
201  void InvalidateSdrObject();
202 
203  // Encapsulated access to SdrObject
204  SdrObject* GetSdrObject() const { return mpSdrObjectWeakReference.get(); }
205  bool HasSdrObject() const { return mpSdrObjectWeakReference.is(); }
206 
207  void SetShapeType( const OUString& ShapeType ) { maShapeType = ShapeType; }
209  css::uno::Any GetBitmap( bool bMetaFile = false ) const;
210 
211  svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
212 
213  void setShapeKind( SdrObjKind nKind );
214  SdrObjKind getShapeKind() const;
215 
216  // styles need this
217  static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel );
218  static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet );
219 
226 
227  // access methods for master objects
229  css::uno::Reference< css::beans::XPropertySetInfo > const & _getPropertySetInfo( );
235  void _setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue );
239  css::uno::Any _getPropertyValue( const OUString& PropertyName );
240 
243  css::beans::PropertyState _getPropertyState( const OUString& PropertyName );
246  void _setPropertyToDefault( const OUString& PropertyName );
250  css::uno::Any _getPropertyDefault( const OUString& aPropertyName );
251 
253  css::uno::Sequence< OUString > _getSupportedServiceNames();
254 
256  css::uno::Sequence< css::uno::Type > const & _getTypes( );
257 
258  void setMaster( SvxShapeMaster* pMaster );
259 
260  // SfxListener
261  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) noexcept override;
262 
263  // XAggregation
264  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override;
265 
266  // XNamed
267  virtual OUString SAL_CALL getName( ) override;
268  virtual void SAL_CALL setName( const OUString& aName ) override;
269 
270  // XShapeDescriptor
271  virtual OUString SAL_CALL getShapeType() override;
272 
273  // XShape
274  virtual css::awt::Point SAL_CALL getPosition() override;
275  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
276  virtual css::awt::Size SAL_CALL getSize() override;
277  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
278 
279  // XComponent
280  virtual void SAL_CALL dispose() override;
281  virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
282  virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
283 
284  // XPropertySet
285  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
286  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
287  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
288  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
289  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
290  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
291  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
292 
293  // XMultiPropertySet
294  virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
295  virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
296  virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
297  virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
298  virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
299 
300  // XPropertyState
301  virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
302  virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
303  virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
304  virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
305 
306  // XMultiPropertyStates
307  virtual void SAL_CALL setAllPropertiesToDefault() override;
308  virtual void SAL_CALL setPropertiesToDefault(
309  const css::uno::Sequence<
310  OUString >& aPropertyNames ) override;
311  virtual css::uno::Sequence< css::uno::Any >
312  SAL_CALL getPropertyDefaults(
313  const css::uno::Sequence<
314  OUString >& aPropertyNames ) override;
315 
316  // XServiceInfo
317  virtual OUString SAL_CALL getImplementationName() override;
318  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
319  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
320 
321  // XGluePointsSupplier
322  virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL getGluePoints( ) override;
323 
324  // XChild
325  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
326  virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
327 
328  // XTypeProvider
329  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
330  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
331 
332  // XActionLockable
333  virtual sal_Bool SAL_CALL isActionLocked( ) override;
334  virtual void SAL_CALL addActionLock( ) override;
335  virtual void SAL_CALL removeActionLock( ) override;
336  virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) override;
337  virtual sal_Int16 SAL_CALL resetActionLocks( ) override;
338 
339 private:
342  SVX_DLLPRIVATE void impl_initFromSdrObject();
344  SVX_DLLPRIVATE void impl_construct();
345 };
346 
348 {
349 protected:
351  virtual void lock() override;
352 
354  virtual void unlock() override;
355 
356 protected:
357  // override these for special property handling in subcasses. Return true if property is handled
358  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
359  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
360  virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState ) override;
361  virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry* pProperty ) override;
362 
363 public:
364  SvxShapeText(SdrObject* pObj);
365  SvxShapeText(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
366  virtual ~SvxShapeText() noexcept override;
367 
368  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
369 
370  // XInterface
371  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
372  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
373  virtual void SAL_CALL acquire() noexcept override
374  { SvxShape::acquire(); }
375  virtual void SAL_CALL release() noexcept override
376  { SvxShape::release(); }
377 
378  // XServiceInfo
379  virtual OUString SAL_CALL getImplementationName() override;
380  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
381  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
382 
383  // css::text::XTextRange
384  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
385  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
386  virtual OUString SAL_CALL getString() override;
387  virtual void SAL_CALL setString( const OUString& aString ) override;
388 
389  // XUnoTunnel
390  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
391 
392  // XTypeProvider
393  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
394  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
395 };
396 
397 class SAL_DLLPUBLIC_RTTI SvxShapeRect final : public SvxShapeText
398 {
399 public:
401  virtual ~SvxShapeRect() noexcept override;
402 
403  // XInterface
404  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
405  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
406  virtual void SAL_CALL acquire() noexcept override
407  { OWeakAggObject::acquire(); }
408  virtual void SAL_CALL release() noexcept override
409  { OWeakAggObject::release(); }
410 
411  // XServiceInfo
412  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
413 };
414 
417  public css::drawing::XShapes
418 {
419 public:
420  SvxShapeGroupAnyD( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries, const SvxItemPropertySet* pPropertySet );
421  virtual ~SvxShapeGroupAnyD() noexcept override;
422 
423  virtual void SAL_CALL acquire() noexcept override
424  { SvxShape::acquire(); }
425  virtual void SAL_CALL release() noexcept override
426  { SvxShape::release(); }
427 
428  virtual void addShape(SvxShape& rShape) = 0;
429 };
430 
431 /***********************************************************************
432 * *
433 ***********************************************************************/
435  public css::drawing::XShapeGroup,
436  public css::drawing::XShapes2
437 {
438 private:
440 
441  void addUnoShape( const css::uno::Reference< css::drawing::XShape >& xShape, size_t nPos );
442  void addShape(SvxShape& rShape, size_t nPos);
443 
444 public:
445  SvxShapeGroup(SdrObject* pObj,SvxDrawPage* pDrawPage);
446  virtual ~SvxShapeGroup() noexcept override;
447 
448  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
449 
450  // XInterface
451  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
452  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
453  virtual void SAL_CALL acquire() noexcept override
454  { SvxShape::acquire(); }
455  virtual void SAL_CALL release() noexcept override
456  { SvxShape::release(); }
457 
458  // XShapes
459  virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
460  virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
461 
462  // XShapes2
463  virtual void SAL_CALL addTop( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
464  virtual void SAL_CALL addBottom( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
465 
466  // XElementAccess
467  virtual css::uno::Type SAL_CALL getElementType() override;
468  virtual sal_Bool SAL_CALL hasElements() override;
469 
470  // XIndexAccess
471  virtual sal_Int32 SAL_CALL getCount() override ;
472  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
473 
474  // XShapeDescriptor
475  virtual OUString SAL_CALL getShapeType() override;
476 
477  // XShape
478  virtual css::awt::Point SAL_CALL getPosition() override;
479  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
480  virtual css::awt::Size SAL_CALL getSize() override;
481  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
482 
483  // XShapeGroup
484  virtual void SAL_CALL enterGroup( ) override;
485  virtual void SAL_CALL leaveGroup( ) override;
486 
487  // XTypeProvider
488  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
489 
490  virtual void addShape(SvxShape& rShape) final override;
491 };
492 
493 /***********************************************************************
494 * *
495 ***********************************************************************/
496 class SvxShapeConnector final : public css::drawing::XConnectorShape,
497  public SvxShapeText
498 {
499 public:
501  virtual ~SvxShapeConnector() noexcept override;
502 
503  // XInterface
504  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
505  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
506  virtual void SAL_CALL acquire() noexcept override
507  { SvxShapeText::acquire(); }
508  virtual void SAL_CALL release() noexcept override
509  { SvxShapeText::release(); }
510 
511  // XShapeDescriptor
512  virtual OUString SAL_CALL getShapeType() override;
513 
514  // XShape
515  virtual css::awt::Point SAL_CALL getPosition() override;
516  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
517  virtual css::awt::Size SAL_CALL getSize() override;
518  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
519 
520  // XConnectorShape
521  virtual void SAL_CALL connectStart( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override;
522  virtual void SAL_CALL connectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override;
523  virtual void SAL_CALL disconnectBegin( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override;
524  virtual void SAL_CALL disconnectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override;
525 
526  // XTypeProvider
527  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
528  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
529 };
530 
531 /***********************************************************************
532 * *
533 ***********************************************************************/
534 class SVXCORE_DLLPUBLIC SvxShapeControl final : public css::drawing::XControlShape, public SvxShapeText
535 {
536 protected:
539 
540 public:
541  SvxShapeControl(SdrObject* pObj);
542  virtual ~SvxShapeControl() noexcept override;
543 
544  // XInterface
545  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
546  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
547  virtual void SAL_CALL acquire() noexcept override
548  { SvxShapeText::acquire(); }
549  virtual void SAL_CALL release() noexcept override
550  { SvxShapeText::release(); }
551 
552  // XPropertySet
553  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
554  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
555 
556  // XPropertyState
557  virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
558  virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
559  virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
560 
561  // XShapeDescriptor
562  virtual OUString SAL_CALL getShapeType() override;
563 
564  // XShape
565  virtual css::awt::Point SAL_CALL getPosition() override;
566  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
567  virtual css::awt::Size SAL_CALL getSize() override;
568  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
569 
570  // XControlShape
571  virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getControl() override;
572  virtual void SAL_CALL setControl( const css::uno::Reference< css::awt::XControlModel >& xControl ) override;
573 
574  // XTypeProvider
575  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
576  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
577 };
578 
579 /***********************************************************************
580 * *
581 ***********************************************************************/
582 class SvxShapeDimensioning final : public SvxShapeText
583 {
584 public:
586  virtual ~SvxShapeDimensioning() noexcept override;
587 };
588 
589 /***********************************************************************
590 * *
591 ***********************************************************************/
592 class SvxShapeCircle final : public SvxShapeText
593 {
594 public:
596  virtual ~SvxShapeCircle() noexcept override;
597 };
598 
599 /***********************************************************************
600 * *
601 ***********************************************************************/
602 
603 // #i118485# changed parent to SvxShapeText to allow Text handling over UNO API
605 {
606 protected:
607  // override these for special property handling in subcasses. Return true if property is handled
608  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
609  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
610 
611  void resetModifiedState();
612 
613  SvGlobalName GetClassName_Impl(OUString& rHexCLSID);
614 public:
615  SvxOle2Shape(SdrObject* pObj);
616  SvxOle2Shape(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
617  virtual ~SvxOle2Shape() noexcept override;
618 
619  bool createObject( const SvGlobalName &aClassName );
620 
621  void createLink( const OUString& aLinkURL );
622 };
623 
624 
625 /***********************************************************************
626 * *
627 ***********************************************************************/
628 class SAL_DLLPUBLIC_RTTI SvxShapePolyPolygon final : public SvxShapeText
629 {
632 
633  // override these for special property handling in subcasses. Return true if property is handled
634  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
635  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
636 
637  // local helper to detect PolygonKind from SdrObject::GetObjIdentifier()
638  css::drawing::PolygonKind GetPolygonKind() const;
639 
640 public:
644  virtual ~SvxShapePolyPolygon() noexcept override;
645 
646  // Local support functions
648  void SetPolygon(const basegfx::B2DPolyPolygon& rNew);
649  basegfx::B2DPolyPolygon GetPolygon() const noexcept;
650 };
651 
652 /***********************************************************************
653 * *
654 ***********************************************************************/
655 
656 class SvxGraphicObject final : public SvxShapeText
657 {
660 
661  // override these for special property handling in subcasses. Return true if property is handled
662  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
663  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
664 
665 public:
667  virtual ~SvxGraphicObject() noexcept override;
668 };
669 
670 /***********************************************************************
671 * *
672 ***********************************************************************/
673 class SAL_DLLPUBLIC_RTTI Svx3DSceneObject final : public SvxShapeGroupAnyD
674 {
675 private:
677 
678 protected:
681 
682 public:
684  // override these for special property handling in subcasses. Return true if property is handled
685  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
686  virtual bool getPropertyValueImpl(const OUString& rName, const SfxItemPropertyMapEntry* pProperty,
687  css::uno::Any& rValue ) override;
688 
689  virtual ~Svx3DSceneObject() noexcept override;
690 
691  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
692 
693  // XInterface
694  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
695  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
696  virtual void SAL_CALL acquire() noexcept override
697  { SvxShape::acquire(); }
698  virtual void SAL_CALL release() noexcept override
699  { SvxShape::release(); }
700 
701  // XShapes
702  virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
703  virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
704 
705  // XElementAccess
706  virtual css::uno::Type SAL_CALL getElementType( ) override;
707  virtual sal_Bool SAL_CALL hasElements( ) override;
708 
709  // XIndexAccess
710  virtual sal_Int32 SAL_CALL getCount( ) override ;
711  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
712 
713  // XServiceInfo
714  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
715 
716  // XTypeProvider
717  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
718 
719  virtual void addShape(SvxShape& rShape) override final;
720 };
721 
722 /***********************************************************************
723 * *
724 ***********************************************************************/
725 class Svx3DCubeObject final : public SvxShape
726 {
727  // override these for special property handling in subcasses. Return true if property is handled
728  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
729  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
730 
731 public:
732  Svx3DCubeObject(SdrObject* pObj);
733  virtual ~Svx3DCubeObject() noexcept override;
734 
735  // XServiceInfo
736  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
737 };
738 
739 /***********************************************************************
740 * *
741 ***********************************************************************/
742 class Svx3DSphereObject final : public SvxShape
743 {
744 public:
746 private:
747  // override these for special property handling in subcasses. Return true if property is handled
748  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
749  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
750 
751  virtual ~Svx3DSphereObject() noexcept override;
752 
753  // XServiceInfo
754  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
755 };
756 
757 /***********************************************************************
758 * *
759 ***********************************************************************/
760 class Svx3DLatheObject final : public SvxShape
761 {
762  // override these for special property handling in subcasses. Return true if property is handled
763  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
764  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
765 
766 public:
768  virtual ~Svx3DLatheObject() noexcept override;
769 
770  // XServiceInfo
771  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
772 };
773 
774 /***********************************************************************
775 * *
776 ***********************************************************************/
777 class Svx3DExtrudeObject final : public SvxShape
778 {
779 public:
781 private:
782  // override these for special property handling in subcasses. Return true if property is handled
783  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
784  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
785 
786  virtual ~Svx3DExtrudeObject() noexcept override;
787 
788  // XServiceInfo
789  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
790 };
791 
792 /***********************************************************************
793 * *
794 ***********************************************************************/
795 class Svx3DPolygonObject final : public SvxShape
796 {
797  // override these for special property handling in subcasses. Return true if property is handled
798  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
799  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
800 
801 public:
803  virtual ~Svx3DPolygonObject() noexcept override;
804 
805  // XServiceInfo
806  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
807 };
808 
809 /***********************************************************************
810 * *
811 ***********************************************************************/
812 class SVXCORE_DLLPUBLIC SvxCustomShape final : public SvxShapeText, public css::drawing::XEnhancedCustomShapeDefaulter
813 {
814 protected:
817 
818 public:
819  SvxCustomShape(SdrObject* pObj);
820  // override these for special property handling in subcasses. Return true if property is handled
821  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
822 
823 
824  virtual ~SvxCustomShape() noexcept override;
825 
826  // XInterface
827  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
828  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
829  virtual void SAL_CALL acquire() noexcept override
830  { SvxShapeText::acquire(); }
831  virtual void SAL_CALL release() noexcept override
832  { SvxShapeText::release(); }
833 
834  // XShape
835  virtual css::awt::Point SAL_CALL getPosition() override;
836 
837  // XPropertySet
838  void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
839 
840  // XTypeProvider
841  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
842 
843  //XEnhancedCustomShapeDefaulter
844  virtual void SAL_CALL createCustomShapeDefaults( const OUString& rShapeType ) override;
845 };
846 
847 /***********************************************************************
848 * *
849 ***********************************************************************/
850 
851 class SvxMediaShape final : public SvxShape
852 {
853 public:
854  SvxMediaShape(SdrObject* pObj, OUString const & referer);
855  virtual ~SvxMediaShape() noexcept override;
856 
857 private:
858  // override these for special property handling in subcasses. Return true if property is handled
859  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
860  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
861 
862  OUString referer_;
863 };
864 
865 #endif
866 
867 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:508
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:3858
Type
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3821
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshape.cxx:3959
SvxItemPropertySetUsrAnys maUrsAnys
Definition: unoshape.hxx:123
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoshape.cxx:3033
css::awt::Point maPosition
Definition: unoshape.hxx:107
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:425
signed char sal_Int8
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshape.cxx:961
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
std::unique_ptr< SvxShapeImpl > mpImpl
these members are used to optimize XMultiProperty calls
Definition: unoshape.hxx:112
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unoshape.cxx:3063
#define UNO3_GETIMPLEMENTATION_DECL(classname)
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshape.cxx:1542
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:375
EmbeddedObjectRef * pObject
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshape.cxx:1152
rtl::Reference< SvxDrawPage > mxPage
Definition: unoshape.hxx:676
void ForceMetricToItemPoolMetric(Point &rPoint) const noexcept
Definition: unoshape.hxx:132
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:698
css::uno::WeakReference< css::container::XIndexContainer > mxGluePoints
Definition: unoshape.hxx:115
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
SdrObjKind
Definition: svdobjkind.hxx:24
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
css::uno::Any SVXCORE_DLLPUBLIC SvxItemPropertySet_getPropertyValue(const SfxItemPropertyMapEntry *pMap, const SfxItemSet &rSet)
Definition: unoshape.cxx:4024
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:547
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString maShapeType
Definition: unoshape.hxx:108
bool HasSdrObject() const
Definition: unoshape.hxx:205
void SetShapeType(const OUString &ShapeType)
Definition: unoshape.hxx:207
void ForceMetricTo100th_mm(Point &rPoint) const noexcept
Definition: unoshape.hxx:135
virtual bool queryAggregation(const css::uno::Type &rType, css::uno::Any &aAny) override
const SfxItemPropertyMapEntry * maPropMapEntries
Definition: unoshape.hxx:124
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshape.cxx:1122
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
class SAL_NO_VTABLE XPropertySet
Definition: xmlexchg.hxx:28
void SVXCORE_DLLPUBLIC SvxItemPropertySet_setPropertyValue(const SfxItemPropertyMapEntry *pMap, const css::uno::Any &rVal, SfxItemSet &rSet)
rtl::Reference< SvxDrawPage > mxPage
Definition: unoshape.hxx:439
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshape.cxx:1168
unsigned char sal_Bool
OUString maShapeName
Definition: unoshape.hxx:109
bool mbIsMultiPropertyCall
Definition: unoshape.hxx:113
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:455
Abstract DrawObject.
Definition: svdobj.hxx:259
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
This only exists so I have a common base class for SvxShapeGroup and Svx3DSceneObject.
Definition: unoshape.hxx:416
::cppu::WeakAggImplHelper12< css::drawing::XShape, css::lang::XComponent, css::beans::XPropertySet, css::beans::XMultiPropertySet, css::beans::XPropertyState, css::lang::XUnoTunnel, css::container::XNamed, css::drawing::XGluePointsSupplier, css::container::XChild, css::lang::XServiceInfo, css::document::XActionLockable, css::beans::XMultiPropertyStates > SvxShape_UnoImplHelper
Definition: unoshape.hxx:98
css::awt::Size maSize
Definition: unoshape.hxx:106
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
bool is() const
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:506
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unoshape.cxx:1952
const SfxItemPropertyMapEntry * getPropertyMapEntries() const
Definition: unoshape.hxx:159
virtual void addShape(SvxShape &rShape)=0
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:408
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshape.cxx:3936
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshape.cxx:3827
const SvxItemPropertySet * mpPropSet
Definition: unoshape.hxx:122
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshape.cxx:1099
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:423
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:406
reference_type * get() const
::tools::WeakReference< SdrObject > mpSdrObjectWeakReference
Definition: unoshape.hxx:127
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:831
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
virtual void dispose() override
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:549
OUString referer_
Definition: unoshape.hxx:862
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
void ForceMetricTo100th_mm(Size &rPoint) const noexcept
Definition: unoshape.hxx:136
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:829
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
this abstract class is the interface for an instance that likes to enhance the functionality of compo...
Definition: unomaster.hxx:33
virtual OUString SAL_CALL getShapeType() override
Definition: unoshape.cxx:1241
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
OUString getString(const Any &_rAny)
helper class for notifying XPropertyChangeListeners
void ForceMetricToItemPoolMetric(Size &rPoint) const noexcept
Definition: unoshape.hxx:133
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
sal_uInt16 mnLockCount
used from the XActionLockable interface
Definition: unoshape.hxx:157
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoshape.cxx:1681
#define SVX_DLLPRIVATE
Definition: svxdllapi.h:30
struct _ADOIndex Index
std::shared_ptr< osl::Mutex > const & lock()
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoshape.cxx:3873
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:373