Line data Source code
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 : #include "Shape.hxx"
20 :
21 : #include <com/sun/star/beans/NamedValue.hpp>
22 : #include <com/sun/star/beans/PropertyAttribute.hpp>
23 : #include <com/sun/star/beans/XPropertyState.hpp>
24 : #include <com/sun/star/text/ParagraphVertAlign.hpp>
25 : #include <comphelper/property.hxx>
26 : #include <comphelper/sequence.hxx>
27 : #include <tools/debug.hxx>
28 : #include <tools/diagnose_ex.h>
29 : #include <svx/unoshape.hxx>
30 :
31 : #include "corestrings.hrc"
32 : #include "core_resource.hrc"
33 : #include "core_resource.hxx"
34 : #include "Tools.hxx"
35 : #include "RptObject.hxx"
36 : #include "FormatCondition.hxx"
37 : #include "ReportHelperImpl.hxx"
38 : // =============================================================================
39 : namespace reportdesign
40 : {
41 : // =============================================================================
42 : using namespace com::sun::star;
43 : using namespace comphelper;
44 0 : uno::Sequence< ::rtl::OUString > lcl_getShapeOptionals()
45 : {
46 : ::rtl::OUString pProps[] = {
47 : PROPERTY_DATAFIELD
48 : ,PROPERTY_CONTROLBACKGROUND
49 : ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
50 0 : };
51 0 : return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
52 : }
53 :
54 : DBG_NAME( rpt_OShape )
55 : // -----------------------------------------------------------------------------
56 0 : OShape::OShape(uno::Reference< uno::XComponentContext > const & _xContext)
57 : :ShapeBase(m_aMutex)
58 : ,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getShapeOptionals())
59 : ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
60 : ,m_nZOrder(0)
61 0 : ,m_bOpaque(sal_False)
62 : {
63 : DBG_CTOR( rpt_OShape,NULL);
64 0 : m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_SHAPE,m_aProps.aComponent.m_xContext->getServiceManager());
65 0 : }
66 : // -----------------------------------------------------------------------------
67 0 : OShape::OShape(uno::Reference< uno::XComponentContext > const & _xContext
68 : ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
69 : ,uno::Reference< drawing::XShape >& _xShape
70 : ,const ::rtl::OUString& _sServiceName)
71 : :ShapeBase(m_aMutex)
72 : ,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getShapeOptionals())
73 : ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
74 : ,m_nZOrder(0)
75 : ,m_bOpaque(sal_False)
76 0 : ,m_sServiceName(_sServiceName)
77 : {
78 : DBG_CTOR( rpt_OShape,NULL);
79 0 : m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_SHAPE,m_aProps.aComponent.m_xContext->getServiceManager());
80 0 : m_aProps.aComponent.m_xFactory = _xFactory;
81 0 : osl_atomic_increment( &m_refCount );
82 : {
83 0 : uno::Reference<beans::XPropertySet> xProp(_xShape,uno::UNO_QUERY);
84 0 : if ( xProp.is() )
85 : {
86 0 : xProp->getPropertyValue(PROPERTY_ZORDER) >>= m_nZOrder;
87 0 : xProp.clear();
88 : }
89 0 : m_aProps.aComponent.setShape(_xShape,this,m_refCount);
90 : }
91 0 : osl_atomic_decrement( &m_refCount );
92 0 : }
93 : // -----------------------------------------------------------------------------
94 0 : OShape::~OShape()
95 : {
96 : DBG_DTOR( rpt_OShape,NULL);
97 0 : }
98 : // -----------------------------------------------------------------------------
99 : //IMPLEMENT_FORWARD_XINTERFACE2(OShape,ShapeBase,ShapePropertySet)
100 0 : IMPLEMENT_FORWARD_REFCOUNT( OShape, ShapeBase )
101 : // --------------------------------------------------------------------------------
102 0 : uno::Any SAL_CALL OShape::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
103 : {
104 0 : uno::Any aReturn = ShapeBase::queryInterface(_rType);
105 0 : if ( !aReturn.hasValue() )
106 0 : aReturn = ShapePropertySet::queryInterface(_rType);
107 :
108 0 : if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
109 0 : return aReturn;
110 :
111 0 : return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
112 : }
113 :
114 : // -----------------------------------------------------------------------------
115 0 : void SAL_CALL OShape::dispose() throw(uno::RuntimeException)
116 : {
117 0 : ShapePropertySet::dispose();
118 0 : cppu::WeakComponentImplHelperBase::dispose();
119 0 : }
120 : // -----------------------------------------------------------------------------
121 0 : ::rtl::OUString OShape::getImplementationName_Static( ) throw(uno::RuntimeException)
122 : {
123 0 : return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.Shape"));
124 : }
125 :
126 : //--------------------------------------------------------------------------
127 0 : ::rtl::OUString SAL_CALL OShape::getImplementationName( ) throw(uno::RuntimeException)
128 : {
129 0 : return getImplementationName_Static();
130 : }
131 : //--------------------------------------------------------------------------
132 0 : uno::Sequence< ::rtl::OUString > OShape::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
133 : {
134 0 : uno::Sequence< ::rtl::OUString > aServices(1);
135 0 : aServices.getArray()[0] = SERVICE_SHAPE;
136 :
137 0 : return aServices;
138 : }
139 : //------------------------------------------------------------------------------
140 0 : uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext > const & xContext)
141 : {
142 0 : return *(new OShape(xContext));
143 : }
144 :
145 : //--------------------------------------------------------------------------
146 0 : uno::Sequence< ::rtl::OUString > SAL_CALL OShape::getSupportedServiceNames( ) throw(uno::RuntimeException)
147 : {
148 0 : return getSupportedServiceNames_Static();
149 : }
150 : //------------------------------------------------------------------------------
151 0 : sal_Bool SAL_CALL OShape::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
152 : {
153 :
154 0 : return m_sServiceName == ServiceName || ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
155 : }
156 : // -----------------------------------------------------------------------------
157 : // XReportComponent
158 0 : REPORTCOMPONENT_IMPL(OShape,m_aProps.aComponent)
159 0 : REPORTCOMPONENT_IMPL2(OShape,m_aProps.aComponent)
160 0 : REPORTCOMPONENT_MASTERDETAIL(OShape,m_aProps.aComponent)
161 0 : REPORTCONTROLFORMAT_IMPL2(OShape,m_aProps.aFormatProperties)
162 : // -----------------------------------------------------------------------------
163 0 : ::sal_Int32 SAL_CALL OShape::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException)
164 : {
165 0 : throw beans::UnknownPropertyException();
166 : }
167 : // -----------------------------------------------------------------------------
168 0 : void SAL_CALL OShape::setControlBackground( ::sal_Int32 /*_backgroundcolor*/ ) throw (uno::RuntimeException,beans::UnknownPropertyException)
169 : {
170 0 : throw beans::UnknownPropertyException();
171 : }
172 : // -----------------------------------------------------------------------------
173 0 : ::sal_Bool SAL_CALL OShape::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
174 : {
175 0 : throw beans::UnknownPropertyException();
176 : }
177 : // -----------------------------------------------------------------------------
178 0 : void SAL_CALL OShape::setControlBackgroundTransparent( ::sal_Bool /*_controlbackgroundtransparent*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
179 : {
180 0 : throw beans::UnknownPropertyException();
181 : }
182 : // -----------------------------------------------------------------------------
183 0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL OShape::getPropertySetInfo( ) throw(uno::RuntimeException)
184 : {
185 :
186 : //return ShapePropertySet::getPropertySetInfo();
187 0 : return cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
188 : }
189 : // -----------------------------------------------------------------------------
190 0 : cppu::IPropertyArrayHelper& OShape::getInfoHelper()
191 : {
192 0 : if ( !m_pAggHelper.get() )
193 : {
194 0 : uno::Sequence<beans::Property> aAggSeq;
195 0 : if ( m_aProps.aComponent.m_xProperty.is() )
196 0 : aAggSeq = m_aProps.aComponent.m_xProperty->getPropertySetInfo()->getProperties();
197 0 : m_pAggHelper.reset(new OPropertyArrayAggregationHelper(ShapePropertySet::getPropertySetInfo()->getProperties(),aAggSeq));
198 : }
199 0 : return *(m_pAggHelper.get());
200 : }
201 :
202 : // -----------------------------------------------------------------------------
203 0 : void SAL_CALL OShape::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
204 : {
205 0 : getInfoHelper();
206 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
207 0 : m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue);
208 : // can be in both
209 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
210 0 : ShapePropertySet::setPropertyValue( aPropertyName, aValue );
211 0 : }
212 : // -----------------------------------------------------------------------------
213 0 : uno::Any SAL_CALL OShape::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
214 : {
215 0 : getInfoHelper();
216 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
217 0 : return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName);
218 : // can be in both
219 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
220 0 : return ShapePropertySet::getPropertyValue( PropertyName);
221 0 : return uno::Any();
222 : }
223 : // -----------------------------------------------------------------------------
224 0 : void SAL_CALL OShape::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
225 : {
226 0 : getInfoHelper();
227 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || aPropertyName.isEmpty() )
228 0 : m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener);
229 : // can be in both
230 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || aPropertyName.isEmpty() )
231 0 : ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener );
232 0 : }
233 : // -----------------------------------------------------------------------------
234 0 : void SAL_CALL OShape::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
235 : {
236 0 : getInfoHelper();
237 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || aPropertyName.isEmpty() )
238 0 : m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener );
239 : // can be in both
240 0 : if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || aPropertyName.isEmpty() )
241 0 : ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener );
242 0 : }
243 : // -----------------------------------------------------------------------------
244 0 : void SAL_CALL OShape::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
245 : {
246 0 : getInfoHelper();
247 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || PropertyName.isEmpty() )
248 0 : m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener );
249 : // can be in both
250 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || PropertyName.isEmpty() )
251 0 : ShapePropertySet::addVetoableChangeListener( PropertyName, aListener );
252 0 : }
253 : // -----------------------------------------------------------------------------
254 0 : void SAL_CALL OShape::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
255 : {
256 0 : getInfoHelper();
257 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY || PropertyName.isEmpty() )
258 0 : m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener );
259 : // can be in both
260 0 : if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || PropertyName.isEmpty() )
261 0 : ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener );
262 0 : }
263 : // -----------------------------------------------------------------------------
264 : // XReportControlModel
265 0 : ::rtl::OUString SAL_CALL OShape::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
266 : {
267 0 : throw beans::UnknownPropertyException();
268 : }
269 : // -----------------------------------------------------------------------------
270 0 : void SAL_CALL OShape::setDataField( const ::rtl::OUString& /*_datafield*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
271 : {
272 0 : throw beans::UnknownPropertyException();
273 : }
274 : // -----------------------------------------------------------------------------
275 0 : ::sal_Bool SAL_CALL OShape::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
276 : {
277 0 : ::osl::MutexGuard aGuard(m_aMutex);
278 0 : return m_aProps.bPrintWhenGroupChange;
279 : }
280 : // -----------------------------------------------------------------------------
281 0 : void SAL_CALL OShape::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
282 : {
283 0 : set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
284 0 : }
285 : // -----------------------------------------------------------------------------
286 0 : ::rtl::OUString SAL_CALL OShape::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
287 : {
288 0 : ::osl::MutexGuard aGuard(m_aMutex);
289 0 : return m_aProps.aConditionalPrintExpression;
290 : }
291 : // -----------------------------------------------------------------------------
292 0 : void SAL_CALL OShape::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
293 : {
294 0 : set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
295 0 : }
296 : // -----------------------------------------------------------------------------
297 :
298 : // XCloneable
299 0 : uno::Reference< util::XCloneable > SAL_CALL OShape::createClone( ) throw (uno::RuntimeException)
300 : {
301 0 : uno::Reference< report::XReportComponent> xSource = this;
302 0 : uno::Reference< report::XReportComponent> xSet;
303 : try
304 : {
305 0 : SvxShape* pShape = SvxShape::getImplementation( xSource );
306 0 : if ( pShape )
307 : {
308 0 : SdrObject* pObject = pShape->GetSdrObject();
309 0 : if ( pObject )
310 : {
311 0 : SdrObject* pClone = pObject->Clone();
312 0 : if ( pClone )
313 : {
314 0 : xSet.set(pClone->getUnoShape(),uno::UNO_QUERY_THROW );
315 : }
316 : }
317 : }
318 : }
319 0 : catch(const uno::Exception&)
320 : {
321 : DBG_UNHANDLED_EXCEPTION();
322 : }
323 0 : return xSet.get();
324 : }
325 : // -----------------------------------------------------------------------------
326 : // XChild
327 0 : uno::Reference< uno::XInterface > SAL_CALL OShape::getParent( ) throw (uno::RuntimeException)
328 : {
329 0 : return OShapeHelper::getParent(this);
330 : }
331 : // -----------------------------------------------------------------------------
332 0 : void SAL_CALL OShape::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
333 : {
334 0 : ::osl::MutexGuard aGuard(m_aMutex);
335 0 : m_aProps.aComponent.m_xParent = uno::Reference< container::XChild >(Parent,uno::UNO_QUERY);
336 0 : }
337 0 : uno::Reference< report::XFormatCondition > SAL_CALL OShape::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
338 : {
339 0 : return new OFormatCondition(m_aProps.aComponent.m_xContext);
340 : }
341 : // -----------------------------------------------------------------------------
342 : // XContainer
343 0 : void SAL_CALL OShape::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
344 : {
345 0 : m_aProps.addContainerListener(xListener);
346 0 : }
347 : // -----------------------------------------------------------------------------
348 0 : void SAL_CALL OShape::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
349 : {
350 0 : m_aProps.removeContainerListener(xListener);
351 0 : }
352 : // -----------------------------------------------------------------------------
353 : // XElementAccess
354 0 : uno::Type SAL_CALL OShape::getElementType( ) throw (uno::RuntimeException)
355 : {
356 0 : return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
357 : }
358 : // -----------------------------------------------------------------------------
359 0 : ::sal_Bool SAL_CALL OShape::hasElements( ) throw (uno::RuntimeException)
360 : {
361 0 : return m_aProps.hasElements();
362 : }
363 : // -----------------------------------------------------------------------------
364 : // XIndexContainer
365 0 : void SAL_CALL OShape::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
366 : {
367 0 : m_aProps.insertByIndex(Index,Element);
368 0 : }
369 : // -----------------------------------------------------------------------------
370 0 : void SAL_CALL OShape::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
371 : {
372 0 : m_aProps.removeByIndex(Index);
373 0 : }
374 : // -----------------------------------------------------------------------------
375 : // XIndexReplace
376 0 : void SAL_CALL OShape::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
377 : {
378 0 : m_aProps.replaceByIndex(Index,Element);
379 0 : }
380 : // -----------------------------------------------------------------------------
381 : // XIndexAccess
382 0 : ::sal_Int32 SAL_CALL OShape::getCount( ) throw (uno::RuntimeException)
383 : {
384 0 : return m_aProps.getCount();
385 : }
386 : // -----------------------------------------------------------------------------
387 0 : uno::Any SAL_CALL OShape::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
388 : {
389 0 : return m_aProps.getByIndex( Index );
390 : }
391 : // -----------------------------------------------------------------------------
392 : // XShape
393 0 : awt::Point SAL_CALL OShape::getPosition( ) throw (uno::RuntimeException)
394 : {
395 0 : return OShapeHelper::getPosition(this);
396 : }
397 : // -----------------------------------------------------------------------------
398 0 : void SAL_CALL OShape::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
399 : {
400 0 : OShapeHelper::setPosition(aPosition,this);
401 0 : }
402 : // -----------------------------------------------------------------------------
403 0 : awt::Size SAL_CALL OShape::getSize( ) throw (uno::RuntimeException)
404 : {
405 0 : return OShapeHelper::getSize(this);
406 : }
407 : // -----------------------------------------------------------------------------
408 0 : void SAL_CALL OShape::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
409 : {
410 0 : OShapeHelper::setSize(aSize,this);
411 0 : }
412 : // -----------------------------------------------------------------------------
413 :
414 : // XShapeDescriptor
415 0 : ::rtl::OUString SAL_CALL OShape::getShapeType( ) throw (uno::RuntimeException)
416 : {
417 0 : return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape"));
418 : }
419 : // -----------------------------------------------------------------------------
420 0 : ::sal_Int32 SAL_CALL OShape::getZOrder() throw (uno::RuntimeException)
421 : {
422 0 : ::osl::MutexGuard aGuard(m_aMutex);
423 0 : m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_ZORDER) >>= m_nZOrder;
424 0 : return m_nZOrder;
425 : }
426 : // -----------------------------------------------------------------------------
427 0 : void SAL_CALL OShape::setZOrder( ::sal_Int32 _zorder ) throw (uno::RuntimeException)
428 : {
429 0 : ::osl::MutexGuard aGuard(m_aMutex);
430 0 : m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_ZORDER,uno::makeAny(_zorder));
431 0 : set(PROPERTY_ZORDER,_zorder,m_nZOrder);
432 0 : }
433 : // -----------------------------------------------------------------------------
434 0 : ::sal_Bool SAL_CALL OShape::getOpaque() throw (::com::sun::star::uno::RuntimeException)
435 : {
436 0 : ::osl::MutexGuard aGuard(m_aMutex);
437 0 : return m_bOpaque;
438 : }
439 : // -----------------------------------------------------------------------------
440 0 : void SAL_CALL OShape::setOpaque( ::sal_Bool _opaque ) throw (::com::sun::star::uno::RuntimeException)
441 : {
442 0 : ::osl::MutexGuard aGuard(m_aMutex);
443 0 : set(PROPERTY_OPAQUE,_opaque,m_bOpaque);
444 0 : }
445 : // -----------------------------------------------------------------------------
446 0 : drawing::HomogenMatrix3 SAL_CALL OShape::getTransformation() throw (uno::RuntimeException)
447 : {
448 0 : ::osl::MutexGuard aGuard(m_aMutex);
449 0 : m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_TRANSFORMATION) >>= m_Transformation;
450 0 : return m_Transformation;
451 : }
452 : // -----------------------------------------------------------------------------
453 0 : void SAL_CALL OShape::setTransformation( const drawing::HomogenMatrix3& _transformation ) throw (uno::RuntimeException)
454 : {
455 0 : m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_TRANSFORMATION,uno::makeAny(_transformation));
456 0 : set(PROPERTY_TRANSFORMATION,_transformation,m_Transformation);
457 0 : }
458 : // -----------------------------------------------------------------------------
459 0 : ::rtl::OUString SAL_CALL OShape::getCustomShapeEngine() throw (uno::RuntimeException)
460 : {
461 0 : ::osl::MutexGuard aGuard(m_aMutex);
462 0 : m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEENGINE) >>= m_CustomShapeEngine;
463 :
464 0 : return m_CustomShapeEngine;
465 : }
466 : // -----------------------------------------------------------------------------
467 0 : void SAL_CALL OShape::setCustomShapeEngine( const ::rtl::OUString& _customshapeengine ) throw (uno::RuntimeException)
468 : {
469 0 : m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEENGINE,uno::makeAny(_customshapeengine));
470 0 : set(PROPERTY_CUSTOMSHAPEENGINE,_customshapeengine,m_CustomShapeEngine);
471 0 : }
472 : // -----------------------------------------------------------------------------
473 0 : ::rtl::OUString SAL_CALL OShape::getCustomShapeData() throw (uno::RuntimeException)
474 : {
475 0 : ::osl::MutexGuard aGuard(m_aMutex);
476 0 : m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEDATA) >>= m_CustomShapeData;
477 0 : return m_CustomShapeData;
478 : }
479 : // -----------------------------------------------------------------------------
480 0 : void SAL_CALL OShape::setCustomShapeData( const ::rtl::OUString& _customshapedata ) throw (uno::RuntimeException)
481 : {
482 0 : m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEDATA,uno::makeAny(_customshapedata));
483 0 : set(PROPERTY_CUSTOMSHAPEDATA,_customshapedata,m_CustomShapeData);
484 0 : }
485 : // -----------------------------------------------------------------------------
486 0 : uno::Sequence< beans::PropertyValue > SAL_CALL OShape::getCustomShapeGeometry() throw (uno::RuntimeException)
487 : {
488 0 : ::osl::MutexGuard aGuard(m_aMutex);
489 0 : m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEGEOMETRY) >>= m_CustomShapeGeometry;
490 0 : return m_CustomShapeGeometry;
491 : }
492 : // -----------------------------------------------------------------------------
493 0 : void SAL_CALL OShape::setCustomShapeGeometry( const uno::Sequence< beans::PropertyValue >& _customshapegeometry ) throw (uno::RuntimeException)
494 : {
495 0 : m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEGEOMETRY,uno::makeAny(_customshapegeometry));
496 0 : set(PROPERTY_CUSTOMSHAPEGEOMETRY,_customshapegeometry,m_CustomShapeGeometry);
497 0 : }
498 : // -----------------------------------------------------------------------------
499 : // -----------------------------------------------------------------------------
500 :
501 : // =============================================================================
502 : }// namespace reportdesign
503 : // =============================================================================
504 :
505 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|