1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #include "precompiled_reportdesign.hxx"
24 #include "ImageControl.hxx"
25 #include <com/sun/star/beans/PropertyAttribute.hpp>
26 #include <com/sun/star/beans/XPropertyState.hpp>
27 #include "corestrings.hrc"
28 #include "core_resource.hrc"
29 #include "core_resource.hxx"
30 #include <comphelper/sequence.hxx>
31 #include "Tools.hxx"
32 #include <tools/debug.hxx>
33 #include <comphelper/property.hxx>
34 #include "FormatCondition.hxx"
35 #include <com/sun/star/awt/ImageScaleMode.hpp>
36 #include <com/sun/star/text/ParagraphVertAlign.hpp>
37 #include "ReportHelperImpl.hxx"
38 // =============================================================================
39 namespace reportdesign
40 {
41 // =============================================================================
42 	using namespace com::sun::star;
43 	using namespace comphelper;
lcl_getImageOptionals()44 uno::Sequence< ::rtl::OUString > lcl_getImageOptionals()
45 {
46 	::rtl::OUString pProps[] = {
47             PROPERTY_CHARCOLOR
48             ,PROPERTY_CHAREMPHASIS
49             ,PROPERTY_CHARFONTCHARSET
50             ,PROPERTY_CHARFONTFAMILY
51             ,PROPERTY_CHARFONTNAME
52             ,PROPERTY_CHARFONTPITCH
53             ,PROPERTY_CHARFONTSTYLENAME
54             ,PROPERTY_CHARHEIGHT
55             ,PROPERTY_CHARPOSTURE
56             ,PROPERTY_CHARRELIEF
57             ,PROPERTY_FONTDESCRIPTOR
58             ,PROPERTY_FONTDESCRIPTORASIAN
59             ,PROPERTY_FONTDESCRIPTORCOMPLEX
60             ,PROPERTY_CONTROLTEXTEMPHASISMARK
61             ,PROPERTY_CHARROTATION
62             ,PROPERTY_CHARSCALEWIDTH
63             ,PROPERTY_CHARSTRIKEOUT
64             ,PROPERTY_CHARUNDERLINECOLOR
65             ,PROPERTY_CHARUNDERLINE
66             ,PROPERTY_CHARWEIGHT
67             ,PROPERTY_CHARWORDMODE
68             ,PROPERTY_CHARFLASH
69             ,PROPERTY_CHARAUTOKERNING
70             ,PROPERTY_CHARESCAPEMENTHEIGHT
71             ,PROPERTY_CHARLOCALE
72             ,PROPERTY_CHARESCAPEMENT
73             ,PROPERTY_CHARCASEMAP
74             ,PROPERTY_CHARCOMBINEISON
75             ,PROPERTY_CHARCOMBINEPREFIX
76             ,PROPERTY_CHARCOMBINESUFFIX
77             ,PROPERTY_CHARHIDDEN
78             ,PROPERTY_CHARSHADOWED
79             ,PROPERTY_CHARCONTOURED
80             ,PROPERTY_VISITEDCHARSTYLENAME
81             ,PROPERTY_UNVISITEDCHARSTYLENAME
82             ,PROPERTY_CHARKERNING
83             ,PROPERTY_MASTERFIELDS
84             ,PROPERTY_DETAILFIELDS
85             ,PROPERTY_PARAADJUST
86             , PROPERTY_CHAREMPHASISASIAN
87             , PROPERTY_CHARFONTNAMEASIAN
88             , PROPERTY_CHARFONTSTYLENAMEASIAN
89             , PROPERTY_CHARFONTFAMILYASIAN
90             , PROPERTY_CHARFONTCHARSETASIAN
91             , PROPERTY_CHARFONTPITCHASIAN
92             , PROPERTY_CHARHEIGHTASIAN
93             , PROPERTY_CHARUNDERLINEASIAN
94             , PROPERTY_CHARWEIGHTASIAN
95             , PROPERTY_CHARPOSTUREASIAN
96             , PROPERTY_CHARWORDMODEASIAN
97             , PROPERTY_CHARROTATIONASIAN
98             , PROPERTY_CHARSCALEWIDTHASIAN
99             , PROPERTY_CHARLOCALEASIAN
100             , PROPERTY_CHAREMPHASISCOMPLEX
101             , PROPERTY_CHARFONTNAMECOMPLEX
102             , PROPERTY_CHARFONTSTYLENAMECOMPLEX
103             , PROPERTY_CHARFONTFAMILYCOMPLEX
104             , PROPERTY_CHARFONTCHARSETCOMPLEX
105             , PROPERTY_CHARFONTPITCHCOMPLEX
106             , PROPERTY_CHARHEIGHTCOMPLEX
107             , PROPERTY_CHARUNDERLINECOMPLEX
108             , PROPERTY_CHARWEIGHTCOMPLEX
109             , PROPERTY_CHARPOSTURECOMPLEX
110             , PROPERTY_CHARWORDMODECOMPLEX
111             , PROPERTY_CHARROTATIONCOMPLEX
112             , PROPERTY_CHARSCALEWIDTHCOMPLEX
113             , PROPERTY_CHARLOCALECOMPLEX
114 
115 	};
116 	return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
117 }
118 
DBG_NAME(rpt_OImageControl)119 DBG_NAME( rpt_OImageControl )
120 // -----------------------------------------------------------------------------
121 OImageControl::OImageControl(uno::Reference< uno::XComponentContext > const & _xContext)
122 :ImageControlBase(m_aMutex)
123 ,ImageControlPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getImageOptionals())
124 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
125 ,m_nScaleMode(awt::ImageScaleMode::NONE)
126 ,m_bPreserveIRI(sal_True)
127 {
128 	DBG_CTOR( rpt_OImageControl,NULL);
129 	m_aProps.aComponent.m_sName  = RPT_RESSTRING(RID_STR_IMAGECONTROL,m_aProps.aComponent.m_xContext->getServiceManager());
130 }
131 // -----------------------------------------------------------------------------
OImageControl(uno::Reference<uno::XComponentContext> const & _xContext,const uno::Reference<lang::XMultiServiceFactory> & _xFactory,uno::Reference<drawing::XShape> & _xShape)132 OImageControl::OImageControl(uno::Reference< uno::XComponentContext > const & _xContext
133                            ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
134                            ,uno::Reference< drawing::XShape >& _xShape)
135 :ImageControlBase(m_aMutex)
136 ,ImageControlPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getImageOptionals())
137 ,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
138 ,m_nScaleMode(awt::ImageScaleMode::NONE)
139 ,m_bPreserveIRI(sal_True)
140 {
141 	DBG_CTOR( rpt_OImageControl,NULL);
142 	m_aProps.aComponent.m_sName  = RPT_RESSTRING(RID_STR_IMAGECONTROL,m_aProps.aComponent.m_xContext->getServiceManager());
143     m_aProps.aComponent.m_xFactory = _xFactory;
144     osl_incrementInterlockedCount( &m_refCount );
145     {
146         m_aProps.aComponent.setShape(_xShape,this,m_refCount);
147     }
148     osl_decrementInterlockedCount( &m_refCount );
149 }
150 // -----------------------------------------------------------------------------
~OImageControl()151 OImageControl::~OImageControl()
152 {
153     DBG_DTOR( rpt_OImageControl,NULL);
154 }
155 // -----------------------------------------------------------------------------
156 //IMPLEMENT_FORWARD_XINTERFACE2(OImageControl,ImageControlBase,ImageControlPropertySet)
IMPLEMENT_FORWARD_REFCOUNT(OImageControl,ImageControlBase)157 IMPLEMENT_FORWARD_REFCOUNT( OImageControl, ImageControlBase )
158 // --------------------------------------------------------------------------------
159 uno::Any SAL_CALL OImageControl::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
160 {
161 	uno::Any aReturn = ImageControlBase::queryInterface(_rType);
162     if ( !aReturn.hasValue() )
163         aReturn = ImageControlPropertySet::queryInterface(_rType);
164 
165     if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
166         return aReturn;
167 
168 	return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
169 }
170 
171 // -----------------------------------------------------------------------------
dispose()172 void SAL_CALL OImageControl::dispose() throw(uno::RuntimeException)
173 {
174 	ImageControlPropertySet::dispose();
175 	cppu::WeakComponentImplHelperBase::dispose();
176 }
177 // -----------------------------------------------------------------------------
getImplementationName_Static()178 ::rtl::OUString OImageControl::getImplementationName_Static(  ) throw(uno::RuntimeException)
179 {
180 	return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OImageControl"));
181 }
182 
183 //--------------------------------------------------------------------------
getImplementationName()184 ::rtl::OUString SAL_CALL OImageControl::getImplementationName(  ) throw(uno::RuntimeException)
185 {
186 	return getImplementationName_Static();
187 }
188 //--------------------------------------------------------------------------
getSupportedServiceNames_Static()189 uno::Sequence< ::rtl::OUString > OImageControl::getSupportedServiceNames_Static(  ) throw(uno::RuntimeException)
190 {
191 	uno::Sequence< ::rtl::OUString > aServices(1);
192 	aServices.getArray()[0] = SERVICE_IMAGECONTROL;
193 
194 	return aServices;
195 }
196 //------------------------------------------------------------------------------
create(uno::Reference<uno::XComponentContext> const & xContext)197 uno::Reference< uno::XInterface > OImageControl::create(uno::Reference< uno::XComponentContext > const & xContext)
198 {
199 	return *(new OImageControl(xContext));
200 }
201 
202 //--------------------------------------------------------------------------
getSupportedServiceNames()203 uno::Sequence< ::rtl::OUString > SAL_CALL OImageControl::getSupportedServiceNames(  ) throw(uno::RuntimeException)
204 {
205 	return getSupportedServiceNames_Static();
206 }
207 //------------------------------------------------------------------------------
supportsService(const::rtl::OUString & ServiceName)208 sal_Bool SAL_CALL OImageControl::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
209 {
210 	return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
211 }
212 // -----------------------------------------------------------------------------
213 // XReportComponent
214 REPORTCOMPONENT_IMPL(OImageControl,m_aProps.aComponent)
215 REPORTCOMPONENT_IMPL2(OImageControl,m_aProps.aComponent)
REPORTCOMPONENT_NOMASTERDETAIL(OImageControl)216 REPORTCOMPONENT_NOMASTERDETAIL(OImageControl)
217 //REPORTCONTROLFORMAT_IMPL(OImageControl,m_aProps.aFormatProperties)
218 NO_REPORTCONTROLFORMAT_IMPL(OImageControl)
219 ::rtl::OUString SAL_CALL OImageControl::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException)
220 {
221 	::osl::MutexGuard aGuard(m_aMutex);
222 	return m_aProps.aFormatProperties.sHyperLinkURL;
223 }
setHyperLinkURL(const::rtl::OUString & the_value)224 void SAL_CALL OImageControl::setHyperLinkURL(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
225 {
226 	set(PROPERTY_HYPERLINKURL,the_value,m_aProps.aFormatProperties.sHyperLinkURL);
227 }
getHyperLinkTarget()228 ::rtl::OUString SAL_CALL OImageControl::getHyperLinkTarget() throw (uno::RuntimeException, beans::UnknownPropertyException)
229 {
230 	::osl::MutexGuard aGuard(m_aMutex);
231 	return m_aProps.aFormatProperties.sHyperLinkTarget;
232 }
setHyperLinkTarget(const::rtl::OUString & the_value)233 void SAL_CALL OImageControl::setHyperLinkTarget(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
234 {
235 	set(PROPERTY_HYPERLINKTARGET,the_value,m_aProps.aFormatProperties.sHyperLinkTarget);
236 }
getHyperLinkName()237 ::rtl::OUString SAL_CALL OImageControl::getHyperLinkName() throw (uno::RuntimeException, beans::UnknownPropertyException)
238 {
239 	::osl::MutexGuard aGuard(m_aMutex);
240 	return m_aProps.aFormatProperties.sHyperLinkName;
241 }
setHyperLinkName(const::rtl::OUString & the_value)242 void SAL_CALL OImageControl::setHyperLinkName(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
243 {
244 	set(PROPERTY_HYPERLINKNAME,the_value,m_aProps.aFormatProperties.sHyperLinkName);
245 }
246 
247 // -----------------------------------------------------------------------------
getControlBackground()248 ::sal_Int32 SAL_CALL OImageControl::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException)
249 {
250 	::osl::MutexGuard aGuard(m_aMutex);
251 	return m_aProps.aFormatProperties.m_bBackgroundTransparent ? COL_TRANSPARENT : m_aProps.aFormatProperties.nBackgroundColor;
252 }
253 
setControlBackground(::sal_Int32 _backgroundcolor)254 void SAL_CALL OImageControl::setControlBackground( ::sal_Int32 _backgroundcolor ) throw (uno::RuntimeException, beans::UnknownPropertyException)
255 {
256     sal_Bool bTransparent = _backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT);
257     setControlBackgroundTransparent(bTransparent);
258     if ( !bTransparent )
259 	    set(PROPERTY_CONTROLBACKGROUND,_backgroundcolor,m_aProps.aFormatProperties.nBackgroundColor);
260 }
261 
getControlBackgroundTransparent()262 ::sal_Bool SAL_CALL OImageControl::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
263 {
264     ::osl::MutexGuard aGuard(m_aMutex);
265     return m_aProps.aFormatProperties.m_bBackgroundTransparent;
266 }
267 
setControlBackgroundTransparent(::sal_Bool _controlbackgroundtransparent)268 void SAL_CALL OImageControl::setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent ) throw (beans::UnknownPropertyException, uno::RuntimeException)
269 {
270     set(PROPERTY_CONTROLBACKGROUNDTRANSPARENT,_controlbackgroundtransparent,m_aProps.aFormatProperties.m_bBackgroundTransparent);
271     if ( _controlbackgroundtransparent )
272         set(PROPERTY_CONTROLBACKGROUND,static_cast<sal_Int32>(COL_TRANSPARENT),m_aProps.aFormatProperties.nBackgroundColor);
273 }
274 
275 // -----------------------------------------------------------------------------
getPropertySetInfo()276 uno::Reference< beans::XPropertySetInfo > SAL_CALL OImageControl::getPropertySetInfo(  ) throw(uno::RuntimeException)
277 {
278 	return ImageControlPropertySet::getPropertySetInfo();
279 }
280 // -----------------------------------------------------------------------------
setPropertyValue(const::rtl::OUString & aPropertyName,const uno::Any & aValue)281 void SAL_CALL OImageControl::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
282 {
283 	ImageControlPropertySet::setPropertyValue( aPropertyName, aValue );
284 }
285 // -----------------------------------------------------------------------------
getPropertyValue(const::rtl::OUString & PropertyName)286 uno::Any SAL_CALL OImageControl::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
287 {
288 	return ImageControlPropertySet::getPropertyValue( PropertyName);
289 }
290 // -----------------------------------------------------------------------------
addPropertyChangeListener(const::rtl::OUString & aPropertyName,const uno::Reference<beans::XPropertyChangeListener> & xListener)291 void SAL_CALL OImageControl::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
292 {
293 	ImageControlPropertySet::addPropertyChangeListener( aPropertyName, xListener );
294 }
295 // -----------------------------------------------------------------------------
removePropertyChangeListener(const::rtl::OUString & aPropertyName,const uno::Reference<beans::XPropertyChangeListener> & aListener)296 void SAL_CALL OImageControl::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
297 {
298 	ImageControlPropertySet::removePropertyChangeListener( aPropertyName, aListener );
299 }
300 // -----------------------------------------------------------------------------
addVetoableChangeListener(const::rtl::OUString & PropertyName,const uno::Reference<beans::XVetoableChangeListener> & aListener)301 void SAL_CALL OImageControl::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
302 {
303 	ImageControlPropertySet::addVetoableChangeListener( PropertyName, aListener );
304 }
305 // -----------------------------------------------------------------------------
removeVetoableChangeListener(const::rtl::OUString & PropertyName,const uno::Reference<beans::XVetoableChangeListener> & aListener)306 void SAL_CALL OImageControl::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
307 {
308 	ImageControlPropertySet::removeVetoableChangeListener( PropertyName, aListener );
309 }
310 // -----------------------------------------------------------------------------
311 // XReportControlModel
getDataField()312 ::rtl::OUString SAL_CALL OImageControl::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
313 {
314 	::osl::MutexGuard aGuard(m_aMutex);
315 	return m_aProps.aDataField;
316 }
317 // -----------------------------------------------------------------------------
setDataField(const::rtl::OUString & _datafield)318 void SAL_CALL OImageControl::setDataField( const ::rtl::OUString& _datafield ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
319 {
320 	set(PROPERTY_DATAFIELD,_datafield,m_aProps.aDataField);
321 }
322 // -----------------------------------------------------------------------------
323 // -----------------------------------------------------------------------------
getPrintWhenGroupChange()324 ::sal_Bool SAL_CALL OImageControl::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
325 {
326 	::osl::MutexGuard aGuard(m_aMutex);
327 	return m_aProps.bPrintWhenGroupChange;
328 }
329 // -----------------------------------------------------------------------------
setPrintWhenGroupChange(::sal_Bool _printwhengroupchange)330 void SAL_CALL OImageControl::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
331 {
332 	set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
333 }
334 // -----------------------------------------------------------------------------
getConditionalPrintExpression()335 ::rtl::OUString SAL_CALL OImageControl::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
336 {
337 	::osl::MutexGuard aGuard(m_aMutex);
338 	return m_aProps.aConditionalPrintExpression;
339 }
340 // -----------------------------------------------------------------------------
setConditionalPrintExpression(const::rtl::OUString & _conditionalprintexpression)341 void SAL_CALL OImageControl::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
342 {
343 	set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
344 }
345 
346 // -----------------------------------------------------------------------------
347 
348 // XCloneable
createClone()349 uno::Reference< util::XCloneable > SAL_CALL OImageControl::createClone(  ) throw (uno::RuntimeException)
350 {
351     uno::Reference< report::XReportComponent> xSource = this;
352     uno::Reference< report::XImageControl> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_IMAGECONTROL),uno::UNO_QUERY_THROW);
353 	return xSet.get();
354 }
355 // -----------------------------------------------------------------------------
356 
357 // XImageControl
358 // -----------------------------------------------------------------------------
getImageURL()359 ::rtl::OUString SAL_CALL OImageControl::getImageURL() throw (uno::RuntimeException)
360 {
361 	::osl::MutexGuard aGuard(m_aMutex);
362 	return m_aImageURL;
363 }
364 // -----------------------------------------------------------------------------
setImageURL(const::rtl::OUString & _imageurl)365 void SAL_CALL OImageControl::setImageURL( const ::rtl::OUString& _imageurl ) throw (uno::RuntimeException)
366 {
367 	set(PROPERTY_IMAGEURL,_imageurl,m_aImageURL);
368 }
369 // -----------------------------------------------------------------------------
getImageProducer()370 uno::Reference< awt::XImageProducer > SAL_CALL OImageControl::getImageProducer(  ) throw (uno::RuntimeException)
371 {
372 	return uno::Reference< awt::XImageProducer >();
373 }
374 // -----------------------------------------------------------------------------
375 // XChild
getParent()376 uno::Reference< uno::XInterface > SAL_CALL OImageControl::getParent(  ) throw (uno::RuntimeException)
377 {
378 	return OShapeHelper::getParent(this);
379 }
380 // -----------------------------------------------------------------------------
setParent(const uno::Reference<uno::XInterface> & Parent)381 void SAL_CALL OImageControl::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
382 {
383 	OShapeHelper::setParent(Parent,this);
384 }
createFormatCondition()385 uno::Reference< report::XFormatCondition > SAL_CALL OImageControl::createFormatCondition(  ) throw (uno::Exception, uno::RuntimeException)
386 {
387 	return new OFormatCondition(m_aProps.aComponent.m_xContext);
388 }
389 // -----------------------------------------------------------------------------
390 // XContainer
addContainerListener(const uno::Reference<container::XContainerListener> & xListener)391 void SAL_CALL OImageControl::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
392 {
393 	m_aProps.addContainerListener(xListener);
394 }
395 // -----------------------------------------------------------------------------
removeContainerListener(const uno::Reference<container::XContainerListener> & xListener)396 void SAL_CALL OImageControl::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
397 {
398 	m_aProps.removeContainerListener(xListener);
399 }
400 // -----------------------------------------------------------------------------
401 // XElementAccess
getElementType()402 uno::Type SAL_CALL OImageControl::getElementType(  ) throw (uno::RuntimeException)
403 {
404 	return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
405 }
406 // -----------------------------------------------------------------------------
hasElements()407 ::sal_Bool SAL_CALL OImageControl::hasElements(  ) throw (uno::RuntimeException)
408 {
409 	return m_aProps.hasElements();
410 }
411 // -----------------------------------------------------------------------------
412 // XIndexContainer
insertByIndex(::sal_Int32 Index,const uno::Any & Element)413 void SAL_CALL OImageControl::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
414 {
415     m_aProps.insertByIndex(Index,Element);
416 }
417 // -----------------------------------------------------------------------------
removeByIndex(::sal_Int32 Index)418 void SAL_CALL OImageControl::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
419 {
420     m_aProps.removeByIndex(Index);
421 }
422 // -----------------------------------------------------------------------------
423 // XIndexReplace
replaceByIndex(::sal_Int32 Index,const uno::Any & Element)424 void SAL_CALL OImageControl::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
425 {
426     m_aProps.replaceByIndex(Index,Element);
427 }
428 // -----------------------------------------------------------------------------
429 // XIndexAccess
getCount()430 ::sal_Int32 SAL_CALL OImageControl::getCount(  ) throw (uno::RuntimeException)
431 {
432 	return m_aProps.getCount();
433 }
434 // -----------------------------------------------------------------------------
getByIndex(::sal_Int32 Index)435 uno::Any SAL_CALL OImageControl::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
436 {
437     return m_aProps.getByIndex( Index );
438 }
439 // -----------------------------------------------------------------------------
440 // -----------------------------------------------------------------------------
441 // XShape
getPosition()442 awt::Point SAL_CALL OImageControl::getPosition(  ) throw (uno::RuntimeException)
443 {
444 	return OShapeHelper::getPosition(this);
445 }
446 // -----------------------------------------------------------------------------
setPosition(const awt::Point & aPosition)447 void SAL_CALL OImageControl::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
448 {
449     OShapeHelper::setPosition(aPosition,this);
450 }
451 // -----------------------------------------------------------------------------
getSize()452 awt::Size SAL_CALL OImageControl::getSize(  ) throw (uno::RuntimeException)
453 {
454 	return OShapeHelper::getSize(this);
455 }
456 // -----------------------------------------------------------------------------
setSize(const awt::Size & aSize)457 void SAL_CALL OImageControl::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
458 {
459     OShapeHelper::setSize(aSize,this);
460 }
461 // -----------------------------------------------------------------------------
462 
463 // XShapeDescriptor
getShapeType()464 ::rtl::OUString SAL_CALL OImageControl::getShapeType(  ) throw (uno::RuntimeException)
465 {
466 	return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"));
467 }
468 // -----------------------------------------------------------------------------
getScaleMode()469 ::sal_Int16 SAL_CALL OImageControl::getScaleMode() throw (uno::RuntimeException)
470 {
471     ::osl::MutexGuard aGuard(m_aMutex);
472     return m_nScaleMode;
473 }
474 // -----------------------------------------------------------------------------
setScaleMode(::sal_Int16 _scalemode)475 void SAL_CALL OImageControl::setScaleMode( ::sal_Int16 _scalemode ) throw (lang::IllegalArgumentException, uno::RuntimeException)
476 {
477     if ( _scalemode < awt::ImageScaleMode::NONE ||_scalemode > awt::ImageScaleMode::ANISOTROPIC )
478         throw lang::IllegalArgumentException();
479     set(PROPERTY_SCALEMODE,_scalemode,m_nScaleMode);
480 }
481 // -----------------------------------------------------------------------------
getPreserveIRI()482 ::sal_Bool SAL_CALL OImageControl::getPreserveIRI() throw (uno::RuntimeException)
483 {
484     ::osl::MutexGuard aGuard(m_aMutex);
485     return m_bPreserveIRI;
486 }
487 // -----------------------------------------------------------------------------
setPreserveIRI(::sal_Bool _preserveiri)488 void SAL_CALL OImageControl::setPreserveIRI( ::sal_Bool _preserveiri ) throw (uno::RuntimeException)
489 {
490     set(PROPERTY_PRESERVEIRI,_preserveiri,m_bPreserveIRI);
491 }
492 // =============================================================================
493 } // namespace reportdesign
494 // =============================================================================
495 
496