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  virtual void SAL_CALL release() throw() override;
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() throw () 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() throw() override;
411  virtual void SAL_CALL release() throw() override;
412 
413  // XServiceInfo
414  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
415 };
416 
417 /***********************************************************************
418 * *
419 ***********************************************************************/
420 class SvxShapeGroup final : public SvxShape,
421  public css::drawing::XShapeGroup,
422  public css::drawing::XShapes2,
423  public css::drawing::XShapes
424 {
425 private:
427 
428  void addUnoShape( const css::uno::Reference< css::drawing::XShape >& xShape, size_t nPos );
429 
430 public:
431  SvxShapeGroup(SdrObject* pObj,SvxDrawPage* pDrawPage);
432  virtual ~SvxShapeGroup() throw () override;
433 
434  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
435 
436  // XInterface
437  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
438  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
439  virtual void SAL_CALL acquire() throw() override;
440  virtual void SAL_CALL release() throw() override;
441 
442  // XShapes
443  virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
444  virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
445 
446  // XShapes2
447  virtual void SAL_CALL addTop( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
448  virtual void SAL_CALL addBottom( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
449 
450  // XElementAccess
451  virtual css::uno::Type SAL_CALL getElementType() override;
452  virtual sal_Bool SAL_CALL hasElements() override;
453 
454  // XIndexAccess
455  virtual sal_Int32 SAL_CALL getCount() override ;
456  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
457 
458  // XShapeDescriptor
459  virtual OUString SAL_CALL getShapeType() override;
460 
461  // XShape
462  virtual css::awt::Point SAL_CALL getPosition() override;
463  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
464  virtual css::awt::Size SAL_CALL getSize() override;
465  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
466 
467  // XShapeGroup
468  virtual void SAL_CALL enterGroup( ) override;
469  virtual void SAL_CALL leaveGroup( ) override;
470 
471  // XTypeProvider
472  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
473 };
474 
475 /***********************************************************************
476 * *
477 ***********************************************************************/
478 class SvxShapeConnector : public css::drawing::XConnectorShape,
479  public SvxShapeText
480 {
481 public:
483  virtual ~SvxShapeConnector() throw() override;
484 
485  // XInterface
486  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
487  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
488  virtual void SAL_CALL acquire() throw() override;
489  virtual void SAL_CALL release() throw() override;
490 
491  // XShapeDescriptor
492  virtual OUString SAL_CALL getShapeType() override;
493 
494  // XShape
495  virtual css::awt::Point SAL_CALL getPosition() override;
496  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
497  virtual css::awt::Size SAL_CALL getSize() override;
498  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
499 
500  // XConnectorShape
501  virtual void SAL_CALL connectStart( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override;
502  virtual void SAL_CALL connectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override;
503  virtual void SAL_CALL disconnectBegin( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override;
504  virtual void SAL_CALL disconnectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override;
505 
506  // XTypeProvider
507  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
508  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
509 };
510 
511 /***********************************************************************
512 * *
513 ***********************************************************************/
514 class SVX_DLLPUBLIC SvxShapeControl final : public css::drawing::XControlShape, public SvxShapeText
515 {
516 protected:
519 
520 public:
521  SvxShapeControl(SdrObject* pObj);
522  virtual ~SvxShapeControl() throw() override;
523 
524  // XInterface
525  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
526  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
527  virtual void SAL_CALL acquire() throw() override;
528  virtual void SAL_CALL release() throw() override;
529 
530  // XPropertySet
531  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
532  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
533 
534  // XPropertyState
535  virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
536  virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
537  virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
538 
539  // XShapeDescriptor
540  virtual OUString SAL_CALL getShapeType() override;
541 
542  // XShape
543  virtual css::awt::Point SAL_CALL getPosition() override;
544  virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
545  virtual css::awt::Size SAL_CALL getSize() override;
546  virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
547 
548  // XControlShape
549  virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getControl() override;
550  virtual void SAL_CALL setControl( const css::uno::Reference< css::awt::XControlModel >& xControl ) override;
551 
552  // XTypeProvider
553  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
554  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
555 };
556 
557 /***********************************************************************
558 * *
559 ***********************************************************************/
560 class SvxShapeDimensioning final : public SvxShapeText
561 {
562 public:
564  virtual ~SvxShapeDimensioning() throw() override;
565 };
566 
567 /***********************************************************************
568 * *
569 ***********************************************************************/
570 class SvxShapeCircle final : public SvxShapeText
571 {
572 public:
573  SvxShapeCircle(SdrObject* pObj);
574  virtual ~SvxShapeCircle() throw () override;
575 };
576 
577 /***********************************************************************
578 * *
579 ***********************************************************************/
580 
581 // #i118485# changed parent to SvxShapeText to allow Text handling over UNO API
583 {
584 protected:
585  // override these for special property handling in subcasses. Return true if property is handled
586  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
587  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
588 
589  void resetModifiedState();
590 
591  SvGlobalName GetClassName_Impl(OUString& rHexCLSID);
592 public:
593  SvxOle2Shape(SdrObject* pObj);
594  SvxOle2Shape(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet);
595  virtual ~SvxOle2Shape() throw() override;
596 
597  bool createObject( const SvGlobalName &aClassName );
598 
599  void createLink( const OUString& aLinkURL );
600 };
601 
602 
603 /***********************************************************************
604 * *
605 ***********************************************************************/
606 class SvxShapePolyPolygon final : public SvxShapeText
607 {
610 
611  // override these for special property handling in subcasses. Return true if property is handled
612  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
613  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
614 
615  // local helper to detect PolygonKind from SdrObject::GetObjIdentifier()
616  css::drawing::PolygonKind GetPolygonKind() const;
617 
618 public:
622  virtual ~SvxShapePolyPolygon() throw() override;
623 
624  // Local support functions
626  void SetPolygon(const basegfx::B2DPolyPolygon& rNew);
627  basegfx::B2DPolyPolygon GetPolygon() const throw();
628 };
629 
630 /***********************************************************************
631 * *
632 ***********************************************************************/
633 
634 class SvxGraphicObject final : public SvxShapeText
635 {
638 
639  // override these for special property handling in subcasses. Return true if property is handled
640  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
641  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
642 
643 public:
645  virtual ~SvxGraphicObject() throw() override;
646 };
647 
648 /***********************************************************************
649 * *
650 ***********************************************************************/
651 class Svx3DSceneObject final : public css::drawing::XShapes, public SvxShape
652 {
653 private:
655 
656 protected:
659 
660 public:
661  Svx3DSceneObject(SdrObject* pObj, SvxDrawPage* pDrawPage);
662  // override these for special property handling in subcasses. Return true if property is handled
663  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
664  virtual bool getPropertyValueImpl(const OUString& rName, const SfxItemPropertySimpleEntry* pProperty,
665  css::uno::Any& rValue ) override;
666 
667  virtual ~Svx3DSceneObject() throw() override;
668 
669  virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
670 
671  // XInterface
672  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
673  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
674  virtual void SAL_CALL acquire() throw() override;
675  virtual void SAL_CALL release() throw() override;
676 
677  // XShapes
678  virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
679  virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
680 
681  // XElementAccess
682  virtual css::uno::Type SAL_CALL getElementType( ) override;
683  virtual sal_Bool SAL_CALL hasElements( ) override;
684 
685  // XIndexAccess
686  virtual sal_Int32 SAL_CALL getCount( ) override ;
687  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
688 
689  // XServiceInfo
690  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
691 
692  // XTypeProvider
693  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
694 };
695 
696 /***********************************************************************
697 * *
698 ***********************************************************************/
699 class Svx3DCubeObject final : public SvxShape
700 {
701  // override these for special property handling in subcasses. Return true if property is handled
702  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
703  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
704 
705 public:
706  Svx3DCubeObject(SdrObject* pObj);
707  virtual ~Svx3DCubeObject() throw() override;
708 
709  // XServiceInfo
710  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
711 };
712 
713 /***********************************************************************
714 * *
715 ***********************************************************************/
716 class Svx3DSphereObject final : public SvxShape
717 {
718 public:
720 private:
721  // override these for special property handling in subcasses. Return true if property is handled
722  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
723  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
724 
725  virtual ~Svx3DSphereObject() throw() override;
726 
727  // XServiceInfo
728  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
729 };
730 
731 /***********************************************************************
732 * *
733 ***********************************************************************/
734 class Svx3DLatheObject final : public SvxShape
735 {
736  // override these for special property handling in subcasses. Return true if property is handled
737  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
738  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
739 
740 public:
742  virtual ~Svx3DLatheObject() throw() override;
743 
744  // XServiceInfo
745  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
746 };
747 
748 /***********************************************************************
749 * *
750 ***********************************************************************/
751 class Svx3DExtrudeObject final : public SvxShape
752 {
753 public:
755 private:
756  // override these for special property handling in subcasses. Return true if property is handled
757  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
758  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
759 
760  virtual ~Svx3DExtrudeObject() throw() override;
761 
762  // XServiceInfo
763  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
764 };
765 
766 /***********************************************************************
767 * *
768 ***********************************************************************/
769 class Svx3DPolygonObject final : public SvxShape
770 {
771  // override these for special property handling in subcasses. Return true if property is handled
772  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
773  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
774 
775 public:
777  virtual ~Svx3DPolygonObject() throw() override;
778 
779  // XServiceInfo
780  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
781 };
782 
783 /***********************************************************************
784 * *
785 ***********************************************************************/
786 typedef ::cppu::WeakAggImplHelper1<
787  css::drawing::XEnhancedCustomShapeDefaulter
789 
791 {
792 protected:
795 
796 public:
797  SvxCustomShape(SdrObject* pObj);
798  // override these for special property handling in subcasses. Return true if property is handled
799  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
800 
801 
802  virtual ~SvxCustomShape() throw () override;
803 
804  // XInterface
805  virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
806  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
807  virtual void SAL_CALL acquire() throw() override;
808  virtual void SAL_CALL release() throw() override;
809 
810  // XShape
811  virtual css::awt::Point SAL_CALL getPosition() override;
812 
813  // XPropertySet
814  void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
815 
816  // XTypeProvider
817  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
818  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
819 
820  //XEnhancedCustomShapeDefaulter
821  virtual void SAL_CALL createCustomShapeDefaults( const OUString& rShapeType ) override;
822 };
823 
824 /***********************************************************************
825 * *
826 ***********************************************************************/
827 
828 class SvxMediaShape final : public SvxShape
829 {
830 public:
831  SvxMediaShape(SdrObject* pObj, OUString const & referer);
832  virtual ~SvxMediaShape() throw() override;
833 
834 private:
835  // override these for special property handling in subcasses. Return true if property is handled
836  virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
837  virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override;
838 
839  OUString const referer_;
840 };
841 
842 #endif
843 
844 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Type
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 Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
OUString getImplementationName()
std::unique_ptr< SvxShapeImpl > mpImpl
these members are used to optimize XMultiProperty calls
Definition: unoshape.hxx:119
#define UNO3_GETIMPLEMENTATION_DECL(classname)
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoshape.cxx:1589
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
EmbeddedObjectRef * pObject
rtl::Reference< SvxDrawPage > mxPage
Definition: unoshape.hxx:654
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
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString const referer_
Definition: unoshape.hxx:839
OUString maShapeType
Definition: unoshape.hxx:115
bool HasSdrObject() const
Definition: unoshape.hxx:211
void SetShapeType(const OUString &ShapeType)
Definition: unoshape.hxx:213
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 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:426
unsigned char sal_Bool
OUString maShapeName
Definition: unoshape.hxx:116
bool mbIsMultiPropertyCall
Definition: unoshape.hxx:120
bool setPropertyValue(uno::Sequence< beans::PropertyValue > &aProp, const OUString &aName, const uno::Any &aValue)
Abstract DrawObject.
Definition: svdobj.hxx:312
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
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
void SVX_DLLPUBLIC SvxItemPropertySet_setPropertyValue(const SfxItemPropertySimpleEntry *pMap, const css::uno::Any &rVal, SfxItemSet &rSet)
const SfxItemPropertyMapEntry * getPropertyMapEntries() const
Definition: unoshape.hxx:165
::cppu::WeakAggImplHelper1< css::drawing::XEnhancedCustomShapeDefaulter > SvxShape_UnoImplHelper1
Definition: unoshape.hxx:788
const SvxItemPropertySet * mpPropSet
Definition: unoshape.hxx:129
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
virtual void dispose() override
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
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:1719
#define SVX_DLLPRIVATE
Definition: svxdllapi.h:30
struct _ADOIndex Index
std::shared_ptr< osl::Mutex > const & lock()
css::uno::Any SVX_DLLPUBLIC SvxItemPropertySet_getPropertyValue(const SfxItemPropertySimpleEntry *pMap, const SfxItemSet &rSet)
Definition: unoshape.cxx:3975
void ForceMetricTo100th_mm(Point &rPoint) const
Definition: unoshape.hxx:141
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
sal_uInt16 nPos
virtual void SAL_CALL release() override