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