1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ImageControl.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #include "ImageControl.hxx"
31 #include <com/sun/star/beans/PropertyAttribute.hpp>
32 #include <com/sun/star/beans/XPropertyState.hpp>
33 #ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
34 #include "corestrings.hrc"
36 #ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
37 #include "core_resource.hrc"
39 #include "core_resource.hxx"
40 #include <comphelper/sequence.hxx>
42 #include <tools/debug.hxx>
43 #include <comphelper/property.hxx>
44 #include "FormatCondition.hxx"
45 #include <com/sun/star/awt/ImageScaleMode.hpp>
46 #include <com/sun/star/text/ParagraphVertAlign.hpp>
47 #include "ReportHelperImpl.hxx"
48 // =============================================================================
49 namespace reportdesign
51 // =============================================================================
52 using namespace com::sun::star
;
53 using namespace comphelper
;
54 uno::Sequence
< ::rtl::OUString
> lcl_getImageOptionals()
56 ::rtl::OUString pProps
[] = {
58 ,PROPERTY_CHAREMPHASIS
59 ,PROPERTY_CHARFONTCHARSET
60 ,PROPERTY_CHARFONTFAMILY
61 ,PROPERTY_CHARFONTNAME
62 ,PROPERTY_CHARFONTPITCH
63 ,PROPERTY_CHARFONTSTYLENAME
67 ,PROPERTY_FONTDESCRIPTOR
68 ,PROPERTY_FONTDESCRIPTORASIAN
69 ,PROPERTY_FONTDESCRIPTORCOMPLEX
70 ,PROPERTY_CONTROLTEXTEMPHASISMARK
71 ,PROPERTY_CHARROTATION
72 ,PROPERTY_CHARSCALEWIDTH
73 ,PROPERTY_CHARSTRIKEOUT
74 ,PROPERTY_CHARUNDERLINECOLOR
75 ,PROPERTY_CHARUNDERLINE
77 ,PROPERTY_CHARWORDMODE
79 ,PROPERTY_CHARAUTOKERNING
80 ,PROPERTY_CHARESCAPEMENTHEIGHT
82 ,PROPERTY_CHARESCAPEMENT
84 ,PROPERTY_CHARCOMBINEISON
85 ,PROPERTY_CHARCOMBINEPREFIX
86 ,PROPERTY_CHARCOMBINESUFFIX
88 ,PROPERTY_CHARSHADOWED
89 ,PROPERTY_CHARCONTOURED
90 ,PROPERTY_VISITEDCHARSTYLENAME
91 ,PROPERTY_UNVISITEDCHARSTYLENAME
93 ,PROPERTY_MASTERFIELDS
94 ,PROPERTY_DETAILFIELDS
96 , PROPERTY_CHAREMPHASISASIAN
97 , PROPERTY_CHARFONTNAMEASIAN
98 , PROPERTY_CHARFONTSTYLENAMEASIAN
99 , PROPERTY_CHARFONTFAMILYASIAN
100 , PROPERTY_CHARFONTCHARSETASIAN
101 , PROPERTY_CHARFONTPITCHASIAN
102 , PROPERTY_CHARHEIGHTASIAN
103 , PROPERTY_CHARUNDERLINEASIAN
104 , PROPERTY_CHARWEIGHTASIAN
105 , PROPERTY_CHARPOSTUREASIAN
106 , PROPERTY_CHARWORDMODEASIAN
107 , PROPERTY_CHARROTATIONASIAN
108 , PROPERTY_CHARSCALEWIDTHASIAN
109 , PROPERTY_CHARLOCALEASIAN
110 , PROPERTY_CHAREMPHASISCOMPLEX
111 , PROPERTY_CHARFONTNAMECOMPLEX
112 , PROPERTY_CHARFONTSTYLENAMECOMPLEX
113 , PROPERTY_CHARFONTFAMILYCOMPLEX
114 , PROPERTY_CHARFONTCHARSETCOMPLEX
115 , PROPERTY_CHARFONTPITCHCOMPLEX
116 , PROPERTY_CHARHEIGHTCOMPLEX
117 , PROPERTY_CHARUNDERLINECOMPLEX
118 , PROPERTY_CHARWEIGHTCOMPLEX
119 , PROPERTY_CHARPOSTURECOMPLEX
120 , PROPERTY_CHARWORDMODECOMPLEX
121 , PROPERTY_CHARROTATIONCOMPLEX
122 , PROPERTY_CHARSCALEWIDTHCOMPLEX
123 , PROPERTY_CHARLOCALECOMPLEX
126 return uno::Sequence
< ::rtl::OUString
>(pProps
,sizeof(pProps
)/sizeof(pProps
[0]));
129 DBG_NAME( rpt_OImageControl
)
130 // -----------------------------------------------------------------------------
131 OImageControl::OImageControl(uno::Reference
< uno::XComponentContext
> const & _xContext
)
132 :ImageControlBase(m_aMutex
)
133 ,ImageControlPropertySet(_xContext
,static_cast< Implements
>(IMPLEMENTS_PROPERTY_SET
),lcl_getImageOptionals())
134 ,m_aProps(m_aMutex
,static_cast< container::XContainer
*>( this ),_xContext
)
135 ,m_nScaleMode(awt::ImageScaleMode::None
)
136 ,m_bPreserveIRI(sal_True
)
138 DBG_CTOR( rpt_OImageControl
,NULL
);
139 m_aProps
.aComponent
.m_sName
= RPT_RESSTRING(RID_STR_IMAGECONTROL
,m_aProps
.aComponent
.m_xContext
->getServiceManager());
141 // -----------------------------------------------------------------------------
142 OImageControl::OImageControl(uno::Reference
< uno::XComponentContext
> const & _xContext
143 ,const uno::Reference
< lang::XMultiServiceFactory
>& _xFactory
144 ,uno::Reference
< drawing::XShape
>& _xShape
)
145 :ImageControlBase(m_aMutex
)
146 ,ImageControlPropertySet(_xContext
,static_cast< Implements
>(IMPLEMENTS_PROPERTY_SET
),lcl_getImageOptionals())
147 ,m_aProps(m_aMutex
,static_cast< container::XContainer
*>( this ),_xContext
)
148 ,m_nScaleMode(awt::ImageScaleMode::None
)
149 ,m_bPreserveIRI(sal_True
)
151 DBG_CTOR( rpt_OImageControl
,NULL
);
152 m_aProps
.aComponent
.m_sName
= RPT_RESSTRING(RID_STR_IMAGECONTROL
,m_aProps
.aComponent
.m_xContext
->getServiceManager());
153 m_aProps
.aComponent
.m_xFactory
= _xFactory
;
154 osl_incrementInterlockedCount( &m_refCount
);
156 m_aProps
.aComponent
.setShape(_xShape
,this,m_refCount
);
158 osl_decrementInterlockedCount( &m_refCount
);
160 // -----------------------------------------------------------------------------
161 OImageControl::~OImageControl()
163 DBG_DTOR( rpt_OImageControl
,NULL
);
165 // -----------------------------------------------------------------------------
166 //IMPLEMENT_FORWARD_XINTERFACE2(OImageControl,ImageControlBase,ImageControlPropertySet)
167 IMPLEMENT_FORWARD_REFCOUNT( OImageControl
, ImageControlBase
)
168 // --------------------------------------------------------------------------------
169 uno::Any SAL_CALL
OImageControl::queryInterface( const uno::Type
& _rType
) throw (uno::RuntimeException
)
171 uno::Any aReturn
= ImageControlBase::queryInterface(_rType
);
172 if ( !aReturn
.hasValue() )
173 aReturn
= ImageControlPropertySet::queryInterface(_rType
);
175 if ( !aReturn
.hasValue() && OReportControlModel::isInterfaceForbidden(_rType
) )
178 return aReturn
.hasValue() ? aReturn
: (m_aProps
.aComponent
.m_xProxy
.is() ? m_aProps
.aComponent
.m_xProxy
->queryAggregation(_rType
) : aReturn
);
181 // -----------------------------------------------------------------------------
182 void SAL_CALL
OImageControl::dispose() throw(uno::RuntimeException
)
184 ImageControlPropertySet::dispose();
185 cppu::WeakComponentImplHelperBase::dispose();
187 // -----------------------------------------------------------------------------
188 ::rtl::OUString
OImageControl::getImplementationName_Static( ) throw(uno::RuntimeException
)
190 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OImageControl"));
193 //--------------------------------------------------------------------------
194 ::rtl::OUString SAL_CALL
OImageControl::getImplementationName( ) throw(uno::RuntimeException
)
196 return getImplementationName_Static();
198 //--------------------------------------------------------------------------
199 uno::Sequence
< ::rtl::OUString
> OImageControl::getSupportedServiceNames_Static( ) throw(uno::RuntimeException
)
201 uno::Sequence
< ::rtl::OUString
> aServices(1);
202 aServices
.getArray()[0] = SERVICE_IMAGECONTROL
;
206 //------------------------------------------------------------------------------
207 uno::Reference
< uno::XInterface
> OImageControl::create(uno::Reference
< uno::XComponentContext
> const & xContext
)
209 return *(new OImageControl(xContext
));
212 //--------------------------------------------------------------------------
213 uno::Sequence
< ::rtl::OUString
> SAL_CALL
OImageControl::getSupportedServiceNames( ) throw(uno::RuntimeException
)
215 return getSupportedServiceNames_Static();
217 //------------------------------------------------------------------------------
218 sal_Bool SAL_CALL
OImageControl::supportsService(const ::rtl::OUString
& ServiceName
) throw( uno::RuntimeException
)
220 return ::comphelper::existsValue(ServiceName
,getSupportedServiceNames_Static());
222 // -----------------------------------------------------------------------------
224 REPORTCOMPONENT_IMPL(OImageControl
,m_aProps
.aComponent
)
225 REPORTCOMPONENT_IMPL2(OImageControl
,m_aProps
.aComponent
)
226 REPORTCOMPONENT_NOMASTERDETAIL(OImageControl
)
227 //REPORTCONTROLFORMAT_IMPL(OImageControl,m_aProps.aFormatProperties)
228 NO_REPORTCONTROLFORMAT_IMPL(OImageControl
)
229 ::rtl::OUString SAL_CALL
OImageControl::getHyperLinkURL() throw (uno::RuntimeException
, beans::UnknownPropertyException
)
231 ::osl::MutexGuard
aGuard(m_aMutex
);
232 return m_aProps
.aFormatProperties
.sHyperLinkURL
;
234 void SAL_CALL
OImageControl::setHyperLinkURL(const ::rtl::OUString
& the_value
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
236 set(PROPERTY_HYPERLINKURL
,the_value
,m_aProps
.aFormatProperties
.sHyperLinkURL
);
238 ::rtl::OUString SAL_CALL
OImageControl::getHyperLinkTarget() throw (uno::RuntimeException
, beans::UnknownPropertyException
)
240 ::osl::MutexGuard
aGuard(m_aMutex
);
241 return m_aProps
.aFormatProperties
.sHyperLinkTarget
;
243 void SAL_CALL
OImageControl::setHyperLinkTarget(const ::rtl::OUString
& the_value
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
245 set(PROPERTY_HYPERLINKTARGET
,the_value
,m_aProps
.aFormatProperties
.sHyperLinkTarget
);
247 ::rtl::OUString SAL_CALL
OImageControl::getHyperLinkName() throw (uno::RuntimeException
, beans::UnknownPropertyException
)
249 ::osl::MutexGuard
aGuard(m_aMutex
);
250 return m_aProps
.aFormatProperties
.sHyperLinkName
;
252 void SAL_CALL
OImageControl::setHyperLinkName(const ::rtl::OUString
& the_value
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
254 set(PROPERTY_HYPERLINKNAME
,the_value
,m_aProps
.aFormatProperties
.sHyperLinkName
);
257 // -----------------------------------------------------------------------------
258 ::sal_Int32 SAL_CALL
OImageControl::getControlBackground() throw (beans::UnknownPropertyException
, uno::RuntimeException
)
260 ::osl::MutexGuard
aGuard(m_aMutex
);
261 return m_aProps
.aFormatProperties
.m_bBackgroundTransparent
? COL_TRANSPARENT
: m_aProps
.aFormatProperties
.nBackgroundColor
;
264 void SAL_CALL
OImageControl::setControlBackground( ::sal_Int32 _backgroundcolor
) throw (uno::RuntimeException
, beans::UnknownPropertyException
)
266 sal_Bool bTransparent
= _backgroundcolor
== static_cast<sal_Int32
>(COL_TRANSPARENT
);
267 setControlBackgroundTransparent(bTransparent
);
269 set(PROPERTY_CONTROLBACKGROUND
,_backgroundcolor
,m_aProps
.aFormatProperties
.nBackgroundColor
);
272 ::sal_Bool SAL_CALL
OImageControl::getControlBackgroundTransparent() throw (beans::UnknownPropertyException
, uno::RuntimeException
)
274 ::osl::MutexGuard
aGuard(m_aMutex
);
275 return m_aProps
.aFormatProperties
.m_bBackgroundTransparent
;
278 void SAL_CALL
OImageControl::setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent
) throw (beans::UnknownPropertyException
, uno::RuntimeException
)
280 set(PROPERTY_CONTROLBACKGROUNDTRANSPARENT
,_controlbackgroundtransparent
,m_aProps
.aFormatProperties
.m_bBackgroundTransparent
);
281 if ( _controlbackgroundtransparent
)
282 set(PROPERTY_CONTROLBACKGROUND
,static_cast<sal_Int32
>(COL_TRANSPARENT
),m_aProps
.aFormatProperties
.nBackgroundColor
);
285 // -----------------------------------------------------------------------------
286 uno::Reference
< beans::XPropertySetInfo
> SAL_CALL
OImageControl::getPropertySetInfo( ) throw(uno::RuntimeException
)
288 return ImageControlPropertySet::getPropertySetInfo();
290 // -----------------------------------------------------------------------------
291 void SAL_CALL
OImageControl::setPropertyValue( const ::rtl::OUString
& aPropertyName
, const uno::Any
& aValue
) throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
293 ImageControlPropertySet::setPropertyValue( aPropertyName
, aValue
);
295 // -----------------------------------------------------------------------------
296 uno::Any SAL_CALL
OImageControl::getPropertyValue( const ::rtl::OUString
& PropertyName
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
298 return ImageControlPropertySet::getPropertyValue( PropertyName
);
300 // -----------------------------------------------------------------------------
301 void SAL_CALL
OImageControl::addPropertyChangeListener( const ::rtl::OUString
& aPropertyName
, const uno::Reference
< beans::XPropertyChangeListener
>& xListener
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
303 ImageControlPropertySet::addPropertyChangeListener( aPropertyName
, xListener
);
305 // -----------------------------------------------------------------------------
306 void SAL_CALL
OImageControl::removePropertyChangeListener( const ::rtl::OUString
& aPropertyName
, const uno::Reference
< beans::XPropertyChangeListener
>& aListener
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
308 ImageControlPropertySet::removePropertyChangeListener( aPropertyName
, aListener
);
310 // -----------------------------------------------------------------------------
311 void SAL_CALL
OImageControl::addVetoableChangeListener( const ::rtl::OUString
& PropertyName
, const uno::Reference
< beans::XVetoableChangeListener
>& aListener
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
313 ImageControlPropertySet::addVetoableChangeListener( PropertyName
, aListener
);
315 // -----------------------------------------------------------------------------
316 void SAL_CALL
OImageControl::removeVetoableChangeListener( const ::rtl::OUString
& PropertyName
, const uno::Reference
< beans::XVetoableChangeListener
>& aListener
) throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
318 ImageControlPropertySet::removeVetoableChangeListener( PropertyName
, aListener
);
320 // -----------------------------------------------------------------------------
321 // XReportControlModel
322 ::rtl::OUString SAL_CALL
OImageControl::getDataField() throw ( beans::UnknownPropertyException
, uno::RuntimeException
)
324 ::osl::MutexGuard
aGuard(m_aMutex
);
325 return m_aProps
.aDataField
;
327 // -----------------------------------------------------------------------------
328 void SAL_CALL
OImageControl::setDataField( const ::rtl::OUString
& _datafield
) throw (lang::IllegalArgumentException
, beans::UnknownPropertyException
, uno::RuntimeException
)
330 set(PROPERTY_DATAFIELD
,_datafield
,m_aProps
.aDataField
);
332 // -----------------------------------------------------------------------------
333 // -----------------------------------------------------------------------------
334 ::sal_Bool SAL_CALL
OImageControl::getPrintWhenGroupChange() throw (beans::UnknownPropertyException
, uno::RuntimeException
)
336 ::osl::MutexGuard
aGuard(m_aMutex
);
337 return m_aProps
.bPrintWhenGroupChange
;
339 // -----------------------------------------------------------------------------
340 void SAL_CALL
OImageControl::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange
) throw (beans::UnknownPropertyException
, uno::RuntimeException
)
342 set(PROPERTY_PRINTWHENGROUPCHANGE
,_printwhengroupchange
,m_aProps
.bPrintWhenGroupChange
);
344 // -----------------------------------------------------------------------------
345 ::rtl::OUString SAL_CALL
OImageControl::getConditionalPrintExpression() throw (beans::UnknownPropertyException
, uno::RuntimeException
)
347 ::osl::MutexGuard
aGuard(m_aMutex
);
348 return m_aProps
.aConditionalPrintExpression
;
350 // -----------------------------------------------------------------------------
351 void SAL_CALL
OImageControl::setConditionalPrintExpression( const ::rtl::OUString
& _conditionalprintexpression
) throw (beans::UnknownPropertyException
, uno::RuntimeException
)
353 set(PROPERTY_CONDITIONALPRINTEXPRESSION
,_conditionalprintexpression
,m_aProps
.aConditionalPrintExpression
);
356 // -----------------------------------------------------------------------------
359 uno::Reference
< util::XCloneable
> SAL_CALL
OImageControl::createClone( ) throw (uno::RuntimeException
)
361 uno::Reference
< report::XReportComponent
> xSource
= this;
362 uno::Reference
< report::XImageControl
> xSet(cloneObject(xSource
,m_aProps
.aComponent
.m_xFactory
,SERVICE_IMAGECONTROL
),uno::UNO_QUERY_THROW
);
365 // -----------------------------------------------------------------------------
368 // -----------------------------------------------------------------------------
369 ::rtl::OUString SAL_CALL
OImageControl::getImageURL() throw (uno::RuntimeException
)
371 ::osl::MutexGuard
aGuard(m_aMutex
);
374 // -----------------------------------------------------------------------------
375 void SAL_CALL
OImageControl::setImageURL( const ::rtl::OUString
& _imageurl
) throw (uno::RuntimeException
)
377 set(PROPERTY_IMAGEURL
,_imageurl
,m_aImageURL
);
379 // -----------------------------------------------------------------------------
380 uno::Reference
< awt::XImageProducer
> SAL_CALL
OImageControl::getImageProducer( ) throw (uno::RuntimeException
)
382 return uno::Reference
< awt::XImageProducer
>();
384 // -----------------------------------------------------------------------------
386 uno::Reference
< uno::XInterface
> SAL_CALL
OImageControl::getParent( ) throw (uno::RuntimeException
)
388 return OShapeHelper::getParent(this);
390 // -----------------------------------------------------------------------------
391 void SAL_CALL
OImageControl::setParent( const uno::Reference
< uno::XInterface
>& Parent
) throw (lang::NoSupportException
, uno::RuntimeException
)
393 OShapeHelper::setParent(Parent
,this);
395 uno::Reference
< report::XFormatCondition
> SAL_CALL
OImageControl::createFormatCondition( ) throw (uno::Exception
, uno::RuntimeException
)
397 return new OFormatCondition(m_aProps
.aComponent
.m_xContext
);
399 // -----------------------------------------------------------------------------
401 void SAL_CALL
OImageControl::addContainerListener( const uno::Reference
< container::XContainerListener
>& xListener
) throw (uno::RuntimeException
)
403 m_aProps
.addContainerListener(xListener
);
405 // -----------------------------------------------------------------------------
406 void SAL_CALL
OImageControl::removeContainerListener( const uno::Reference
< container::XContainerListener
>& xListener
) throw (uno::RuntimeException
)
408 m_aProps
.removeContainerListener(xListener
);
410 // -----------------------------------------------------------------------------
412 uno::Type SAL_CALL
OImageControl::getElementType( ) throw (uno::RuntimeException
)
414 return ::getCppuType(static_cast< uno::Reference
<report::XFormatCondition
>*>(NULL
));
416 // -----------------------------------------------------------------------------
417 ::sal_Bool SAL_CALL
OImageControl::hasElements( ) throw (uno::RuntimeException
)
419 return m_aProps
.hasElements();
421 // -----------------------------------------------------------------------------
423 void SAL_CALL
OImageControl::insertByIndex( ::sal_Int32 Index
, const uno::Any
& Element
) throw (lang::IllegalArgumentException
, lang::IndexOutOfBoundsException
, lang::WrappedTargetException
, uno::RuntimeException
)
425 m_aProps
.insertByIndex(Index
,Element
);
427 // -----------------------------------------------------------------------------
428 void SAL_CALL
OImageControl::removeByIndex( ::sal_Int32 Index
) throw (lang::IndexOutOfBoundsException
, lang::WrappedTargetException
, uno::RuntimeException
)
430 m_aProps
.removeByIndex(Index
);
432 // -----------------------------------------------------------------------------
434 void SAL_CALL
OImageControl::replaceByIndex( ::sal_Int32 Index
, const uno::Any
& Element
) throw (lang::IllegalArgumentException
, lang::IndexOutOfBoundsException
, lang::WrappedTargetException
, uno::RuntimeException
)
436 m_aProps
.replaceByIndex(Index
,Element
);
438 // -----------------------------------------------------------------------------
440 ::sal_Int32 SAL_CALL
OImageControl::getCount( ) throw (uno::RuntimeException
)
442 return m_aProps
.getCount();
444 // -----------------------------------------------------------------------------
445 uno::Any SAL_CALL
OImageControl::getByIndex( ::sal_Int32 Index
) throw (lang::IndexOutOfBoundsException
, lang::WrappedTargetException
, uno::RuntimeException
)
447 return m_aProps
.getByIndex( Index
);
449 // -----------------------------------------------------------------------------
450 // -----------------------------------------------------------------------------
452 awt::Point SAL_CALL
OImageControl::getPosition( ) throw (uno::RuntimeException
)
454 return OShapeHelper::getPosition(this);
456 // -----------------------------------------------------------------------------
457 void SAL_CALL
OImageControl::setPosition( const awt::Point
& aPosition
) throw (uno::RuntimeException
)
459 OShapeHelper::setPosition(aPosition
,this);
461 // -----------------------------------------------------------------------------
462 awt::Size SAL_CALL
OImageControl::getSize( ) throw (uno::RuntimeException
)
464 return OShapeHelper::getSize(this);
466 // -----------------------------------------------------------------------------
467 void SAL_CALL
OImageControl::setSize( const awt::Size
& aSize
) throw (beans::PropertyVetoException
, uno::RuntimeException
)
469 OShapeHelper::setSize(aSize
,this);
471 // -----------------------------------------------------------------------------
474 ::rtl::OUString SAL_CALL
OImageControl::getShapeType( ) throw (uno::RuntimeException
)
476 ::osl::MutexGuard
aGuard(m_aMutex
);
477 if ( m_aProps
.aComponent
.m_xShape
.is() )
478 return m_aProps
.aComponent
.m_xShape
->getShapeType();
479 return ::rtl::OUString();
481 // -----------------------------------------------------------------------------
482 ::sal_Int16 SAL_CALL
OImageControl::getScaleMode() throw (uno::RuntimeException
)
484 ::osl::MutexGuard
aGuard(m_aMutex
);
487 // -----------------------------------------------------------------------------
488 void SAL_CALL
OImageControl::setScaleMode( ::sal_Int16 _scalemode
) throw (lang::IllegalArgumentException
, uno::RuntimeException
)
490 if ( _scalemode
< awt::ImageScaleMode::None
||_scalemode
> awt::ImageScaleMode::Anisotropic
)
491 throw lang::IllegalArgumentException();
492 set(PROPERTY_SCALEMODE
,_scalemode
,m_nScaleMode
);
494 // -----------------------------------------------------------------------------
495 ::sal_Bool SAL_CALL
OImageControl::getPreserveIRI() throw (uno::RuntimeException
)
497 ::osl::MutexGuard
aGuard(m_aMutex
);
498 return m_bPreserveIRI
;
500 // -----------------------------------------------------------------------------
501 void SAL_CALL
OImageControl::setPreserveIRI( ::sal_Bool _preserveiri
) throw (uno::RuntimeException
)
503 set(PROPERTY_PRESERVEIRI
,_preserveiri
,m_bPreserveIRI
);
505 // =============================================================================
506 } // namespace reportdesign
507 // =============================================================================