bump product version to 4.1.6.2
[LibreOffice.git] / reportdesign / source / core / api / ImageControl.cxx
blob5971aeb0d216fcc2aed299a80a784204d6b6ffd1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #include "ImageControl.hxx"
20 #include <com/sun/star/beans/PropertyAttribute.hpp>
21 #include <com/sun/star/beans/XPropertyState.hpp>
22 #include "corestrings.hrc"
23 #include "core_resource.hrc"
24 #include "core_resource.hxx"
25 #include <comphelper/sequence.hxx>
26 #include "Tools.hxx"
27 #include <tools/color.hxx>
28 #include <tools/debug.hxx>
29 #include <comphelper/property.hxx>
30 #include "FormatCondition.hxx"
31 #include <com/sun/star/awt/ImageScaleMode.hpp>
32 #include <com/sun/star/text/ParagraphVertAlign.hpp>
33 #include "ReportHelperImpl.hxx"
34 // =============================================================================
35 namespace reportdesign
37 // =============================================================================
38 using namespace com::sun::star;
39 using namespace comphelper;
40 uno::Sequence< OUString > lcl_getImageOptionals()
42 OUString pProps[] = {
43 OUString(PROPERTY_CHARCOLOR)
44 ,OUString(PROPERTY_CHAREMPHASIS)
45 ,OUString(PROPERTY_CHARFONTCHARSET)
46 ,OUString(PROPERTY_CHARFONTFAMILY)
47 ,OUString(PROPERTY_CHARFONTNAME)
48 ,OUString(PROPERTY_CHARFONTPITCH)
49 ,OUString(PROPERTY_CHARFONTSTYLENAME)
50 ,OUString(PROPERTY_CHARHEIGHT)
51 ,OUString(PROPERTY_CHARPOSTURE)
52 ,OUString(PROPERTY_CHARRELIEF)
53 ,OUString(PROPERTY_FONTDESCRIPTOR)
54 ,OUString(PROPERTY_FONTDESCRIPTORASIAN)
55 ,OUString(PROPERTY_FONTDESCRIPTORCOMPLEX)
56 ,OUString(PROPERTY_CONTROLTEXTEMPHASISMARK)
57 ,OUString(PROPERTY_CHARROTATION)
58 ,OUString(PROPERTY_CHARSCALEWIDTH)
59 ,OUString(PROPERTY_CHARSTRIKEOUT)
60 ,OUString(PROPERTY_CHARUNDERLINECOLOR)
61 ,OUString(PROPERTY_CHARUNDERLINE)
62 ,OUString(PROPERTY_CHARWEIGHT)
63 ,OUString(PROPERTY_CHARWORDMODE)
64 ,OUString(PROPERTY_CHARFLASH)
65 ,OUString(PROPERTY_CHARAUTOKERNING)
66 ,OUString(PROPERTY_CHARESCAPEMENTHEIGHT)
67 ,OUString(PROPERTY_CHARLOCALE)
68 ,OUString(PROPERTY_CHARESCAPEMENT)
69 ,OUString(PROPERTY_CHARCASEMAP)
70 ,OUString(PROPERTY_CHARCOMBINEISON)
71 ,OUString(PROPERTY_CHARCOMBINEPREFIX)
72 ,OUString(PROPERTY_CHARCOMBINESUFFIX)
73 ,OUString(PROPERTY_CHARHIDDEN)
74 ,OUString(PROPERTY_CHARSHADOWED)
75 ,OUString(PROPERTY_CHARCONTOURED)
76 ,OUString(PROPERTY_VISITEDCHARSTYLENAME)
77 ,OUString(PROPERTY_UNVISITEDCHARSTYLENAME)
78 ,OUString(PROPERTY_CHARKERNING)
79 ,OUString(PROPERTY_MASTERFIELDS)
80 ,OUString(PROPERTY_DETAILFIELDS)
81 ,OUString(PROPERTY_PARAADJUST)
82 , OUString(PROPERTY_CHAREMPHASISASIAN)
83 , OUString(PROPERTY_CHARFONTNAMEASIAN)
84 , OUString(PROPERTY_CHARFONTSTYLENAMEASIAN)
85 , OUString(PROPERTY_CHARFONTFAMILYASIAN)
86 , OUString(PROPERTY_CHARFONTCHARSETASIAN)
87 , OUString(PROPERTY_CHARFONTPITCHASIAN)
88 , OUString(PROPERTY_CHARHEIGHTASIAN)
89 , OUString(PROPERTY_CHARUNDERLINEASIAN)
90 , OUString(PROPERTY_CHARWEIGHTASIAN)
91 , OUString(PROPERTY_CHARPOSTUREASIAN)
92 , OUString(PROPERTY_CHARWORDMODEASIAN)
93 , OUString(PROPERTY_CHARROTATIONASIAN)
94 , OUString(PROPERTY_CHARSCALEWIDTHASIAN)
95 , OUString(PROPERTY_CHARLOCALEASIAN)
96 , OUString(PROPERTY_CHAREMPHASISCOMPLEX)
97 , OUString(PROPERTY_CHARFONTNAMECOMPLEX)
98 , OUString(PROPERTY_CHARFONTSTYLENAMECOMPLEX)
99 , OUString(PROPERTY_CHARFONTFAMILYCOMPLEX)
100 , OUString(PROPERTY_CHARFONTCHARSETCOMPLEX)
101 , OUString(PROPERTY_CHARFONTPITCHCOMPLEX)
102 , OUString(PROPERTY_CHARHEIGHTCOMPLEX)
103 , OUString(PROPERTY_CHARUNDERLINECOMPLEX)
104 , OUString(PROPERTY_CHARWEIGHTCOMPLEX)
105 , OUString(PROPERTY_CHARPOSTURECOMPLEX)
106 , OUString(PROPERTY_CHARWORDMODECOMPLEX)
107 , OUString(PROPERTY_CHARROTATIONCOMPLEX)
108 , OUString(PROPERTY_CHARSCALEWIDTHCOMPLEX)
109 , OUString(PROPERTY_CHARLOCALECOMPLEX)
112 return uno::Sequence< OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
115 DBG_NAME( rpt_OImageControl )
116 // -----------------------------------------------------------------------------
117 OImageControl::OImageControl(uno::Reference< uno::XComponentContext > const & _xContext)
118 :ImageControlBase(m_aMutex)
119 ,ImageControlPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getImageOptionals())
120 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
121 ,m_nScaleMode(awt::ImageScaleMode::None)
122 ,m_bPreserveIRI(sal_True)
124 DBG_CTOR( rpt_OImageControl,NULL);
125 m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_IMAGECONTROL,m_aProps.aComponent.m_xContext->getServiceManager());
127 // -----------------------------------------------------------------------------
128 OImageControl::OImageControl(uno::Reference< uno::XComponentContext > const & _xContext
129 ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
130 ,uno::Reference< drawing::XShape >& _xShape)
131 :ImageControlBase(m_aMutex)
132 ,ImageControlPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getImageOptionals())
133 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
134 ,m_nScaleMode(awt::ImageScaleMode::None)
135 ,m_bPreserveIRI(sal_True)
137 DBG_CTOR( rpt_OImageControl,NULL);
138 m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_IMAGECONTROL,m_aProps.aComponent.m_xContext->getServiceManager());
139 m_aProps.aComponent.m_xFactory = _xFactory;
140 osl_atomic_increment( &m_refCount );
142 m_aProps.aComponent.setShape(_xShape,this,m_refCount);
144 osl_atomic_decrement( &m_refCount );
146 // -----------------------------------------------------------------------------
147 OImageControl::~OImageControl()
149 DBG_DTOR( rpt_OImageControl,NULL);
151 // -----------------------------------------------------------------------------
152 //IMPLEMENT_FORWARD_XINTERFACE2(OImageControl,ImageControlBase,ImageControlPropertySet)
153 IMPLEMENT_FORWARD_REFCOUNT( OImageControl, ImageControlBase )
154 // --------------------------------------------------------------------------------
155 uno::Any SAL_CALL OImageControl::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
157 uno::Any aReturn = ImageControlBase::queryInterface(_rType);
158 if ( !aReturn.hasValue() )
159 aReturn = ImageControlPropertySet::queryInterface(_rType);
161 if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
162 return aReturn;
164 return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
167 // -----------------------------------------------------------------------------
168 void SAL_CALL OImageControl::dispose() throw(uno::RuntimeException)
170 ImageControlPropertySet::dispose();
171 cppu::WeakComponentImplHelperBase::dispose();
173 // -----------------------------------------------------------------------------
174 OUString OImageControl::getImplementationName_Static( ) throw(uno::RuntimeException)
176 return OUString("com.sun.star.comp.report.OImageControl");
179 //--------------------------------------------------------------------------
180 OUString SAL_CALL OImageControl::getImplementationName( ) throw(uno::RuntimeException)
182 return getImplementationName_Static();
184 //--------------------------------------------------------------------------
185 uno::Sequence< OUString > OImageControl::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
187 uno::Sequence< OUString > aServices(1);
188 aServices.getArray()[0] = SERVICE_IMAGECONTROL;
190 return aServices;
192 //------------------------------------------------------------------------------
193 uno::Reference< uno::XInterface > OImageControl::create(uno::Reference< uno::XComponentContext > const & xContext)
195 return *(new OImageControl(xContext));
198 //--------------------------------------------------------------------------
199 uno::Sequence< OUString > SAL_CALL OImageControl::getSupportedServiceNames( ) throw(uno::RuntimeException)
201 return getSupportedServiceNames_Static();
203 //------------------------------------------------------------------------------
204 sal_Bool SAL_CALL OImageControl::supportsService(const OUString& ServiceName) throw( uno::RuntimeException )
206 return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
208 // -----------------------------------------------------------------------------
209 // XReportComponent
210 REPORTCOMPONENT_IMPL(OImageControl,m_aProps.aComponent)
211 REPORTCOMPONENT_IMPL2(OImageControl,m_aProps.aComponent)
212 REPORTCOMPONENT_NOMASTERDETAIL(OImageControl)
213 NO_REPORTCONTROLFORMAT_IMPL(OImageControl)
214 OUString SAL_CALL OImageControl::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException)
216 ::osl::MutexGuard aGuard(m_aMutex);
217 return m_aProps.aFormatProperties.sHyperLinkURL;
219 void SAL_CALL OImageControl::setHyperLinkURL(const OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
221 set(PROPERTY_HYPERLINKURL,the_value,m_aProps.aFormatProperties.sHyperLinkURL);
223 OUString SAL_CALL OImageControl::getHyperLinkTarget() throw (uno::RuntimeException, beans::UnknownPropertyException)
225 ::osl::MutexGuard aGuard(m_aMutex);
226 return m_aProps.aFormatProperties.sHyperLinkTarget;
228 void SAL_CALL OImageControl::setHyperLinkTarget(const OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
230 set(PROPERTY_HYPERLINKTARGET,the_value,m_aProps.aFormatProperties.sHyperLinkTarget);
232 OUString SAL_CALL OImageControl::getHyperLinkName() throw (uno::RuntimeException, beans::UnknownPropertyException)
234 ::osl::MutexGuard aGuard(m_aMutex);
235 return m_aProps.aFormatProperties.sHyperLinkName;
237 void SAL_CALL OImageControl::setHyperLinkName(const OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
239 set(PROPERTY_HYPERLINKNAME,the_value,m_aProps.aFormatProperties.sHyperLinkName);
242 // -----------------------------------------------------------------------------
243 ::sal_Int32 SAL_CALL OImageControl::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException)
245 ::osl::MutexGuard aGuard(m_aMutex);
246 return m_aProps.aFormatProperties.m_bBackgroundTransparent ? COL_TRANSPARENT : m_aProps.aFormatProperties.nBackgroundColor;
249 void SAL_CALL OImageControl::setControlBackground( ::sal_Int32 _backgroundcolor ) throw (uno::RuntimeException, beans::UnknownPropertyException)
251 sal_Bool bTransparent = _backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT);
252 setControlBackgroundTransparent(bTransparent);
253 if ( !bTransparent )
254 set(PROPERTY_CONTROLBACKGROUND,_backgroundcolor,m_aProps.aFormatProperties.nBackgroundColor);
257 ::sal_Bool SAL_CALL OImageControl::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
259 ::osl::MutexGuard aGuard(m_aMutex);
260 return m_aProps.aFormatProperties.m_bBackgroundTransparent;
263 void SAL_CALL OImageControl::setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent ) throw (beans::UnknownPropertyException, uno::RuntimeException)
265 set(PROPERTY_CONTROLBACKGROUNDTRANSPARENT,_controlbackgroundtransparent,m_aProps.aFormatProperties.m_bBackgroundTransparent);
266 if ( _controlbackgroundtransparent )
267 set(PROPERTY_CONTROLBACKGROUND,static_cast<sal_Int32>(COL_TRANSPARENT),m_aProps.aFormatProperties.nBackgroundColor);
270 // -----------------------------------------------------------------------------
271 uno::Reference< beans::XPropertySetInfo > SAL_CALL OImageControl::getPropertySetInfo( ) throw(uno::RuntimeException)
273 return ImageControlPropertySet::getPropertySetInfo();
275 // -----------------------------------------------------------------------------
276 void SAL_CALL OImageControl::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
278 ImageControlPropertySet::setPropertyValue( aPropertyName, aValue );
280 // -----------------------------------------------------------------------------
281 uno::Any SAL_CALL OImageControl::getPropertyValue( const OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
283 return ImageControlPropertySet::getPropertyValue( PropertyName);
285 // -----------------------------------------------------------------------------
286 void SAL_CALL OImageControl::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
288 ImageControlPropertySet::addPropertyChangeListener( aPropertyName, xListener );
290 // -----------------------------------------------------------------------------
291 void SAL_CALL OImageControl::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
293 ImageControlPropertySet::removePropertyChangeListener( aPropertyName, aListener );
295 // -----------------------------------------------------------------------------
296 void SAL_CALL OImageControl::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
298 ImageControlPropertySet::addVetoableChangeListener( PropertyName, aListener );
300 // -----------------------------------------------------------------------------
301 void SAL_CALL OImageControl::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
303 ImageControlPropertySet::removeVetoableChangeListener( PropertyName, aListener );
305 // -----------------------------------------------------------------------------
306 // XReportControlModel
307 OUString SAL_CALL OImageControl::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
309 ::osl::MutexGuard aGuard(m_aMutex);
310 return m_aProps.aDataField;
312 // -----------------------------------------------------------------------------
313 void SAL_CALL OImageControl::setDataField( const OUString& _datafield ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
315 set(PROPERTY_DATAFIELD,_datafield,m_aProps.aDataField);
317 // -----------------------------------------------------------------------------
318 // -----------------------------------------------------------------------------
319 ::sal_Bool SAL_CALL OImageControl::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
321 ::osl::MutexGuard aGuard(m_aMutex);
322 return m_aProps.bPrintWhenGroupChange;
324 // -----------------------------------------------------------------------------
325 void SAL_CALL OImageControl::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
327 set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
329 // -----------------------------------------------------------------------------
330 OUString SAL_CALL OImageControl::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
332 ::osl::MutexGuard aGuard(m_aMutex);
333 return m_aProps.aConditionalPrintExpression;
335 // -----------------------------------------------------------------------------
336 void SAL_CALL OImageControl::setConditionalPrintExpression( const OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
338 set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
341 // -----------------------------------------------------------------------------
343 // XCloneable
344 uno::Reference< util::XCloneable > SAL_CALL OImageControl::createClone( ) throw (uno::RuntimeException)
346 uno::Reference< report::XReportComponent> xSource = this;
347 uno::Reference< report::XImageControl> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_IMAGECONTROL),uno::UNO_QUERY_THROW);
348 return xSet.get();
350 // -----------------------------------------------------------------------------
352 // XImageControl
353 // -----------------------------------------------------------------------------
354 OUString SAL_CALL OImageControl::getImageURL() throw (uno::RuntimeException)
356 ::osl::MutexGuard aGuard(m_aMutex);
357 return m_aImageURL;
359 // -----------------------------------------------------------------------------
360 void SAL_CALL OImageControl::setImageURL( const OUString& _imageurl ) throw (uno::RuntimeException)
362 set(PROPERTY_IMAGEURL,_imageurl,m_aImageURL);
364 // -----------------------------------------------------------------------------
365 uno::Reference< awt::XImageProducer > SAL_CALL OImageControl::getImageProducer( ) throw (uno::RuntimeException)
367 return uno::Reference< awt::XImageProducer >();
369 // -----------------------------------------------------------------------------
370 // XChild
371 uno::Reference< uno::XInterface > SAL_CALL OImageControl::getParent( ) throw (uno::RuntimeException)
373 return OShapeHelper::getParent(this);
375 // -----------------------------------------------------------------------------
376 void SAL_CALL OImageControl::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
378 OShapeHelper::setParent(Parent,this);
380 uno::Reference< report::XFormatCondition > SAL_CALL OImageControl::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
382 return new OFormatCondition(m_aProps.aComponent.m_xContext);
384 // -----------------------------------------------------------------------------
385 // XContainer
386 void SAL_CALL OImageControl::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
388 m_aProps.addContainerListener(xListener);
390 // -----------------------------------------------------------------------------
391 void SAL_CALL OImageControl::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
393 m_aProps.removeContainerListener(xListener);
395 // -----------------------------------------------------------------------------
396 // XElementAccess
397 uno::Type SAL_CALL OImageControl::getElementType( ) throw (uno::RuntimeException)
399 return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
401 // -----------------------------------------------------------------------------
402 ::sal_Bool SAL_CALL OImageControl::hasElements( ) throw (uno::RuntimeException)
404 return m_aProps.hasElements();
406 // -----------------------------------------------------------------------------
407 // XIndexContainer
408 void SAL_CALL OImageControl::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
410 m_aProps.insertByIndex(Index,Element);
412 // -----------------------------------------------------------------------------
413 void SAL_CALL OImageControl::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
415 m_aProps.removeByIndex(Index);
417 // -----------------------------------------------------------------------------
418 // XIndexReplace
419 void SAL_CALL OImageControl::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
421 m_aProps.replaceByIndex(Index,Element);
423 // -----------------------------------------------------------------------------
424 // XIndexAccess
425 ::sal_Int32 SAL_CALL OImageControl::getCount( ) throw (uno::RuntimeException)
427 return m_aProps.getCount();
429 // -----------------------------------------------------------------------------
430 uno::Any SAL_CALL OImageControl::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
432 return m_aProps.getByIndex( Index );
434 // -----------------------------------------------------------------------------
435 // -----------------------------------------------------------------------------
436 // XShape
437 awt::Point SAL_CALL OImageControl::getPosition( ) throw (uno::RuntimeException)
439 return OShapeHelper::getPosition(this);
441 // -----------------------------------------------------------------------------
442 void SAL_CALL OImageControl::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
444 OShapeHelper::setPosition(aPosition,this);
446 // -----------------------------------------------------------------------------
447 awt::Size SAL_CALL OImageControl::getSize( ) throw (uno::RuntimeException)
449 return OShapeHelper::getSize(this);
451 // -----------------------------------------------------------------------------
452 void SAL_CALL OImageControl::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
454 OShapeHelper::setSize(aSize,this);
456 // -----------------------------------------------------------------------------
458 // XShapeDescriptor
459 OUString SAL_CALL OImageControl::getShapeType( ) throw (uno::RuntimeException)
461 ::osl::MutexGuard aGuard(m_aMutex);
462 if ( m_aProps.aComponent.m_xShape.is() )
463 return m_aProps.aComponent.m_xShape->getShapeType();
464 return OUString("com.sun.star.drawing.ControlShape");
466 // -----------------------------------------------------------------------------
467 ::sal_Int16 SAL_CALL OImageControl::getScaleMode() throw (uno::RuntimeException)
469 ::osl::MutexGuard aGuard(m_aMutex);
470 return m_nScaleMode;
472 // -----------------------------------------------------------------------------
473 void SAL_CALL OImageControl::setScaleMode( ::sal_Int16 _scalemode ) throw (lang::IllegalArgumentException, uno::RuntimeException)
475 if ( _scalemode < awt::ImageScaleMode::None ||_scalemode > awt::ImageScaleMode::Anisotropic )
476 throw lang::IllegalArgumentException();
477 set(PROPERTY_SCALEMODE,_scalemode,m_nScaleMode);
479 // -----------------------------------------------------------------------------
480 ::sal_Bool SAL_CALL OImageControl::getPreserveIRI() throw (uno::RuntimeException)
482 ::osl::MutexGuard aGuard(m_aMutex);
483 return m_bPreserveIRI;
485 // -----------------------------------------------------------------------------
486 void SAL_CALL OImageControl::setPreserveIRI( ::sal_Bool _preserveiri ) throw (uno::RuntimeException)
488 set(PROPERTY_PRESERVEIRI,_preserveiri,m_bPreserveIRI);
490 // =============================================================================
491 } // namespace reportdesign
492 // =============================================================================
494 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */