1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FixedText.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef RPT_FIXEDTEXT_HXX
32 #define RPT_FIXEDTEXT_HXX
34 #include <cppuhelper/propertysetmixin.hxx>
35 #include <com/sun/star/report/XFixedText.hpp>
36 #include "ReportControlModel.hxx"
37 #include <cppuhelper/compbase2.hxx>
38 #include <comphelper/broadcasthelper.hxx>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include "ReportHelperDefines.hxx"
43 namespace reportdesign
45 typedef ::cppu::PropertySetMixin
< com::sun::star::report::XFixedText
> FixedTextPropertySet
;
46 typedef ::cppu::WeakComponentImplHelper2
< com::sun::star::report::XFixedText
47 ,com::sun::star::lang::XServiceInfo
> FixedTextBase
;
49 /** \class OFixedText Defines the implementation of a \interface com:::sun::star::report::XFixedText
50 * \ingroup reportdesign_api
53 class OFixedText
: public comphelper::OBaseMutex
,
55 public FixedTextPropertySet
57 friend class OShapeHelper
;
58 OReportControlModel m_aProps
;
59 ::rtl::OUString m_sLabel
;
61 OFixedText(const OFixedText
&);
62 OFixedText
& operator=(const OFixedText
&);
64 template <typename T
> void set( const ::rtl::OUString
& _sProperty
70 ::osl::MutexGuard
aGuard(m_aMutex
);
71 if ( _member
!= _Value
)
73 prepareSet(_sProperty
, ::com::sun::star::uno::makeAny(_member
), ::com::sun::star::uno::makeAny(_Value
), &l
);
79 void checkIndex(sal_Int32 _nIndex
);
81 virtual ~OFixedText();
83 explicit OFixedText(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & _xContext
);
84 explicit OFixedText(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & _xContext
85 ,const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> & _xFactory
86 ,::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& _xShape
);
89 // ::com::sun::star::lang::XServiceInfo
90 virtual ::sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
);
91 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
);
92 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
94 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
95 static ::rtl::OUString
getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
96 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
97 create(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & xContext
);
98 // com::sun::star::beans::XPropertySet
99 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
100 virtual void SAL_CALL
setPropertyValue( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
101 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const ::rtl::OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
102 virtual void SAL_CALL
addPropertyChangeListener( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
103 virtual void SAL_CALL
removePropertyChangeListener( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
104 virtual void SAL_CALL
addVetoableChangeListener( const ::rtl::OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
105 virtual void SAL_CALL
removeVetoableChangeListener( const ::rtl::OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
108 REPORTCOMPONENT_HEADER()
113 virtual ::rtl::OUString SAL_CALL
getShapeType( ) throw (::com::sun::star::uno::RuntimeException
);
115 // XReportControlModel
116 REPORTCONTROLMODEL_HEADER()
119 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone( ) throw (::com::sun::star::uno::RuntimeException
);
122 virtual ::rtl::OUString SAL_CALL
getLabel() throw (::com::sun::star::uno::RuntimeException
);
123 virtual void SAL_CALL
setLabel( const ::rtl::OUString
& _label
) throw (::com::sun::star::uno::RuntimeException
);
125 // ::com::sun::star::report::XReportControlFormat
126 REPORTCONTROLFORMAT_HEADER()
129 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
130 virtual void SAL_CALL
addEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
)
132 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
134 virtual void SAL_CALL
removeEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
)
136 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
140 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getParent( ) throw (::com::sun::star::uno::RuntimeException
);
141 virtual void SAL_CALL
setParent( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Parent
) throw (::com::sun::star::lang::NoSupportException
, ::com::sun::star::uno::RuntimeException
);
143 virtual void SAL_CALL
addContainerListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
144 virtual void SAL_CALL
removeContainerListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
147 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw (::com::sun::star::uno::RuntimeException
);
148 virtual ::sal_Bool SAL_CALL
hasElements( ) throw (::com::sun::star::uno::RuntimeException
);
151 virtual void SAL_CALL
replaceByIndex( ::sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
154 virtual void SAL_CALL
insertByIndex( ::sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
155 virtual void SAL_CALL
removeByIndex( ::sal_Int32 Index
) throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
158 virtual ::sal_Int32 SAL_CALL
getCount( ) throw (::com::sun::star::uno::RuntimeException
);
159 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( ::sal_Int32 Index
) throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
162 #endif //RPT_FIXEDTEXT_HXX