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