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