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 
23 namespace reportdesign
24 {
25 
26  using namespace com::sun::star;
27 
28 uno::Reference< uno::XInterface > OFunction::create(uno::Reference< uno::XComponentContext > const & xContext)
29 {
30  return *(new OFunction(xContext));
31 }
32 
33 
34 OFunction::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 
49 void 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 
66 uno::Sequence< OUString > OFunction::getSupportedServiceNames_Static( )
67 {
68  uno::Sequence< OUString > aServices { SERVICE_FUNCTION };
69 
70  return aServices;
71 }
72 
73 uno::Sequence< OUString > SAL_CALL OFunction::getSupportedServiceNames( )
74 {
76 }
77 
78 sal_Bool SAL_CALL OFunction::supportsService(const OUString& ServiceName)
79 {
80  return cppu::supportsService(this, ServiceName);
81 }
82 
83 uno::Reference< beans::XPropertySetInfo > SAL_CALL OFunction::getPropertySetInfo( )
84 {
86 }
87 
88 void SAL_CALL OFunction::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
89 {
90  FunctionPropertySet::setPropertyValue( aPropertyName, aValue );
91 }
92 
93 uno::Any SAL_CALL OFunction::getPropertyValue( const OUString& PropertyName )
94 {
95  return FunctionPropertySet::getPropertyValue( PropertyName);
96 }
97 
98 void SAL_CALL OFunction::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
99 {
100  FunctionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
101 }
102 
103 void SAL_CALL OFunction::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
104 {
105  FunctionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
106 }
107 
108 void SAL_CALL OFunction::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
109 {
110  FunctionPropertySet::addVetoableChangeListener( PropertyName, aListener );
111 }
112 
113 void 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 
126 void 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 
138 void SAL_CALL OFunction::setDeepTraversing(sal_Bool the_value)
139 {
141 }
142 
143 
144 OUString SAL_CALL OFunction::getName()
145 {
146  osl::MutexGuard g(m_aMutex);
147  return m_sName;
148 }
149 
150 
151 void SAL_CALL OFunction::setName(const OUString & the_value)
152 {
153  set(PROPERTY_NAME,the_value,m_sName);
154 }
155 
156 OUString SAL_CALL OFunction::getFormula()
157 {
158  osl::MutexGuard g(m_aMutex);
159  return m_sFormula;
160 }
161 
162 void SAL_CALL OFunction::setFormula(const OUString & the_value)
163 {
164  set(PROPERTY_FORMULA,the_value,m_sFormula);
165 }
166 
167 beans::Optional< OUString> SAL_CALL OFunction::getInitialFormula()
168 {
169  osl::MutexGuard g(m_aMutex);
170  return m_sInitialFormula;
171 }
172 
173 void SAL_CALL OFunction::setInitialFormula(const beans::Optional< OUString> & the_value)
174 {
176 }
177 
178 // XChild
179 uno::Reference< uno::XInterface > SAL_CALL OFunction::getParent( )
180 {
181  osl::MutexGuard g(m_aMutex);
182  return m_xParent;
183 }
184 
185 void 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: */
void set(const OUString &_sProperty, const T &Value, T &_member)
Definition: Function.hxx:54
virtual OUString SAL_CALL getFormula() override
Definition: Function.cxx:156
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
#define PROPERTY_DEEPTRAVERSING
Definition: strings.hxx:192
virtual css::beans::Optional< OUString > SAL_CALL getInitialFormula() override
Definition: Function.cxx:167
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: Function.cxx:113
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() SAL_OVERRIDE
virtual OUString SAL_CALL getName() override
Definition: Function.cxx:144
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: Function.cxx:93
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: Function.cxx:185
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: Function.cxx:179
virtual void SAL_CALL setName(const OUString &the_value) override
Definition: Function.cxx:151
mutable::osl::Mutex m_aMutex
virtual ~OFunction() override
Definition: Function.cxx:43
css::beans::Optional< OUString > m_sInitialFormula
Definition: Function.hxx:44
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: Function.cxx:88
virtual void SAL_CALL removePropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
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 setInitialFormula(const css::beans::Optional< OUString > &the_value) override
Definition: Function.cxx:173
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: Function.cxx:98
std::mutex m_aMutex
implementation of a
Definition: Function.hxx:40
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: Function.cxx:78
virtual void SAL_CALL setPropertyValue(rtl::OUString const &propertyName, css::uno::Any const &value) SAL_OVERRIDE
virtual void SAL_CALL setPreEvaluated(sal_Bool the_value) override
Definition: Function.cxx:126
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Function.cxx:73
#define PROPERTY_NAME
Definition: strings.hxx:36
virtual OUString SAL_CALL getImplementationName() override
Definition: Function.cxx:61
#define PROPERTY_FORMULA
Definition: strings.hxx:189
virtual void SAL_CALL setDeepTraversing(sal_Bool the_value) override
Definition: Function.cxx:138
unsigned char sal_Bool
virtual sal_Bool SAL_CALL getPreEvaluated() override
Definition: Function.cxx:119
virtual void SAL_CALL addPropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
static css::uno::Reference< css::uno::XInterface > create(css::uno::Reference< css::uno::XComponentContext > const &xContext)
Definition: Function.cxx:28
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Function.cxx:83
virtual void SAL_CALL setFormula(const OUString &the_value) override
Definition: Function.cxx:162
static OUString getImplementationName_Static()
Definition: Function.cxx:55
virtual css::uno::Any SAL_CALL getPropertyValue(rtl::OUString const &propertyName) SAL_OVERRIDE
virtual sal_Bool SAL_CALL getDeepTraversing() override
Definition: Function.cxx:131
#define PROPERTY_PREEVALUATED
Definition: strings.hxx:191
virtual void SAL_CALL addVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
OFunction(const OFunction &)=delete
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
Definition: Function.cxx:66
virtual void SAL_CALL removeVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
css::uno::WeakReference< css::report::XFunctions > m_xParent
Definition: Function.hxx:45
constexpr OUStringLiteral SERVICE_FUNCTION
Definition: strings.hxx:26
::cppu::WeakComponentImplHelper< css::report::XFunction,css::lang::XServiceInfo > FunctionBase
Definition: Function.hxx:34
#define PROPERTY_INITIALFORMULA
Definition: strings.hxx:190
bool m_bDetectedRangeSegmentation false
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: Function.cxx:103