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 <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>
54 
55 #include <svx/svdobj.hxx>
56 
58 
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 
74 {
75 protected:
76  ::osl::Mutex maMutex;
77 };
78 
79 struct SvxShapeImpl;
80 class SvxShapeMaster;
81 class SvxItemPropertySet;
82 class SfxItemSet;
83 
85  const css::uno::Any& rVal, SfxItemSet& rSet );
86 
88 
89 
90 // WARNING: if you update the supported interfaces,
91 // also update SvxShape::_getTypes()
92 typedef ::cppu::WeakAggImplHelper12<
93  css::drawing::XShape,
94  css::lang::XComponent,
96  css::beans::XMultiPropertySet,
97  css::beans::XPropertyState,
98  css::lang::XUnoTunnel,
99  css::container::XNamed,
100  css::drawing::XGluePointsSupplier,
101  css::container::XChild,
102  css::lang::XServiceInfo,
103  css::document::XActionLockable,
104  css::beans::XMultiPropertyStates> SvxShape_UnoImplHelper;
105 
107  public SfxListener,
108  public SvxShapeMutex
109 {
110 private:
111  css::awt::Size maSize;
112  css::awt::Point maPosition;
113  OUString maShapeType;
114  OUString maShapeName;
115 
117  std::unique_ptr<SvxShapeImpl> mpImpl;
119 
120  css::uno::WeakReference< css::container::XIndexContainer > mxGluePoints;
121 
122 protected:
123  friend class SvxDrawPage;
124  friend class SvxShapeConnector;
125  friend class SdXShape;
126 
130 
131 private:
133 
134 protected:
135  // translations for writer, which works in TWIPS
136  void ForceMetricToItemPoolMetric(Pair& rPoint) const noexcept;
137  void ForceMetricToItemPoolMetric(Point& rPoint) const noexcept { ForceMetricToItemPoolMetric(rPoint.toPair()); }
138  void ForceMetricToItemPoolMetric(Size& rPoint) const noexcept { ForceMetricToItemPoolMetric(rPoint.toPair()); }
139  void ForceMetricTo100th_mm(Pair& rPoint) const noexcept;
140  void ForceMetricTo100th_mm(Point& rPoint) const noexcept { ForceMetricTo100th_mm(rPoint.toPair()); }
141  void ForceMetricTo100th_mm(Size& rPoint) const noexcept { ForceMetricTo100th_mm(rPoint.toPair()); }
142 
143  // version for basegfx::B2DPolyPolygon
144  void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const noexcept;
145  void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const noexcept;
146 
147  // tdf#117145 version for basegfx::B2DHomMatrix
148  void ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix& rB2DHomMatrix) const noexcept;
149  void ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rB2DHomMatrix) const noexcept;
150 
151  css::uno::Any GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertyMapEntry* pMap ) const;
152 
153  bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName );
154 
156  virtual void lock();
157 
159  virtual void unlock();
160 
162  sal_uInt16 mnLockCount;
163 
164  const SfxItemPropertyMapEntry* getPropertyMapEntries() const { return maPropMapEntries; }
165 
166  void updateShapeKind();
167  void endSetPropertyValues();
168 
169  // override these for special property handling in subcasses. Return true if property is handled
175  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue );
179  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue );
182  virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState );
185  virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry* pProperty );
186 
187 public:
189  SvxShape( SdrObject* pObj );
191  SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries, const SvxItemPropertySet* pPropertySet );
192  virtual ~SvxShape() noexcept override;
193 
194  // Internals
195  void ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet);
196  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage );
202  void TakeSdrObjectOwnership();
203  bool HasSdrObjectOwnership() const;
204 
205  // used exclusively by SdrObject
206  void InvalidateSdrObject();
207 
208  // Encapsulated access to SdrObject
209  SdrObject* GetSdrObject() const { return mpSdrObjectWeakReference.get(); }
210  bool HasSdrObject() const { return mpSdrObjectWeakReference.is(); }
211 
212  void SetShapeType( const OUString& ShapeType ) { maShapeType = ShapeType; }
214  css::uno::Any GetBitmap( bool bMetaFile = false ) const;
215 
216  svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
217 
218  void setShapeKind( sal_uInt32 nKind );
219  sal_uInt32 getShapeKind() const;
220 
221  // styles need this
222  static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel );
223  static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet );
224 
231 
232  // access methods for master objects
234  css::uno::Reference< css::beans::XPropertySetInfo > const & _getPropertySetInfo( );
240  void _setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue );
244  css::uno::Any _getPropertyValue( const OUString& PropertyName );
245 
248  css::beans::PropertyState _getPropertyState( const OUString& PropertyName );
251  void _setPropertyToDefault( const OUString& PropertyName );
255  css::uno::Any _getPropertyDefault( const OUString& aPropertyName );
256 
258  css::uno::Sequence< OUString > _getSupportedServiceNames();
259 
261  css::uno::Sequence< css::uno::Type > const & _getTypes( );
262 
263  void setMaster( SvxShapeMaster* pMaster );
264 
265  // SfxListener
266  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) noexcept override;
267 
268  // XAggregation
269  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override;
270 
271  // XNamed
272  virtual OUString SAL_CALL getName( ) override;
273  virtual void SAL_CALL setName( const OUString& aName ) override;
274 
275  // XShapeDescriptor
276  virtual OUString SAL_CALL getShapeType() override;
277 
278  // XShape
279  virtual css::awt::Point SAL_CALL getPosition() override;
280  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
281  virtual css::awt::Size SAL_CALL getSize() override;
282  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
283 
284  // XComponent
285  virtual void SAL_CALL dispose() override;
286  virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
287  virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
288 
289  // XPropertySet
290  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
291  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
292  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
293  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
294  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
295  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
296  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
297 
298  // XMultiPropertySet
299  virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
300  virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
301  virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
302  virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
303  virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
304 
305  // XPropertyState
306  virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
307  virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
308  virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
309  virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
310 
311  // XMultiPropertyStates
312  virtual void SAL_CALL setAllPropertiesToDefault() override;
313  virtual void SAL_CALL setPropertiesToDefault(
314  const css::uno::Sequence<
315  OUString >& aPropertyNames ) override;
316  virtual css::uno::Sequence< css::uno::Any >
317  SAL_CALL getPropertyDefaults(
318  const css::uno::Sequence<
319  OUString >& aPropertyNames ) override;
320 
321  // XServiceInfo
322  virtual OUString SAL_CALL getImplementationName() override;
323  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
324  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
325 
326  // XGluePointsSupplier
327  virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL getGluePoints( ) override;
328 
329  // XChild
330  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
331  virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
332 
333  // XTypeProvider
334  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
335  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
336 
337  // XActionLockable
338  virtual sal_Bool SAL_CALL isActionLocked( ) override;
339  virtual void SAL_CALL addActionLock( ) override;
340  virtual void SAL_CALL removeActionLock( ) override;
341  virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) override;
342  virtual sal_Int16 SAL_CALL resetActionLocks( ) override;
343 
344 private:
347  SVX_DLLPRIVATE void impl_initFromSdrObject();
349  SVX_DLLPRIVATE void impl_construct();
350 };
351 
353 {
354 protected:
356  virtual void lock() override;
357 
359  virtual void unlock() override;
360 
361 protected:
362  // override these for special property handling in subcasses. Return true if property is handled
363  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
364  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
365  virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState ) override;
366  virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry* pProperty ) override;
367 
368 public:
369  SvxShapeText(SdrObject* pObj);
370  SvxShapeText(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
371  virtual ~SvxShapeText() noexcept override;
372 
373  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
374 
375  // XInterface
376  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
377  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
378  virtual void SAL_CALL acquire() noexcept override
379  { SvxShape::acquire(); }
380  virtual void SAL_CALL release() noexcept override
381  { SvxShape::release(); }
382 
383  // XServiceInfo
384  virtual OUString SAL_CALL getImplementationName() override;
385  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
386  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
387 
388  // css::text::XTextRange
389  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
390  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
391  virtual OUString SAL_CALL getString() override;
392  virtual void SAL_CALL setString( const OUString& aString ) override;
393 
394  // XUnoTunnel
395  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
396 
397  // XTypeProvider
398  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
399  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
400 };
401 
402 class SvxShapeRect final : public SvxShapeText
403 {
404 public:
405  SvxShapeRect(SdrObject* pObj);
406  virtual ~SvxShapeRect() noexcept override;
407 
408  // XInterface
409  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
410  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
411  virtual void SAL_CALL acquire() noexcept override
412  { OWeakAggObject::acquire(); }
413  virtual void SAL_CALL release() noexcept override
414  { OWeakAggObject::release(); }
415 
416  // XServiceInfo
417  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
418 };
419 
420 /***********************************************************************
421 * *
422 ***********************************************************************/
423 class SvxShapeGroup final : public SvxShape,
424  public css::drawing::XShapeGroup,
425  public css::drawing::XShapes2,
426  public css::drawing::XShapes
427 {
428 private:
430 
431  void addUnoShape( const css::uno::Reference< css::drawing::XShape >& xShape, size_t nPos );
432 
433 public:
434  SvxShapeGroup(SdrObject* pObj,SvxDrawPage* pDrawPage);
435  virtual ~SvxShapeGroup() noexcept override;
436 
437  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
438 
439  // XInterface
440  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
441  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
442  virtual void SAL_CALL acquire() noexcept override
443  { SvxShape::acquire(); }
444  virtual void SAL_CALL release() noexcept override
445  { SvxShape::release(); }
446 
447  // XShapes
448  virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
449  virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
450 
451  // XShapes2
452  virtual void SAL_CALL addTop( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
453  virtual void SAL_CALL addBottom( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
454 
455  // XElementAccess
456  virtual css::uno::Type SAL_CALL getElementType() override;
457  virtual sal_Bool SAL_CALL hasElements() override;
458 
459  // XIndexAccess
460  virtual sal_Int32 SAL_CALL getCount() override ;
461  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
462 
463  // XShapeDescriptor
464  virtual OUString SAL_CALL getShapeType() override;
465 
466  // XShape
467  virtual css::awt::Point SAL_CALL getPosition() override;
468  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
469  virtual css::awt::Size SAL_CALL getSize() override;
470  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
471 
472  // XShapeGroup
473  virtual void SAL_CALL enterGroup( ) override;
474  virtual void SAL_CALL leaveGroup( ) override;
475 
476  // XTypeProvider
477  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
478 };
479 
480 /***********************************************************************
481 * *
482 ***********************************************************************/
483 class SvxShapeConnector final : public css::drawing::XConnectorShape,
484  public SvxShapeText
485 {
486 public:
488  virtual ~SvxShapeConnector() noexcept override;
489 
490  // XInterface
491  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
492  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
493  virtual void SAL_CALL acquire() noexcept override
494  { SvxShapeText::acquire(); }
495  virtual void SAL_CALL release() noexcept override
496  { SvxShapeText::release(); }
497 
498  // XShapeDescriptor
499  virtual OUString SAL_CALL getShapeType() override;
500 
501  // XShape
502  virtual css::awt::Point SAL_CALL getPosition() override;
503  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
504  virtual css::awt::Size SAL_CALL getSize() override;
505  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
506 
507  // XConnectorShape
508  virtual void SAL_CALL connectStart( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override;
509  virtual void SAL_CALL connectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override;
510  virtual void SAL_CALL disconnectBegin( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override;
511  virtual void SAL_CALL disconnectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override;
512 
513  // XTypeProvider
514  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
515  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
516 };
517 
518 /***********************************************************************
519 * *
520 ***********************************************************************/
521 class SVXCORE_DLLPUBLIC SvxShapeControl final : public css::drawing::XControlShape, public SvxShapeText
522 {
523 protected:
526 
527 public:
528  SvxShapeControl(SdrObject* pObj);
529  virtual ~SvxShapeControl() noexcept override;
530 
531  // XInterface
532  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
533  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
534  virtual void SAL_CALL acquire() noexcept override
535  { SvxShapeText::acquire(); }
536  virtual void SAL_CALL release() noexcept override
537  { SvxShapeText::release(); }
538 
539  // XPropertySet
540  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
541  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
542 
543  // XPropertyState
544  virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
545  virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
546  virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
547 
548  // XShapeDescriptor
549  virtual OUString SAL_CALL getShapeType() override;
550 
551  // XShape
552  virtual css::awt::Point SAL_CALL getPosition() override;
553  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
554  virtual css::awt::Size SAL_CALL getSize() override;
555  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
556 
557  // XControlShape
558  virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getControl() override;
559  virtual void SAL_CALL setControl( const css::uno::Reference< css::awt::XControlModel >& xControl ) override;
560 
561  // XTypeProvider
562  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
563  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
564 };
565 
566 /***********************************************************************
567 * *
568 ***********************************************************************/
569 class SvxShapeDimensioning final : public SvxShapeText
570 {
571 public:
573  virtual ~SvxShapeDimensioning() noexcept override;
574 };
575 
576 /***********************************************************************
577 * *
578 ***********************************************************************/
579 class SvxShapeCircle final : public SvxShapeText
580 {
581 public:
582  SvxShapeCircle(SdrObject* pObj);
583  virtual ~SvxShapeCircle() noexcept override;
584 };
585 
586 /***********************************************************************
587 * *
588 ***********************************************************************/
589 
590 // #i118485# changed parent to SvxShapeText to allow Text handling over UNO API
592 {
593 protected:
594  // override these for special property handling in subcasses. Return true if property is handled
595  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
596  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
597 
598  void resetModifiedState();
599 
600  SvGlobalName GetClassName_Impl(OUString& rHexCLSID);
601 public:
602  SvxOle2Shape(SdrObject* pObj);
603  SvxOle2Shape(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
604  virtual ~SvxOle2Shape() noexcept override;
605 
606  bool createObject( const SvGlobalName &aClassName );
607 
608  void createLink( const OUString& aLinkURL );
609 };
610 
611 
612 /***********************************************************************
613 * *
614 ***********************************************************************/
615 class SvxShapePolyPolygon final : public SvxShapeText
616 {
619 
620  // override these for special property handling in subcasses. Return true if property is handled
621  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
622  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
623 
624  // local helper to detect PolygonKind from SdrObject::GetObjIdentifier()
625  css::drawing::PolygonKind GetPolygonKind() const;
626 
627 public:
631  virtual ~SvxShapePolyPolygon() noexcept override;
632 
633  // Local support functions
635  void SetPolygon(const basegfx::B2DPolyPolygon& rNew);
636  basegfx::B2DPolyPolygon GetPolygon() const noexcept;
637 };
638 
639 /***********************************************************************
640 * *
641 ***********************************************************************/
642 
643 class SvxGraphicObject final : public SvxShapeText
644 {
647 
648  // override these for special property handling in subcasses. Return true if property is handled
649  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
650  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
651 
652 public:
654  virtual ~SvxGraphicObject() noexcept override;
655 };
656 
657 /***********************************************************************
658 * *
659 ***********************************************************************/
660 class Svx3DSceneObject final : public css::drawing::XShapes, public SvxShape
661 {
662 private:
664 
665 protected:
668 
669 public:
670  Svx3DSceneObject(SdrObject* pObj, SvxDrawPage* pDrawPage);
671  // override these for special property handling in subcasses. Return true if property is handled
672  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
673  virtual bool getPropertyValueImpl(const OUString& rName, const SfxItemPropertyMapEntry* pProperty,
674  css::uno::Any& rValue ) override;
675 
676  virtual ~Svx3DSceneObject() noexcept override;
677 
678  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
679 
680  // XInterface
681  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
682  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
683  virtual void SAL_CALL acquire() noexcept override
684  { SvxShape::acquire(); }
685  virtual void SAL_CALL release() noexcept override
686  { SvxShape::release(); }
687 
688  // XShapes
689  virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
690  virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
691 
692  // XElementAccess
693  virtual css::uno::Type SAL_CALL getElementType( ) override;
694  virtual sal_Bool SAL_CALL hasElements( ) override;
695 
696  // XIndexAccess
697  virtual sal_Int32 SAL_CALL getCount( ) override ;
698  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
699 
700  // XServiceInfo
701  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
702 
703  // XTypeProvider
704  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
705 };
706 
707 /***********************************************************************
708 * *
709 ***********************************************************************/
710 class Svx3DCubeObject final : public SvxShape
711 {
712  // override these for special property handling in subcasses. Return true if property is handled
713  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
714  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
715 
716 public:
717  Svx3DCubeObject(SdrObject* pObj);
718  virtual ~Svx3DCubeObject() noexcept override;
719 
720  // XServiceInfo
721  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
722 };
723 
724 /***********************************************************************
725 * *
726 ***********************************************************************/
727 class Svx3DSphereObject final : public SvxShape
728 {
729 public:
731 private:
732  // override these for special property handling in subcasses. Return true if property is handled
733  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
734  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
735 
736  virtual ~Svx3DSphereObject() noexcept override;
737 
738  // XServiceInfo
739  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
740 };
741 
742 /***********************************************************************
743 * *
744 ***********************************************************************/
745 class Svx3DLatheObject final : public SvxShape
746 {
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 public:
753  virtual ~Svx3DLatheObject() noexcept override;
754 
755  // XServiceInfo
756  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
757 };
758 
759 /***********************************************************************
760 * *
761 ***********************************************************************/
762 class Svx3DExtrudeObject final : public SvxShape
763 {
764 public:
766 private:
767  // override these for special property handling in subcasses. Return true if property is handled
768  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
769  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
770 
771  virtual ~Svx3DExtrudeObject() noexcept override;
772 
773  // XServiceInfo
774  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
775 };
776 
777 /***********************************************************************
778 * *
779 ***********************************************************************/
780 class Svx3DPolygonObject final : public SvxShape
781 {
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 public:
788  virtual ~Svx3DPolygonObject() noexcept override;
789 
790  // XServiceInfo
791  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
792 };
793 
794 /***********************************************************************
795 * *
796 ***********************************************************************/
797 class SVXCORE_DLLPUBLIC SvxCustomShape final : public SvxShapeText, public css::drawing::XEnhancedCustomShapeDefaulter
798 {
799 protected:
802 
803 public:
804  SvxCustomShape(SdrObject* pObj);
805  // override these for special property handling in subcasses. Return true if property is handled
806  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
807 
808 
809  virtual ~SvxCustomShape() noexcept override;
810 
811  // XInterface
812  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
813  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
814  virtual void SAL_CALL acquire() noexcept override
815  { SvxShapeText::acquire(); }
816  virtual void SAL_CALL release() noexcept override
817  { SvxShapeText::release(); }
818 
819  // XShape
820  virtual css::awt::Point SAL_CALL getPosition() override;
821 
822  // XPropertySet
823  void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
824 
825  // XTypeProvider
826  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
827 
828  //XEnhancedCustomShapeDefaulter
829  virtual void SAL_CALL createCustomShapeDefaults( const OUString& rShapeType ) override;
830 };
831 
832 /***********************************************************************
833 * *
834 ***********************************************************************/
835 
836 class SvxMediaShape final : public SvxShape
837 {
838 public:
839  SvxMediaShape(SdrObject* pObj, OUString const & referer);
840  virtual ~SvxMediaShape() noexcept override;
841 
842 private:
843  // override these for special property handling in subcasses. Return true if property is handled
844  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
845  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
846 
847  OUString referer_;
848 };
849 
850 #endif
851 
852 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:495
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:3849
Type
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3812
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshape.cxx:3950
SvxItemPropertySetUsrAnys maUrsAnys
Definition: unoshape.hxx:128
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoshape.cxx:3026
css::awt::Point maPosition
Definition: unoshape.hxx:112
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
signed char sal_Int8
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
std::unique_ptr< SvxShapeImpl > mpImpl
these members are used to optimize XMultiProperty calls
Definition: unoshape.hxx:117
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unoshape.cxx:3056
#define UNO3_GETIMPLEMENTATION_DECL(classname)
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshape.cxx:1555
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:380
EmbeddedObjectRef * pObject
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshape.cxx:1165
rtl::Reference< SvxDrawPage > mxPage
Definition: unoshape.hxx:663
void ForceMetricToItemPoolMetric(Point &rPoint) const noexcept
Definition: unoshape.hxx:137
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:685
css::uno::WeakReference< css::container::XIndexContainer > mxGluePoints
Definition: unoshape.hxx:120
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
::osl::Mutex maMutex
Definition: unoshape.hxx:76
css::uno::Any SVXCORE_DLLPUBLIC SvxItemPropertySet_getPropertyValue(const SfxItemPropertyMapEntry *pMap, const SfxItemSet &rSet)
Definition: unoshape.cxx:4015
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:534
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:113
bool HasSdrObject() const
Definition: unoshape.hxx:210
void SetShapeType(const OUString &ShapeType)
Definition: unoshape.hxx:212
void ForceMetricTo100th_mm(Point &rPoint) const noexcept
Definition: unoshape.hxx:140
virtual bool queryAggregation(const css::uno::Type &rType, css::uno::Any &aAny) override
const SfxItemPropertyMapEntry * maPropMapEntries
Definition: unoshape.hxx:129
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshape.cxx:1135
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:429
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshape.cxx:1181
unsigned char sal_Bool
OUString maShapeName
Definition: unoshape.hxx:114
bool mbIsMultiPropertyCall
Definition: unoshape.hxx:118
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:444
Abstract DrawObject.
Definition: svdobj.hxx:259
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
::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:104
css::awt::Size maSize
Definition: unoshape.hxx:111
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
bool is() const
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:493
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:1971
const SfxItemPropertyMapEntry * getPropertyMapEntries() const
Definition: unoshape.hxx:164
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:413
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshape.cxx:3927
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshape.cxx:3818
const SvxItemPropertySet * mpPropSet
Definition: unoshape.hxx:127
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshape.cxx:1112
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:411
reference_type * get() const
::tools::WeakReference< SdrObject > mpSdrObjectWeakReference
Definition: unoshape.hxx:132
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:816
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
virtual void dispose() override
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:536
OUString referer_
Definition: unoshape.hxx:847
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
void ForceMetricTo100th_mm(Size &rPoint) const noexcept
Definition: unoshape.hxx:141
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:814
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:1254
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:138
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
sal_uInt16 mnLockCount
used from the XActionLockable interface
Definition: unoshape.hxx:162
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoshape.cxx:1698
#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:3864
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:378