1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_FUNCTION_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FUNCTION_HXX
22 #include <cppuhelper/propertysetmixin.hxx>
23 #include <com/sun/star/report/XFunction.hpp>
24 #include <cppuhelper/basemutex.hxx>
25 #include "ReportControlModel.hxx"
26 #include <cppuhelper/compbase2.hxx>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
29 namespace reportdesign
31 typedef ::cppu::PropertySetMixin
< com::sun::star::report::XFunction
> FunctionPropertySet
;
32 typedef ::cppu::WeakComponentImplHelper2
< com::sun::star::report::XFunction
33 ,com::sun::star::lang::XServiceInfo
> FunctionBase
;
35 /** \class OFunction Defines the implementation of a \interface com:::sun::star::report::XFunction
36 * \ingroup reportdesign_api
39 class OFunction
: public cppu::BaseMutex
,
41 public FunctionPropertySet
43 com::sun::star::beans::Optional
< OUString
> m_sInitialFormula
;
44 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
45 ::com::sun::star::uno::WeakReference
< ::com::sun::star::report::XFunctions
> m_xParent
;
49 bool m_bDeepTraversing
;
51 OFunction(const OFunction
&) SAL_DELETED_FUNCTION
;
52 OFunction
& operator=(const OFunction
&) SAL_DELETED_FUNCTION
;
54 template <typename T
> void set( const OUString
& _sProperty
60 ::osl::MutexGuard
aGuard(m_aMutex
);
61 prepareSet(_sProperty
, ::com::sun::star::uno::makeAny(_member
), ::com::sun::star::uno::makeAny(_Value
), &l
);
66 void set( const OUString
& _sProperty
72 ::osl::MutexGuard
aGuard(m_aMutex
);
73 prepareSet(_sProperty
, ::com::sun::star::uno::makeAny(_member
), ::com::sun::star::uno::makeAny(_Value
), &l
);
81 explicit OFunction(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & _xContext
);
84 // ::com::sun::star::lang::XServiceInfo
85 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 static ::com::sun::star::uno::Sequence
< OUString
> getSupportedServiceNames_Static() throw( ::com::sun::star::uno::RuntimeException
);
90 static OUString
getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException
);
91 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
92 create(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & xContext
);
93 // com::sun::star::beans::XPropertySet
94 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
95 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
;
96 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
;
97 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
;
98 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
;
99 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
;
100 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
;
102 // ::com::sun::star::report::XFunction:
103 virtual sal_Bool SAL_CALL
getPreEvaluated() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
104 virtual void SAL_CALL
setPreEvaluated(sal_Bool the_value
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 virtual sal_Bool SAL_CALL
getDeepTraversing() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
106 virtual void SAL_CALL
setDeepTraversing(sal_Bool the_value
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 virtual OUString SAL_CALL
getName() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 virtual void SAL_CALL
setName(const OUString
& the_value
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 virtual OUString SAL_CALL
getFormula() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
110 virtual void SAL_CALL
setFormula(const OUString
& the_value
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
111 virtual com::sun::star::beans::Optional
< OUString
> SAL_CALL
getInitialFormula() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 virtual void SAL_CALL
setInitialFormula(const com::sun::star::beans::Optional
< OUString
> & the_value
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 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
118 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
120 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
122 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
126 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getParent( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
127 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
, std::exception
) SAL_OVERRIDE
;
130 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FUNCTION_HXX
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */