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 
129 
130 private:
132 
133 protected:
134  // translations for writer, which works in TWIPS
135  void ForceMetricToItemPoolMetric(Pair& rPoint) const noexcept;
136  void ForceMetricToItemPoolMetric(Point& rPoint) const noexcept { ForceMetricToItemPoolMetric(rPoint.toPair()); }
137  void ForceMetricToItemPoolMetric(Size& rPoint) const noexcept { ForceMetricToItemPoolMetric(rPoint.toPair()); }
138  void ForceMetricTo100th_mm(Pair& rPoint) const noexcept;
139  void ForceMetricTo100th_mm(Point& rPoint) const noexcept { ForceMetricTo100th_mm(rPoint.toPair()); }
140  void ForceMetricTo100th_mm(Size& rPoint) const noexcept { ForceMetricTo100th_mm(rPoint.toPair()); }
141 
142  // version for basegfx::B2DPolyPolygon
143  void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const noexcept;
144  void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const noexcept;
145 
146  // tdf#117145 version for basegfx::B2DHomMatrix
147  void ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix& rB2DHomMatrix) const noexcept;
148  void ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rB2DHomMatrix) const noexcept;
149 
150  css::uno::Any GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertyMapEntry* pMap ) const;
151 
152  bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName );
153 
155  virtual void lock();
156 
158  virtual void unlock();
159 
161  sal_uInt16 mnLockCount;
162 
163  const SfxItemPropertyMapEntry* getPropertyMapEntries() const { return maPropMapEntries; }
164 
165  void updateShapeKind();
166  void endSetPropertyValues();
167 
168  // override these for special property handling in subcasses. Return true if property is handled
174  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue );
178  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue );
181  virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState );
184  virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry* pProperty );
185 
186 public:
188  SvxShape( SdrObject* pObj );
190  SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries, const SvxItemPropertySet* pPropertySet );
191  virtual ~SvxShape() noexcept override;
192 
193  // Internals
194  void ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet);
195  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage );
201  void TakeSdrObjectOwnership();
202  bool HasSdrObjectOwnership() const;
203 
204  // used exclusively by SdrObject
205  void InvalidateSdrObject();
206 
207  // Encapsulated access to SdrObject
208  SdrObject* GetSdrObject() const { return mpSdrObjectWeakReference.get(); }
209  bool HasSdrObject() const { return mpSdrObjectWeakReference.is(); }
210 
211  void SetShapeType( const OUString& ShapeType ) { maShapeType = ShapeType; }
213  css::uno::Any GetBitmap( bool bMetaFile = false ) const;
214 
215  svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
216 
217  void setShapeKind( sal_uInt32 nKind );
218  sal_uInt32 getShapeKind() const;
219 
220  // styles need this
221  static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel );
222  static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet );
223 
230 
231  // access methods for master objects
233  css::uno::Reference< css::beans::XPropertySetInfo > const & _getPropertySetInfo( );
239  void _setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue );
243  css::uno::Any _getPropertyValue( const OUString& PropertyName );
244 
247  css::beans::PropertyState _getPropertyState( const OUString& PropertyName );
250  void _setPropertyToDefault( const OUString& PropertyName );
254  css::uno::Any _getPropertyDefault( const OUString& aPropertyName );
255 
257  css::uno::Sequence< OUString > _getSupportedServiceNames();
258 
260  css::uno::Sequence< css::uno::Type > const & _getTypes( );
261 
262  void setMaster( SvxShapeMaster* pMaster );
263 
264  // SfxListener
265  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) noexcept override;
266 
267  // XAggregation
268  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override;
269 
270  // XNamed
271  virtual OUString SAL_CALL getName( ) override;
272  virtual void SAL_CALL setName( const OUString& aName ) override;
273 
274  // XShapeDescriptor
275  virtual OUString SAL_CALL getShapeType() override;
276 
277  // XShape
278  virtual css::awt::Point SAL_CALL getPosition() override;
279  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
280  virtual css::awt::Size SAL_CALL getSize() override;
281  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
282 
283  // XComponent
284  virtual void SAL_CALL dispose() override;
285  virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
286  virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
287 
288  // XPropertySet
289  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
290  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
291  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
292  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
293  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
294  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
295  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
296 
297  // XMultiPropertySet
298  virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
299  virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
300  virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
301  virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
302  virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
303 
304  // XPropertyState
305  virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
306  virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
307  virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
308  virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
309 
310  // XMultiPropertyStates
311  virtual void SAL_CALL setAllPropertiesToDefault() override;
312  virtual void SAL_CALL setPropertiesToDefault(
313  const css::uno::Sequence<
314  OUString >& aPropertyNames ) override;
315  virtual css::uno::Sequence< css::uno::Any >
316  SAL_CALL getPropertyDefaults(
317  const css::uno::Sequence<
318  OUString >& aPropertyNames ) override;
319 
320  // XServiceInfo
321  virtual OUString SAL_CALL getImplementationName() override;
322  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
323  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
324 
325  // XGluePointsSupplier
326  virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL getGluePoints( ) override;
327 
328  // XChild
329  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
330  virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
331 
332  // XTypeProvider
333  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
334  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
335 
336  // XActionLockable
337  virtual sal_Bool SAL_CALL isActionLocked( ) override;
338  virtual void SAL_CALL addActionLock( ) override;
339  virtual void SAL_CALL removeActionLock( ) override;
340  virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) override;
341  virtual sal_Int16 SAL_CALL resetActionLocks( ) override;
342 
343 private:
346  SVX_DLLPRIVATE void impl_initFromSdrObject();
348  SVX_DLLPRIVATE void impl_construct();
349 };
350 
352 {
353 protected:
355  virtual void lock() override;
356 
358  virtual void unlock() override;
359 
360 protected:
361  // override these for special property handling in subcasses. Return true if property is handled
362  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
363  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
364  virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState ) override;
365  virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry* pProperty ) override;
366 
367 public:
368  SvxShapeText(SdrObject* pObj);
369  SvxShapeText(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
370  virtual ~SvxShapeText() noexcept override;
371 
372  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
373 
374  // XInterface
375  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
376  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
377  virtual void SAL_CALL acquire() noexcept override
378  { SvxShape::acquire(); }
379  virtual void SAL_CALL release() noexcept override
380  { SvxShape::release(); }
381 
382  // XServiceInfo
383  virtual OUString SAL_CALL getImplementationName() override;
384  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
385  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
386 
387  // css::text::XTextRange
388  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
389  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
390  virtual OUString SAL_CALL getString() override;
391  virtual void SAL_CALL setString( const OUString& aString ) override;
392 
393  // XUnoTunnel
394  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
395 
396  // XTypeProvider
397  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
398  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
399 };
400 
401 class SvxShapeRect final : public SvxShapeText
402 {
403 public:
404  SvxShapeRect(SdrObject* pObj);
405  virtual ~SvxShapeRect() noexcept override;
406 
407  // XInterface
408  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
409  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
410  virtual void SAL_CALL acquire() noexcept override
411  { OWeakAggObject::acquire(); }
412  virtual void SAL_CALL release() noexcept override
413  { OWeakAggObject::release(); }
414 
415  // XServiceInfo
416  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
417 };
418 
419 /***********************************************************************
420 * *
421 ***********************************************************************/
422 class SvxShapeGroup final : public SvxShape,
423  public css::drawing::XShapeGroup,
424  public css::drawing::XShapes2,
425  public css::drawing::XShapes
426 {
427 private:
429 
430  void addUnoShape( const css::uno::Reference< css::drawing::XShape >& xShape, size_t nPos );
431 
432 public:
433  SvxShapeGroup(SdrObject* pObj,SvxDrawPage* pDrawPage);
434  virtual ~SvxShapeGroup() noexcept override;
435 
436  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
437 
438  // XInterface
439  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
440  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
441  virtual void SAL_CALL acquire() noexcept override
442  { SvxShape::acquire(); }
443  virtual void SAL_CALL release() noexcept override
444  { SvxShape::release(); }
445 
446  // XShapes
447  virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
448  virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
449 
450  // XShapes2
451  virtual void SAL_CALL addTop( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
452  virtual void SAL_CALL addBottom( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
453 
454  // XElementAccess
455  virtual css::uno::Type SAL_CALL getElementType() override;
456  virtual sal_Bool SAL_CALL hasElements() override;
457 
458  // XIndexAccess
459  virtual sal_Int32 SAL_CALL getCount() override ;
460  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
461 
462  // XShapeDescriptor
463  virtual OUString SAL_CALL getShapeType() override;
464 
465  // XShape
466  virtual css::awt::Point SAL_CALL getPosition() override;
467  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
468  virtual css::awt::Size SAL_CALL getSize() override;
469  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
470 
471  // XShapeGroup
472  virtual void SAL_CALL enterGroup( ) override;
473  virtual void SAL_CALL leaveGroup( ) override;
474 
475  // XTypeProvider
476  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
477 };
478 
479 /***********************************************************************
480 * *
481 ***********************************************************************/
482 class SvxShapeConnector final : public css::drawing::XConnectorShape,
483  public SvxShapeText
484 {
485 public:
487  virtual ~SvxShapeConnector() noexcept override;
488 
489  // XInterface
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(); }
496 
497  // XShapeDescriptor
498  virtual OUString SAL_CALL getShapeType() override;
499 
500  // XShape
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;
505 
506  // XConnectorShape
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;
511 
512  // XTypeProvider
513  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
514  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
515 };
516 
517 /***********************************************************************
518 * *
519 ***********************************************************************/
520 class SVXCORE_DLLPUBLIC SvxShapeControl final : public css::drawing::XControlShape, public SvxShapeText
521 {
522 protected:
525 
526 public:
527  SvxShapeControl(SdrObject* pObj);
528  virtual ~SvxShapeControl() noexcept override;
529 
530  // XInterface
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(); }
537 
538  // XPropertySet
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;
541 
542  // XPropertyState
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;
546 
547  // XShapeDescriptor
548  virtual OUString SAL_CALL getShapeType() override;
549 
550  // XShape
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;
555 
556  // XControlShape
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;
559 
560  // XTypeProvider
561  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
562  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
563 };
564 
565 /***********************************************************************
566 * *
567 ***********************************************************************/
568 class SvxShapeDimensioning final : public SvxShapeText
569 {
570 public:
572  virtual ~SvxShapeDimensioning() noexcept override;
573 };
574 
575 /***********************************************************************
576 * *
577 ***********************************************************************/
578 class SvxShapeCircle final : public SvxShapeText
579 {
580 public:
581  SvxShapeCircle(SdrObject* pObj);
582  virtual ~SvxShapeCircle() noexcept override;
583 };
584 
585 /***********************************************************************
586 * *
587 ***********************************************************************/
588 
589 // #i118485# changed parent to SvxShapeText to allow Text handling over UNO API
591 {
592 protected:
593  // override these for special property handling in subcasses. Return true if property is handled
594  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
595  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
596 
597  void resetModifiedState();
598 
599  SvGlobalName GetClassName_Impl(OUString& rHexCLSID);
600 public:
601  SvxOle2Shape(SdrObject* pObj);
602  SvxOle2Shape(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
603  virtual ~SvxOle2Shape() noexcept override;
604 
605  bool createObject( const SvGlobalName &aClassName );
606 
607  void createLink( const OUString& aLinkURL );
608 };
609 
610 
611 /***********************************************************************
612 * *
613 ***********************************************************************/
614 class SvxShapePolyPolygon final : public SvxShapeText
615 {
618 
619  // override these for special property handling in subcasses. Return true if property is handled
620  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
621  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
622 
623  // local helper to detect PolygonKind from SdrObject::GetObjIdentifier()
624  css::drawing::PolygonKind GetPolygonKind() const;
625 
626 public:
630  virtual ~SvxShapePolyPolygon() noexcept override;
631 
632  // Local support functions
634  void SetPolygon(const basegfx::B2DPolyPolygon& rNew);
635  basegfx::B2DPolyPolygon GetPolygon() const noexcept;
636 };
637 
638 /***********************************************************************
639 * *
640 ***********************************************************************/
641 
642 class SvxGraphicObject final : public SvxShapeText
643 {
646 
647  // override these for special property handling in subcasses. Return true if property is handled
648  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
649  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
650 
651 public:
653  virtual ~SvxGraphicObject() noexcept override;
654 };
655 
656 /***********************************************************************
657 * *
658 ***********************************************************************/
659 class Svx3DSceneObject final : public css::drawing::XShapes, public SvxShape
660 {
661 private:
663 
664 protected:
667 
668 public:
669  Svx3DSceneObject(SdrObject* pObj, SvxDrawPage* pDrawPage);
670  // override these for special property handling in subcasses. Return true if property is handled
671  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
672  virtual bool getPropertyValueImpl(const OUString& rName, const SfxItemPropertyMapEntry* pProperty,
673  css::uno::Any& rValue ) override;
674 
675  virtual ~Svx3DSceneObject() noexcept override;
676 
677  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
678 
679  // XInterface
680  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
681  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
682  virtual void SAL_CALL acquire() noexcept override
683  { SvxShape::acquire(); }
684  virtual void SAL_CALL release() noexcept override
685  { SvxShape::release(); }
686 
687  // XShapes
688  virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
689  virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
690 
691  // XElementAccess
692  virtual css::uno::Type SAL_CALL getElementType( ) override;
693  virtual sal_Bool SAL_CALL hasElements( ) override;
694 
695  // XIndexAccess
696  virtual sal_Int32 SAL_CALL getCount( ) override ;
697  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
698 
699  // XServiceInfo
700  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
701 
702  // XTypeProvider
703  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
704 };
705 
706 /***********************************************************************
707 * *
708 ***********************************************************************/
709 class Svx3DCubeObject final : public SvxShape
710 {
711  // override these for special property handling in subcasses. Return true if property is handled
712  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
713  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
714 
715 public:
716  Svx3DCubeObject(SdrObject* pObj);
717  virtual ~Svx3DCubeObject() noexcept override;
718 
719  // XServiceInfo
720  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
721 };
722 
723 /***********************************************************************
724 * *
725 ***********************************************************************/
726 class Svx3DSphereObject final : public SvxShape
727 {
728 public:
730 private:
731  // override these for special property handling in subcasses. Return true if property is handled
732  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
733  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
734 
735  virtual ~Svx3DSphereObject() noexcept override;
736 
737  // XServiceInfo
738  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
739 };
740 
741 /***********************************************************************
742 * *
743 ***********************************************************************/
744 class Svx3DLatheObject final : public SvxShape
745 {
746  // override these for special property handling in subcasses. Return true if property is handled
747  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
748  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
749 
750 public:
752  virtual ~Svx3DLatheObject() noexcept override;
753 
754  // XServiceInfo
755  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
756 };
757 
758 /***********************************************************************
759 * *
760 ***********************************************************************/
761 class Svx3DExtrudeObject final : public SvxShape
762 {
763 public:
765 private:
766  // override these for special property handling in subcasses. Return true if property is handled
767  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
768  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
769 
770  virtual ~Svx3DExtrudeObject() noexcept override;
771 
772  // XServiceInfo
773  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
774 };
775 
776 /***********************************************************************
777 * *
778 ***********************************************************************/
779 class Svx3DPolygonObject final : public SvxShape
780 {
781  // override these for special property handling in subcasses. Return true if property is handled
782  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
783  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
784 
785 public:
787  virtual ~Svx3DPolygonObject() noexcept override;
788 
789  // XServiceInfo
790  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
791 };
792 
793 /***********************************************************************
794 * *
795 ***********************************************************************/
796 class SVXCORE_DLLPUBLIC SvxCustomShape final : public SvxShapeText, public css::drawing::XEnhancedCustomShapeDefaulter
797 {
798 protected:
801 
802 public:
803  SvxCustomShape(SdrObject* pObj);
804  // override these for special property handling in subcasses. Return true if property is handled
805  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
806 
807 
808  virtual ~SvxCustomShape() noexcept override;
809 
810  // XInterface
811  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
812  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
813  virtual void SAL_CALL acquire() noexcept override
814  { SvxShapeText::acquire(); }
815  virtual void SAL_CALL release() noexcept override
816  { SvxShapeText::release(); }
817 
818  // XShape
819  virtual css::awt::Point SAL_CALL getPosition() override;
820 
821  // XPropertySet
822  void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
823 
824  // XTypeProvider
825  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
826 
827  //XEnhancedCustomShapeDefaulter
828  virtual void SAL_CALL createCustomShapeDefaults( const OUString& rShapeType ) override;
829 };
830 
831 /***********************************************************************
832 * *
833 ***********************************************************************/
834 
835 class SvxMediaShape final : public SvxShape
836 {
837 public:
838  SvxMediaShape(SdrObject* pObj, OUString const & referer);
839  virtual ~SvxMediaShape() noexcept override;
840 
841 private:
842  // override these for special property handling in subcasses. Return true if property is handled
843  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
844  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
845 
846  OUString referer_;
847 };
848 
849 #endif
850 
851 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:494
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoshape.cxx:3830
Type
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoshape.cxx:3793
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
Definition: unoshape.cxx:3931
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoshape.cxx:3007
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:3037
#define UNO3_GETIMPLEMENTATION_DECL(classname)
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshape.cxx:1562
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:379
EmbeddedObjectRef * pObject
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoshape.cxx:1172
rtl::Reference< SvxDrawPage > mxPage
Definition: unoshape.hxx:662
void ForceMetricToItemPoolMetric(Point &rPoint) const noexcept
Definition: unoshape.hxx:136
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:684
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 const & rValue
css::uno::Any SVXCORE_DLLPUBLIC SvxItemPropertySet_getPropertyValue(const SfxItemPropertyMapEntry *pMap, const SfxItemSet &rSet)
Definition: unoshape.cxx:4003
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:533
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:209
void SetShapeType(const OUString &ShapeType)
Definition: unoshape.hxx:211
void ForceMetricTo100th_mm(Point &rPoint) const noexcept
Definition: unoshape.hxx:139
virtual bool queryAggregation(const css::uno::Type &rType, css::uno::Any &aAny) override
const SfxItemPropertyMapEntry * maPropMapEntries
Definition: unoshape.hxx:128
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoshape.cxx:1142
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:428
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoshape.cxx:1188
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:443
Abstract DrawObject.
Definition: svdobj.hxx:258
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:492
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:1966
const SfxItemPropertyMapEntry * getPropertyMapEntries() const
Definition: unoshape.hxx:163
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:412
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
Definition: unoshape.cxx:3908
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
Definition: unoshape.cxx:3799
const SvxItemPropertySet * mpPropSet
Definition: unoshape.hxx:127
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoshape.cxx:1119
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:410
reference_type * get() const
::tools::WeakReference< SdrObject > mpSdrObjectWeakReference
Definition: unoshape.hxx:131
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:815
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
virtual void dispose() override
virtual void SAL_CALL release() noexcept override
Definition: unoshape.hxx:535
OUString referer_
Definition: unoshape.hxx:846
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
void ForceMetricTo100th_mm(Size &rPoint) const noexcept
Definition: unoshape.hxx:140
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:813
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:1261
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:137
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
sal_uInt16 mnLockCount
used from the XActionLockable interface
Definition: unoshape.hxx:161
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoshape.cxx:1705
#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:3845
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
virtual void SAL_CALL acquire() noexcept override
Definition: unoshape.hxx:377