merge the formfield patch from ooo-build
[ooovba.git] / reportdesign / source / core / inc / FormatCondition.hxx
blobea56ab217f687a3f682f690473fc494020ba873b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FormatCondition.hxx,v $
10 * $Revision: 1.3 $
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 ************************************************************************/
30 #ifndef RPT_FORMATCONDITION_HXX
31 #define RPT_FORMATCONDITION_HXX
33 #include <cppuhelper/propertysetmixin.hxx>
34 #include <com/sun/star/report/XFormatCondition.hpp>
35 #include "ReportControlModel.hxx"
36 #include <cppuhelper/compbase2.hxx>
37 #include <comphelper/broadcasthelper.hxx>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include "ReportHelperDefines.hxx"
41 namespace reportdesign
43 typedef ::cppu::PropertySetMixin< com::sun::star::report::XFormatCondition > FormatConditionPropertySet;
44 typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XFormatCondition
45 ,com::sun::star::lang::XServiceInfo > FormatConditionBase;
47 /** \class OFormatCondition Defines the implementation of a \interface com:::sun::star::report::XFormatCondition
48 * \ingroup reportdesign_api
51 class OFormatCondition : public comphelper::OBaseMutex,
52 public FormatConditionBase,
53 public FormatConditionPropertySet
55 OFormatProperties m_aFormatProperties;
56 ::rtl::OUString m_sFormula;
57 sal_Bool m_bEnabled;
58 private:
59 OFormatCondition(const OFormatCondition&);
60 OFormatCondition& operator=(const OFormatCondition&);
62 template <typename T> void set( const ::rtl::OUString& _sProperty
63 ,const T& _Value
64 ,T& _member)
66 BoundListeners l;
68 ::osl::MutexGuard aGuard(m_aMutex);
69 prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
70 _member = _Value;
72 l.notify();
74 protected:
75 virtual ~OFormatCondition();
76 public:
77 explicit OFormatCondition(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
80 DECLARE_XINTERFACE( )
81 // ::com::sun::star::lang::XServiceInfo
82 virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
83 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
84 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
86 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
87 static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
88 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
89 create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
90 // com::sun::star::beans::XPropertySet
91 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
92 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);
93 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);
94 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);
95 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);
96 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);
97 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);
99 // XFormatCondition
100 virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException);
101 virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException);
102 virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException);
103 virtual void SAL_CALL setFormula( const ::rtl::OUString& _formula ) throw (::com::sun::star::uno::RuntimeException);
105 // XReportControlFormat
106 REPORTCONTROLFORMAT_HEADER()
107 // XComponent
108 virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
109 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
111 cppu::WeakComponentImplHelperBase::addEventListener(aListener);
113 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
115 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
119 #endif //RPT_FORMATCONDITION_HXX