bump product version to 5.0.4.1
[LibreOffice.git] / reportdesign / source / core / inc / FormatCondition.hxx
blobd7739f76385b7378456d946b75e042b2afee5bba
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FORMATCONDITION_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FORMATCONDITION_HXX
22 #include <cppuhelper/propertysetmixin.hxx>
23 #include <com/sun/star/report/XFormatCondition.hpp>
24 #include "ReportControlModel.hxx"
25 #include <cppuhelper/compbase2.hxx>
26 #include <comphelper/broadcasthelper.hxx>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include "ReportHelperDefines.hxx"
30 namespace reportdesign
32 typedef ::cppu::PropertySetMixin< com::sun::star::report::XFormatCondition > FormatConditionPropertySet;
33 typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XFormatCondition
34 ,com::sun::star::lang::XServiceInfo > FormatConditionBase;
36 /** \class OFormatCondition Defines the implementation of a \interface com:::sun::star::report::XFormatCondition
37 * \ingroup reportdesign_api
40 class OFormatCondition : public comphelper::OBaseMutex,
41 public FormatConditionBase,
42 public FormatConditionPropertySet
44 OFormatProperties m_aFormatProperties;
45 OUString m_sFormula;
46 bool m_bEnabled;
47 private:
48 OFormatCondition(const OFormatCondition&) SAL_DELETED_FUNCTION;
49 OFormatCondition& operator=(const OFormatCondition&) SAL_DELETED_FUNCTION;
51 template <typename T> void set( const OUString& _sProperty
52 ,const T& _Value
53 ,T& _member)
55 BoundListeners l;
57 ::osl::MutexGuard aGuard(m_aMutex);
58 prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
59 _member = _Value;
61 l.notify();
63 void set( const OUString& _sProperty
64 ,bool _Value
65 ,bool& _member)
67 BoundListeners l;
69 ::osl::MutexGuard aGuard(m_aMutex);
70 prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
71 _member = _Value;
73 l.notify();
75 protected:
76 virtual ~OFormatCondition();
77 public:
78 explicit OFormatCondition(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
81 DECLARE_XINTERFACE( )
82 // ::com::sun::star::lang::XServiceInfo
83 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
84 virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw( ::com::sun::star::uno::RuntimeException );
88 static OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
89 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
90 create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
91 // com::sun::star::beans::XPropertySet
92 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
93 virtual void SAL_CALL setPropertyValue( const 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, std::exception) SAL_OVERRIDE;
94 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 virtual void SAL_CALL addPropertyChangeListener( const 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, std::exception) SAL_OVERRIDE;
96 virtual void SAL_CALL removePropertyChangeListener( const 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, std::exception) SAL_OVERRIDE;
97 virtual void SAL_CALL addVetoableChangeListener( const 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, std::exception) SAL_OVERRIDE;
98 virtual void SAL_CALL removeVetoableChangeListener( const 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, std::exception) SAL_OVERRIDE;
100 // XFormatCondition
101 virtual sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 virtual void SAL_CALL setEnabled( sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 virtual OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 virtual void SAL_CALL setFormula( const OUString& _formula ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 // XReportControlFormat
107 REPORTCONTROLFORMAT_HEADER()
108 // XComponent
109 virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
110 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
112 cppu::WeakComponentImplHelperBase::addEventListener(aListener);
114 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
116 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
120 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FORMATCONDITION_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */