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 .
22 #include <com/sun/star/script/provider/XScript.hpp>
23 #include <com/sun/star/document/XScriptInvocationContext.hpp>
24 #include <cppuhelper/implbase.hxx>
25 #include <comphelper/compbase.hxx>
26 #include <comphelper/proparrhlp.hxx>
27 #include <comphelper/propertycontainer2.hxx>
28 #include <basic/sbmeth.hxx>
29 #include <svl/lstner.hxx>
40 typedef ::comphelper::WeakImplHelper
<
41 css::script::provider::XScript
> BasicScriptImpl_BASE
;
44 class BasicScriptImpl
: public BasicScriptImpl_BASE
, public SfxListener
,
45 public ::comphelper::OPropertyContainer2
,
46 public ::comphelper::OPropertyArrayUsageHelper
< BasicScriptImpl
>
49 SbMethodRef m_xMethod
;
51 BasicManager
* m_documentBasicManager
;
52 css::uno::Reference
< css::document::XScriptInvocationContext
>
53 m_xDocumentScriptContext
;
54 // hack, OPropertyContainer doesn't allow you to define a property of unknown
55 // type ( I guess because an Any can't contain an Any... I've always wondered why?
56 // as it's not unusual to do that in corba )
57 css::uno::Sequence
< css::uno::Any
> m_caller
;
60 virtual ::cppu::IPropertyArrayHelper
& getInfoHelper( ) override
;
62 // OPropertyArrayUsageHelper
63 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const override
;
73 BasicManager
& documentBasicManager
,
74 const css::uno::Reference
< css::document::XScriptInvocationContext
>& documentScriptContext
76 virtual ~BasicScriptImpl() override
;
82 DECLARE_XTYPEPROVIDER()
85 virtual css::uno::Any SAL_CALL
invoke(
86 const css::uno::Sequence
< css::uno::Any
>& aParams
,
87 css::uno::Sequence
< sal_Int16
>& aOutParamIndex
,
88 css::uno::Sequence
< css::uno::Any
>& aOutParam
) override
;
90 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
93 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
97 } // namespace basprov
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */