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