LibreOffice Module reportdesign (master) 1
Function.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#include <Function.hxx>
20#include <strings.hxx>
22
23namespace reportdesign
24{
25
26 using namespace com::sun::star;
27
28uno::Reference< uno::XInterface > OFunction::create(uno::Reference< uno::XComponentContext > const & xContext)
29{
30 return *(new OFunction(xContext));
31}
32
33
34OFunction::OFunction(uno::Reference< uno::XComponentContext > const & _xContext)
36,FunctionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >())
37,m_bPreEvaluated(false)
38,m_bDeepTraversing(false)
39{
40 m_sInitialFormula.IsPresent = false;
41}
42
44{
45}
46
48
49void SAL_CALL OFunction::dispose()
50{
52 cppu::WeakComponentImplHelperBase::dispose();
53}
54
56{
57 return "com.sun.star.comp.report.OFunction";
58}
59
60
62{
64}
65
67{
68 uno::Sequence< OUString > aServices { SERVICE_FUNCTION };
69
70 return aServices;
71}
72
73uno::Sequence< OUString > SAL_CALL OFunction::getSupportedServiceNames( )
74{
76}
77
78sal_Bool SAL_CALL OFunction::supportsService(const OUString& ServiceName)
79{
81}
82
83uno::Reference< beans::XPropertySetInfo > SAL_CALL OFunction::getPropertySetInfo( )
84{
86}
87
88void SAL_CALL OFunction::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
89{
90 FunctionPropertySet::setPropertyValue( aPropertyName, aValue );
91}
92
93uno::Any SAL_CALL OFunction::getPropertyValue( const OUString& PropertyName )
94{
95 return FunctionPropertySet::getPropertyValue( PropertyName);
96}
97
98void SAL_CALL OFunction::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
99{
100 FunctionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
101}
102
103void SAL_CALL OFunction::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
104{
105 FunctionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
106}
107
108void SAL_CALL OFunction::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
109{
110 FunctionPropertySet::addVetoableChangeListener( PropertyName, aListener );
111}
112
113void SAL_CALL OFunction::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
114{
115 FunctionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
116}
117
118// report::XFunction:
120{
121 osl::MutexGuard g(m_aMutex);
122 return m_bPreEvaluated;
123}
124
125
126void SAL_CALL OFunction::setPreEvaluated(sal_Bool the_value)
127{
129}
130
132{
133 osl::MutexGuard g(m_aMutex);
134 return m_bDeepTraversing;
135}
136
137
139{
141}
142
143
144OUString SAL_CALL OFunction::getName()
145{
146 osl::MutexGuard g(m_aMutex);
147 return m_sName;
148}
149
150
151void SAL_CALL OFunction::setName(const OUString & the_value)
152{
153 set(PROPERTY_NAME,the_value,m_sName);
154}
155
156OUString SAL_CALL OFunction::getFormula()
157{
158 osl::MutexGuard g(m_aMutex);
159 return m_sFormula;
160}
161
162void SAL_CALL OFunction::setFormula(const OUString & the_value)
163{
165}
166
167beans::Optional< OUString> SAL_CALL OFunction::getInitialFormula()
168{
169 osl::MutexGuard g(m_aMutex);
170 return m_sInitialFormula;
171}
172
173void SAL_CALL OFunction::setInitialFormula(const beans::Optional< OUString> & the_value)
174{
176}
177
178// XChild
179uno::Reference< uno::XInterface > SAL_CALL OFunction::getParent( )
180{
181 osl::MutexGuard g(m_aMutex);
182 return m_xParent;
183}
184
185void SAL_CALL OFunction::setParent( const uno::Reference< uno::XInterface >& Parent )
186{
187 osl::MutexGuard g(m_aMutex);
188 if ( Parent.is() )
189 {
190 uno::Reference< report::XFunctions> xFunctions(Parent,uno::UNO_QUERY_THROW);
191 m_xParent = xFunctions;
192 }
193 else
194 m_xParent.clear();
195}
196
197
198} // namespace reportdesign
199
200
201/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
mutable::osl::Mutex m_aMutex
virtual css::uno::Any SAL_CALL getPropertyValue(rtl::OUString const &propertyName) SAL_OVERRIDE
virtual void SAL_CALL removeVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() SAL_OVERRIDE
virtual void SAL_CALL addPropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
virtual void SAL_CALL addVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
virtual void SAL_CALL setPropertyValue(rtl::OUString const &propertyName, css::uno::Any const &value) SAL_OVERRIDE
virtual void SAL_CALL removePropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
implementation of a
Definition: Function.hxx:43
static css::uno::Reference< css::uno::XInterface > create(css::uno::Reference< css::uno::XComponentContext > const &xContext)
Definition: Function.cxx:28
virtual ~OFunction() override
Definition: Function.cxx:43
virtual void SAL_CALL setDeepTraversing(sal_Bool the_value) override
Definition: Function.cxx:138
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: Function.cxx:185
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: Function.cxx:103
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: Function.cxx:179
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: Function.cxx:108
virtual void SAL_CALL setName(const OUString &the_value) override
Definition: Function.cxx:151
void set(const OUString &_sProperty, const T &Value, T &_member)
Definition: Function.hxx:54
virtual void SAL_CALL setFormula(const OUString &the_value) override
Definition: Function.cxx:162
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: Function.cxx:113
virtual OUString SAL_CALL getFormula() override
Definition: Function.cxx:156
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: Function.cxx:88
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Function.cxx:73
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
Definition: Function.cxx:66
static OUString getImplementationName_Static()
Definition: Function.cxx:55
virtual sal_Bool SAL_CALL getPreEvaluated() override
Definition: Function.cxx:119
virtual void SAL_CALL setInitialFormula(const css::beans::Optional< OUString > &the_value) override
Definition: Function.cxx:173
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: Function.cxx:93
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Function.cxx:83
css::uno::WeakReference< css::report::XFunctions > m_xParent
Definition: Function.hxx:45
virtual OUString SAL_CALL getImplementationName() override
Definition: Function.cxx:61
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: Function.cxx:98
css::beans::Optional< OUString > m_sInitialFormula
Definition: Function.hxx:44
virtual css::beans::Optional< OUString > SAL_CALL getInitialFormula() override
Definition: Function.cxx:167
virtual sal_Bool SAL_CALL getDeepTraversing() override
Definition: Function.cxx:131
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: Function.cxx:78
OFunction(const OFunction &)=delete
virtual OUString SAL_CALL getName() override
Definition: Function.cxx:144
virtual void SAL_CALL setPreEvaluated(sal_Bool the_value) override
Definition: Function.cxx:126
std::mutex m_aMutex
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
::cppu::WeakComponentImplHelper< css::report::XFunction,css::lang::XServiceInfo > FunctionBase
Definition: Function.hxx:34
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
constexpr OUStringLiteral PROPERTY_NAME
Definition: strings.hxx:36
constexpr OUStringLiteral SERVICE_FUNCTION
Definition: strings.hxx:26
constexpr OUStringLiteral PROPERTY_DEEPTRAVERSING
Definition: strings.hxx:192
constexpr OUStringLiteral PROPERTY_INITIALFORMULA
Definition: strings.hxx:190
constexpr OUStringLiteral PROPERTY_PREEVALUATED
Definition: strings.hxx:191
constexpr OUStringLiteral PROPERTY_FORMULA
Definition: strings.hxx:189
unsigned char sal_Bool
Reference< XComponentContext > _xContext