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 <comphelper/uno3.hxx>
23 #include <cppuhelper/propertysetmixin.hxx>
24 #include <com/sun/star/report/XFunction.hpp>
25 #include <cppuhelper/basemutex.hxx>
26 #include "ReportControlModel.hxx"
27 #include <cppuhelper/compbase.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
30 namespace reportdesign
32 typedef ::cppu::PropertySetMixin
< css::report::XFunction
> FunctionPropertySet
;
33 typedef ::cppu::WeakComponentImplHelper
< css::report::XFunction
34 ,css::lang::XServiceInfo
> FunctionBase
;
36 /** \class OFunction Defines the implementation of a \interface com:::sun::star::report::XFunction
37 * \ingroup reportdesign_api
40 class OFunction
: public cppu::BaseMutex
,
42 public FunctionPropertySet
44 css::beans::Optional
< OUString
> m_sInitialFormula
;
45 css::uno::WeakReference
< css::report::XFunctions
> m_xParent
;
49 bool m_bDeepTraversing
;
51 OFunction(const OFunction
&) = delete;
52 OFunction
& operator=(const OFunction
&) = delete;
54 template <typename T
> void set( const OUString
& _sProperty
60 ::osl::MutexGuard
aGuard(m_aMutex
);
61 prepareSet(_sProperty
, css::uno::makeAny(_member
), css::uno::makeAny(Value
), &l
);
66 void set( const OUString
& _sProperty
72 ::osl::MutexGuard
aGuard(m_aMutex
);
73 prepareSet(_sProperty
, css::uno::makeAny(_member
), css::uno::makeAny(Value
), &l
);
79 virtual ~OFunction() override
;
81 explicit OFunction(css::uno::Reference
< css::uno::XComponentContext
> const & _xContext
);
84 // css::lang::XServiceInfo
85 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
86 virtual OUString SAL_CALL
getImplementationName( ) override
;
87 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
89 /// @throws css::uno::RuntimeException
90 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
91 /// @throws css::uno::RuntimeException
92 static OUString
getImplementationName_Static();
93 static css::uno::Reference
< css::uno::XInterface
>
94 create(css::uno::Reference
< css::uno::XComponentContext
> const & xContext
);
95 // css::beans::XPropertySet
96 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
97 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
98 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
99 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
100 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
101 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
102 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
104 // css::report::XFunction:
105 virtual sal_Bool SAL_CALL
getPreEvaluated() override
;
106 virtual void SAL_CALL
setPreEvaluated(sal_Bool the_value
) override
;
107 virtual sal_Bool SAL_CALL
getDeepTraversing() override
;
108 virtual void SAL_CALL
setDeepTraversing(sal_Bool the_value
) override
;
109 virtual OUString SAL_CALL
getName() override
;
110 virtual void SAL_CALL
setName(const OUString
& the_value
) override
;
111 virtual OUString SAL_CALL
getFormula() override
;
112 virtual void SAL_CALL
setFormula(const OUString
& the_value
) override
;
113 virtual css::beans::Optional
< OUString
> SAL_CALL
getInitialFormula() override
;
114 virtual void SAL_CALL
setInitialFormula(const css::beans::Optional
< OUString
> & the_value
) override
;
117 virtual void SAL_CALL
dispose() override
;
118 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
) override
120 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
122 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
) override
124 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
128 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getParent( ) override
;
129 virtual void SAL_CALL
setParent( const css::uno::Reference
< css::uno::XInterface
>& Parent
) override
;
132 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FUNCTION_HXX
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */