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