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 #include <Function.hxx>
20 #include <strings.hxx>
21 #include <cppuhelper/supportsservice.hxx>
23 namespace reportdesign
26 using namespace com::sun::star
;
28 uno::Reference
< uno::XInterface
> OFunction::create(uno::Reference
< uno::XComponentContext
> const & xContext
)
30 return *(new OFunction(xContext
));
34 OFunction::OFunction(uno::Reference
< uno::XComponentContext
> const & _xContext
)
35 :FunctionBase(m_aMutex
)
36 ,FunctionPropertySet(_xContext
,IMPLEMENTS_PROPERTY_SET
,uno::Sequence
< OUString
>())
37 ,m_bPreEvaluated(false)
38 ,m_bDeepTraversing(false)
40 m_sInitialFormula
.IsPresent
= false;
43 OFunction::~OFunction()
47 IMPLEMENT_FORWARD_XINTERFACE2(OFunction
,FunctionBase
,FunctionPropertySet
)
49 void SAL_CALL
OFunction::dispose()
51 FunctionPropertySet::dispose();
52 cppu::WeakComponentImplHelperBase::dispose();
55 OUString
OFunction::getImplementationName_Static( )
57 return u
"com.sun.star.comp.report.OFunction"_ustr
;
61 OUString SAL_CALL
OFunction::getImplementationName( )
63 return getImplementationName_Static();
66 uno::Sequence
< OUString
> OFunction::getSupportedServiceNames_Static( )
68 uno::Sequence
< OUString
> aServices
{ SERVICE_FUNCTION
};
73 uno::Sequence
< OUString
> SAL_CALL
OFunction::getSupportedServiceNames( )
75 return getSupportedServiceNames_Static();
78 sal_Bool SAL_CALL
OFunction::supportsService(const OUString
& ServiceName
)
80 return cppu::supportsService(this, ServiceName
);
83 uno::Reference
< beans::XPropertySetInfo
> SAL_CALL
OFunction::getPropertySetInfo( )
85 return FunctionPropertySet::getPropertySetInfo();
88 void SAL_CALL
OFunction::setPropertyValue( const OUString
& aPropertyName
, const uno::Any
& aValue
)
90 FunctionPropertySet::setPropertyValue( aPropertyName
, aValue
);
93 uno::Any SAL_CALL
OFunction::getPropertyValue( const OUString
& PropertyName
)
95 return FunctionPropertySet::getPropertyValue( PropertyName
);
98 void SAL_CALL
OFunction::addPropertyChangeListener( const OUString
& aPropertyName
, const uno::Reference
< beans::XPropertyChangeListener
>& xListener
)
100 FunctionPropertySet::addPropertyChangeListener( aPropertyName
, xListener
);
103 void SAL_CALL
OFunction::removePropertyChangeListener( const OUString
& aPropertyName
, const uno::Reference
< beans::XPropertyChangeListener
>& aListener
)
105 FunctionPropertySet::removePropertyChangeListener( aPropertyName
, aListener
);
108 void SAL_CALL
OFunction::addVetoableChangeListener( const OUString
& PropertyName
, const uno::Reference
< beans::XVetoableChangeListener
>& aListener
)
110 FunctionPropertySet::addVetoableChangeListener( PropertyName
, aListener
);
113 void SAL_CALL
OFunction::removeVetoableChangeListener( const OUString
& PropertyName
, const uno::Reference
< beans::XVetoableChangeListener
>& aListener
)
115 FunctionPropertySet::removeVetoableChangeListener( PropertyName
, aListener
);
118 // report::XFunction:
119 sal_Bool SAL_CALL
OFunction::getPreEvaluated()
121 osl::MutexGuard
g(m_aMutex
);
122 return m_bPreEvaluated
;
126 void SAL_CALL
OFunction::setPreEvaluated(sal_Bool the_value
)
128 set(PROPERTY_PREEVALUATED
,the_value
,m_bPreEvaluated
);
131 sal_Bool SAL_CALL
OFunction::getDeepTraversing()
133 osl::MutexGuard
g(m_aMutex
);
134 return m_bDeepTraversing
;
138 void SAL_CALL
OFunction::setDeepTraversing(sal_Bool the_value
)
140 set(PROPERTY_DEEPTRAVERSING
,the_value
,m_bDeepTraversing
);
144 OUString SAL_CALL
OFunction::getName()
146 osl::MutexGuard
g(m_aMutex
);
151 void SAL_CALL
OFunction::setName(const OUString
& the_value
)
153 set(PROPERTY_NAME
,the_value
,m_sName
);
156 OUString SAL_CALL
OFunction::getFormula()
158 osl::MutexGuard
g(m_aMutex
);
162 void SAL_CALL
OFunction::setFormula(const OUString
& the_value
)
164 set(PROPERTY_FORMULA
,the_value
,m_sFormula
);
167 beans::Optional
< OUString
> SAL_CALL
OFunction::getInitialFormula()
169 osl::MutexGuard
g(m_aMutex
);
170 return m_sInitialFormula
;
173 void SAL_CALL
OFunction::setInitialFormula(const beans::Optional
< OUString
> & the_value
)
175 set(PROPERTY_INITIALFORMULA
,the_value
,m_sInitialFormula
);
179 uno::Reference
< uno::XInterface
> SAL_CALL
OFunction::getParent( )
181 osl::MutexGuard
g(m_aMutex
);
185 void SAL_CALL
OFunction::setParent( const uno::Reference
< uno::XInterface
>& Parent
)
187 osl::MutexGuard
g(m_aMutex
);
190 uno::Reference
< report::XFunctions
> xFunctions(Parent
,uno::UNO_QUERY_THROW
);
191 m_xParent
= xFunctions
;
198 } // namespace reportdesign
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */