LibreOffice Module sc (master)  1
funcuno.hxx
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 
20 #ifndef INCLUDED_SC_INC_FUNCUNO_HXX
21 #define INCLUDED_SC_INC_FUNCUNO_HXX
22 
23 #include <memory>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/sheet/XFunctionAccess.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 #include <cppuhelper/implbase.hxx>
29 #include <svl/lstner.hxx>
30 #include "document.hxx"
31 #include <svl/itemprop.hxx>
32 
33 class ScDocOptions;
34 
35 css::uno::Reference< css::uno::XInterface > SAL_CALL
37  const css::uno::Reference< css::lang::XMultiServiceFactory >& );
38 
40 {
41 private:
43  bool bInUse;
44 
45 public:
47 
48  ScDocument* GetDocument() const { return xDoc.get(); }
49  bool IsInUse() const { return bInUse; }
50  void SetInUse( bool bSet ) { bInUse = bSet; }
51 
52  void SetDocument( ScDocument* pNew );
53  void Clear();
54 };
55 
56 class ScFunctionAccess final : public cppu::WeakImplHelper<
57  css::sheet::XFunctionAccess,
58  css::beans::XPropertySet,
59  css::lang::XServiceInfo>,
60  public SfxListener
61 {
62 private:
64  std::unique_ptr<ScDocOptions> pOptions;
66  bool mbArray;
67  bool mbValid;
68 
69 public:
71  virtual ~ScFunctionAccess() override;
72 
73  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
74 
75  // XFunctionAccess
76  virtual css::uno::Any SAL_CALL callFunction(
77  const OUString& aName,
78  const css::uno::Sequence< css::uno::Any >& aArguments ) override;
79 
80  // XPropertySet
81  virtual css::uno::Reference< css::beans::XPropertySetInfo >
82  SAL_CALL getPropertySetInfo() override;
83  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
84  const css::uno::Any& aValue ) override;
85  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
86  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
87  const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
88  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
89  const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
90  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
91  const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
92  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
93  const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
94 
95  // XServiceInfo
96  virtual OUString SAL_CALL getImplementationName() override;
97  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
98  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
99 };
100 
101 #endif
102 
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~ScFunctionAccess() override
Definition: funcuno.cxx:180
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: funcuno.cxx:214
std::unique_ptr< ScDocOptions > pOptions
Definition: funcuno.hxx:64
bool IsInUse() const
Definition: funcuno.hxx:49
virtual OUString SAL_CALL getImplementationName() override
Definition: funcuno.cxx:209
SfxItemPropertyMap aPropertyMap
Definition: funcuno.hxx:65
ScDocument * GetDocument() const
Definition: funcuno.hxx:48
ScTempDocCache aDocCache
Definition: funcuno.hxx:63
virtual css::uno::Any SAL_CALL callFunction(const OUString &aName, const css::uno::Sequence< css::uno::Any > &aArguments) override
Definition: funcuno.cxx:450
ScDocumentUniquePtr xDoc
Definition: funcuno.hxx:42
void Clear()
Definition: funcuno.cxx:127
css::uno::Reference< css::uno::XInterface > SAL_CALL ScFunctionAccess_CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > &)
void SetDocument(ScDocument *pNew)
Definition: funcuno.cxx:121
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
Definition: document.hxx:2610
void SetInUse(bool bSet)
Definition: funcuno.hxx:50
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
unsigned char sal_Bool
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: funcuno.cxx:190
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: funcuno.cxx:257
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: funcuno.cxx:234
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: funcuno.cxx:226
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: funcuno.cxx:219
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override