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