nss: upgrade to release 3.73
[LibreOffice.git] / sc / inc / funcuno.hxx
blobfa370de19241747485b52828a4545b3334fb712a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_SC_INC_FUNCUNO_HXX
21 #define INCLUDED_SC_INC_FUNCUNO_HXX
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>
33 class ScDocOptions;
35 css::uno::Reference< css::uno::XInterface > SAL_CALL
36 ScFunctionAccess_CreateInstance(
37 const css::uno::Reference< css::lang::XMultiServiceFactory >& );
39 class ScTempDocCache
41 private:
42 ScDocumentUniquePtr xDoc;
43 bool bInUse;
45 public:
46 ScTempDocCache();
48 ScDocument* GetDocument() const { return xDoc.get(); }
49 bool IsInUse() const { return bInUse; }
50 void SetInUse( bool bSet ) { bInUse = bSet; }
52 void SetDocument( ScDocument* pNew );
53 void Clear();
56 class ScFunctionAccess final : public cppu::WeakImplHelper<
57 css::sheet::XFunctionAccess,
58 css::beans::XPropertySet,
59 css::lang::XServiceInfo>,
60 public SfxListener
62 private:
63 ScTempDocCache aDocCache;
64 std::unique_ptr<ScDocOptions> pOptions;
65 SfxItemPropertyMap aPropertyMap;
66 bool mbArray;
67 bool mbValid;
69 public:
70 ScFunctionAccess();
71 virtual ~ScFunctionAccess() override;
73 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
75 // XFunctionAccess
76 virtual css::uno::Any SAL_CALL callFunction(
77 const OUString& aName,
78 const css::uno::Sequence< css::uno::Any >& aArguments ) override;
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;
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;
101 #endif
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */